Skip to content

Commit fa20f29

Browse files
resolve pr
1 parent e136529 commit fa20f29

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Extension/src/LanguageServer/client.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ let compilerDefaults: configs.CompilerDefaults;
7070
let diagnosticsCollectionIntelliSense: vscode.DiagnosticCollection;
7171
let diagnosticsCollectionRefactor: vscode.DiagnosticCollection;
7272
let displayedSelectCompiler: boolean = false;
73+
let secondPromptCounter: number = 0;
7374

7475
let workspaceDisposables: vscode.Disposable[] = [];
7576
export let workspaceReferences: refs.ReferencesManager;
@@ -916,9 +917,12 @@ export class DefaultClient implements Client {
916917
}
917918

918919
public async showPrompt(buttonMessage: string): Promise<void> {
919-
const value: string | undefined = await vscode.window.showInformationMessage(localize("setCompiler.message", "You do not have IntelliSense configured. Unless you set your own configurations, IntelliSense may not be functional."), buttonMessage);
920-
if (value === buttonMessage) {
921-
this.handleCompilerQuickPick(true);
920+
if (secondPromptCounter < 2) {
921+
const value: string | undefined = await vscode.window.showInformationMessage(localize("setCompiler.message", "You do not have IntelliSense configured. Unless you set your own configurations, IntelliSense may not be functional."), buttonMessage);
922+
secondPromptCounter++;
923+
if (value === buttonMessage) {
924+
this.handleCompilerQuickPick(true);
925+
}
922926
}
923927
}
924928

@@ -942,7 +946,6 @@ export class DefaultClient implements Client {
942946
}
943947
if (index === paths.length - 1) {
944948
settings.defaultCompiler = "";
945-
this.showPrompt(selectCompiler);
946949
} else if (index === paths.length - 2) {
947950
switch (os.platform()) {
948951
case 'win32':
@@ -981,7 +984,7 @@ export class DefaultClient implements Client {
981984
const settings: OtherSettings = new OtherSettings();
982985
if (compilerDefaults.compilerPath !== "") {
983986
if (!isCommand && (compilerDefaults.compilerPath !== undefined)) {
984-
const value: string | undefined = await vscode.window.showInformationMessage(localize("selectCompiler.message", "The compiler {0} was found on this computer. Do you want to configure it for IntelliSense?", compilerDefaults.compilerPath), confirmCompiler, selectCompiler);
987+
const value: string | undefined = await vscode.window.showInformationMessage(localize("selectCompiler.message", "The compiler {0} was found. Do you want to configure IntelliSense with this compiler?", compilerDefaults.compilerPath), confirmCompiler, selectCompiler);
985988
if (value === confirmCompiler) {
986989
compilerPaths = await util.addTrustedCompiler(compilerPaths, compilerDefaults.compilerPath);
987990
settings.defaultCompiler = compilerDefaults.compilerPath;
@@ -1126,6 +1129,7 @@ export class DefaultClient implements Client {
11261129
defaultClient.configuration.handleConfigurationChange();
11271130
}
11281131
});
1132+
compilerDefaults.trustedCompilerFound = false;
11291133
if (!compilerDefaults.trustedCompilerFound && !displayedSelectCompiler) {
11301134
// if there is no compilerPath in c_cpp_properties.json, prompt user to configure a compiler
11311135
this.promptSelectCompiler(false);
@@ -2435,7 +2439,7 @@ export class DefaultClient implements Client {
24352439
return false;
24362440
});
24372441
},
2438-
() => ask.Value = false);
2442+
() => ask.Value = false);
24392443
}
24402444

24412445
/**

0 commit comments

Comments
 (0)