Skip to content

Commit 83416f8

Browse files
sheche@microsoft.comsheche@microsoft.com
authored andcommitted
add check for default language
1 parent 927481a commit 83416f8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/commands/show.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ export async function searchProblem(channel: vscode.OutputChannel): Promise<void
3838
async function showProblemInternal(channel: vscode.OutputChannel, id: string): Promise<void> {
3939
try {
4040
const leetCodeConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("leetcode");
41-
const defaultLanguage = leetCodeConfig.get<string>("defaultLanguage");
41+
let defaultLanguage = leetCodeConfig.get<string>("defaultLanguage");
42+
if (defaultLanguage && languages.indexOf(defaultLanguage) < 0) {
43+
defaultLanguage = undefined;
44+
}
4245
const language: string | undefined = defaultLanguage || await vscode.window.showQuickPick(languages, { placeHolder: "Select the language you want to use" });
4346
if (!language) {
4447
return;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy