Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add switchDefaultLanguage#114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
ZhangYet wants to merge3 commits intoLeetCode-OpenSource:masterfromZhangYet:dev
Closed

add switchDefaultLanguage#114

ZhangYet wants to merge3 commits intoLeetCode-OpenSource:masterfromZhangYet:dev

Conversation

ZhangYet
Copy link

Once you choose the default language, every time you show the new problem with the default language. If you want to change another language, you need to change it in Preference. I think it's convenient for a command to switch default language.

@jdneo
Copy link
Member

Hi@ZhangYet

Thank you for your contribution.

May I ask the background about this PR first? Because I want to better understand how users are using this extension.

Does that mean each time you want to practice a problem, you would like to practice it with multiple languages? How frequently will the 'switching default language' happen?

@jdneojdneo self-requested a reviewFebruary 11, 2019 02:28
@ZhangYet
Copy link
Author

I use Go and Python in my job, so I practice leetcode with go and python. And now I'm going to learn rust so I would like to answer problems with rust.

However, I'm not sure if anyone else wants to switch their default language frequently.

lihuanshuai reacted with thumbs up emoji

@jdneo
Copy link
Member

@ZhangYet Got it.

So from my understanding, you are used to practicing one language for a period, and maybe another language later. During a period of time, you still prefer using one default language rather than selecting the language explicitly each time when picking a problem. Am I right?

@ZhangYet
Copy link
Author

@jdneo In fact, I will switch to python if I have trouble when using other languages.
Anyway if you think it's not a practical feature, you can close this PR. I agree that maybe few people would use this feature

@jdneo
Copy link
Member

jdneo commentedFeb 11, 2019
edited
Loading

@ZhangYet Hmm, Actually I do not want to close this PR for now, cuz we do not know if other users need this feature as well or not. Instead, I create a tracking issue#115. If any user wants this, they can click the 👍 to let us know.

Back to the problem you meet now, the workaround is to remove the default language setting, then the extension will ask you to select the language each time you pick a problem and click something likeNever show again when the extension asks you to set the default language.

At last, I still want to thank you for sending out this PR. 😄 Let's wait for a while to see the users' feedback.

@ZhangYet
Copy link
Author

@jdneo LGTM tks

@jdneo
Copy link
Member

@ZhangYet There are several users click 👍 in the related issue. I think we can start working on this feature now.

import { DialogType, promptForOpenOutputChannel, promptForSignIn } from "../utils/uiUtils";
import { deleteCache } from "./cache";

export async function switchDefaultLanguage(): Promise<void> {
const leetCodeConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("leetcode");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The code here is somehow duplicated withhttps://github.com/jdneo/vscode-leetcode/blob/master/src/commands/show.ts#L44-L51

Can we extract them out to share only one piece of code?

import { DialogType, promptForOpenOutputChannel, promptForSignIn } from "../utils/uiUtils";
import { deleteCache } from "./cache";

export async function switchDefaultLanguage(): Promise<void> {
const leetCodeConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("leetcode");
const language: string | undefined = await vscode.window.showQuickPick(languages, { placeHolder: "Select the language you want to use" });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If the user has already set a default language, we should at least add a ✅mark before the language.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I will do it later for I am going to change my job these days.

Copy link
Member

@jdneojdneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@ZhangYet Some comments

@jdneo
Copy link
Member

@ZhangYet Would you like to keep working on this PR?

@ZhangYet
Copy link
Author

@jdneo Fine. I will fix the conflict.

jdneo reacted with thumbs up emoji

@jdneo
Copy link
Member

Fixed in#178

@ZhangYet Still want to thank you for the engagement and the inspiring feature request 👍

ZhangYet reacted with thumbs up emoji

@jdneojdneo closed thisMar 2, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jdneojdneojdneo requested changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@ZhangYet@jdneo

[8]ページ先頭

©2009-2025 Movatter.jp