@@ -10,7 +10,7 @@ import { leetCodeChannel } from "../leetCodeChannel";
1010import { leetCodeExecutor } from "../leetCodeExecutor" ;
1111import { leetCodeManager } from "../leetCodeManager" ;
1212import { IProblem , IQuickItemEx , languages , ProblemState } from "../shared" ;
13- import { DialogOptions , DialogType , promptForOpenOutputChannel , promptForSignIn } from "../utils/uiUtils" ;
13+ import { DialogOptions , DialogType , openSettingsEditor , promptForOpenOutputChannel , promptForSignIn , promptHintMessage } from "../utils/uiUtils" ;
1414import { selectWorkspaceFolder } from "../utils/workspaceUtils" ;
1515import * as wsl from "../utils/wslUtils" ;
1616import { leetCodePreviewProvider } from "../webview/leetCodePreviewProvider" ;
@@ -64,7 +64,6 @@ export async function showSolution(node?: LeetCodeNode): Promise<void> {
6464 }
6565}
6666
67- // SUGGESTION: group config retriving into one file
6867async function fetchProblemLanguage ( ) : Promise < string | undefined > {
6968 const leetCodeConfig : vscode . WorkspaceConfiguration = vscode . workspace . getConfiguration ( "leetcode" ) ;
7069 let defaultLanguage : string | undefined = leetCodeConfig . get < string > ( "defaultLanguage" ) ;
@@ -74,7 +73,7 @@ async function fetchProblemLanguage(): Promise<string | undefined> {
7473 const language : string | undefined = defaultLanguage || await vscode . window . showQuickPick ( languages , { placeHolder : "Select the language you want to use" , ignoreFocusOut : true } ) ;
7574 // fire-and-forget default language query
7675 ( async ( ) : Promise < void > => {
77- if ( language && ! defaultLanguage && leetCodeConfig . get < boolean > ( "showSetDefaultLanguageHint " ) ) {
76+ if ( language && ! defaultLanguage && leetCodeConfig . get < boolean > ( "hint.setDefaultLanguage " ) ) {
7877 const choice : vscode . MessageItem | undefined = await vscode . window . showInformationMessage (
7978 `Would you like to set '${ language } ' as your default language?` ,
8079 DialogOptions . yes ,
@@ -84,7 +83,7 @@ async function fetchProblemLanguage(): Promise<string | undefined> {
8483 if ( choice === DialogOptions . yes ) {
8584 leetCodeConfig . update ( "defaultLanguage" , language , true /* UserSetting */ ) ;
8685 } else if ( choice === DialogOptions . never ) {
87- leetCodeConfig . update ( "showSetDefaultLanguageHint " , false , true /* UserSetting */ ) ;
86+ leetCodeConfig . update ( "hint.setDefaultLanguage " , false , true /* UserSetting */ ) ;
8887 }
8988 }
9089 } ) ( ) ;
@@ -98,7 +97,6 @@ async function showProblemInternal(node: IProblem): Promise<void> {
9897 return ;
9998 }
10099
101- // SUGGESTION: group config retriving into one file
102100 const leetCodeConfig : vscode . WorkspaceConfiguration = vscode . workspace . getConfiguration ( "leetcode" ) ;
103101 let outDir : string = await selectWorkspaceFolder ( ) ;
104102 let relativePath : string = ( leetCodeConfig . get < string > ( "outputFolder" , "" ) ) . trim ( ) ;
@@ -120,6 +118,12 @@ async function showProblemInternal(node: IProblem): Promise<void> {
120118 await Promise . all ( [
121119 vscode . window . showTextDocument ( vscode . Uri . file ( filePath ) , { preview : false , viewColumn : vscode . ViewColumn . One } ) ,
122120 movePreviewAsideIfNeeded ( node ) ,
121+ promptHintMessage (
122+ "hint.commentDescription" ,
123+ 'You can generate the code file with problem description in the comments by enabling "leetcode.showCommentDescription".' ,
124+ "Open settings" ,
125+ ( ) : Promise < any > => openSettingsEditor ( "leetcode.showCommentDescription" ) ,
126+ ) ,
123127 ] ) ;
124128 } catch ( error ) {
125129 await promptForOpenOutputChannel ( "Failed to show the problem. Please open the output channel for details." , DialogType . error ) ;
0 commit comments