Skip to content

Commit bebdaeb

Browse files
committed
PR feedback
1 parent 4482734 commit bebdaeb

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

Extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3380,7 +3380,7 @@
33803380
"C_Cpp.persistVsDeveloperEnvironment": {
33813381
"type": "boolean",
33823382
"default": true,
3383-
"markdownDescription": "%c_cpp.configuration.persistVsDeveloperEnvironment.markdownDescription%",
3383+
"markdownDescription": "%c_cpp.configuration.persistVsDeveloperEnvironment.description%",
33843384
"scope": "window"
33853385
}
33863386
}

Extension/package.nls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@
845845
]
846846
},
847847
"c_cpp.configuration.debugShortcut.description": "Show the \"Run and Debug\" play button and \"Add Debug Configuration\" gear in the editor title bar for C++ files.",
848-
"c_cpp.configuration.persistVsDeveloperEnvironment.markdownDescription": "Remember the last used Visual Studio developer environment for the current workspace. This setting is only applicable for Windows.",
848+
"c_cpp.configuration.persistVsDeveloperEnvironment.description": "Remember the last used Visual Studio developer environment for the current workspace. This setting is only applicable for Windows.",
849849
"c_cpp.debuggers.pipeTransport.description": "When present, this tells the debugger to connect to a remote computer using another executable as a pipe that will relay standard input/output between VS Code and the MI-enabled debugger backend executable (such as gdb).",
850850
"c_cpp.debuggers.pipeTransport.default.pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'.",
851851
"c_cpp.debuggers.pipeTransport.default.debuggerPath": "The full path to the debugger on the target machine, for example /usr/bin/gdb.",

Extension/src/LanguageServer/client.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,18 +1748,18 @@ export class DefaultClient implements Client {
17481748

17491749
if (Object.keys(changedSettings).length > 0) {
17501750
if (this === defaultClient) {
1751-
if (changedSettings.commentContinuationPatterns) {
1751+
if (changedSettings.commentContinuationPatterns !== undefined) {
17521752
updateLanguageConfigurations();
17531753
}
1754-
if (changedSettings.loggingLevel) {
1754+
if (changedSettings.loggingLevel !== undefined) {
17551755
const oldLoggingLevelLogged: boolean = this.loggingLevel > 1;
17561756
this.loggingLevel = util.getNumericLoggingLevel(changedSettings.loggingLevel);
17571757
if (oldLoggingLevelLogged || this.loggingLevel > 1) {
17581758
getOutputChannelLogger().appendLine(localize({ key: "loggingLevel.changed", comment: ["{0} is the setting name 'loggingLevel', {1} is a string value such as 'Debug'"] }, "{0} has changed to: {1}", "loggingLevel", changedSettings.loggingLevel));
17591759
}
17601760
}
17611761
const settings: CppSettings = new CppSettings();
1762-
if (changedSettings.enhancedColorization) {
1762+
if (changedSettings.enhancedColorization !== undefined) {
17631763
if (settings.isEnhancedColorizationEnabled && semanticTokensLegend) {
17641764
this.semanticTokensProvider = new SemanticTokensProvider();
17651765
this.semanticTokensProviderDisposable = vscode.languages.registerDocumentSemanticTokensProvider(util.documentSelector, this.semanticTokensProvider, semanticTokensLegend);
@@ -1801,12 +1801,18 @@ export class DefaultClient implements Client {
18011801
void ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.CompilerPath, showButtonSender);
18021802
}
18031803
}
1804-
if (changedSettings.legacyCompilerArgsBehavior) {
1804+
if (changedSettings.legacyCompilerArgsBehavior !== undefined) {
18051805
this.configuration.handleConfigurationChange();
18061806
}
18071807
if (changedSettings["default.compilerPath"] !== undefined || changedSettings["default.compileCommands"] !== undefined || changedSettings["default.configurationProvider"] !== undefined) {
18081808
void ui.ShowConfigureIntelliSenseButton(false, this).catch(logAndReturn.undefined);
18091809
}
1810+
if (changedSettings.persistVsDeveloperEnvironment !== undefined) {
1811+
if (util.extensionContext) {
1812+
const settings: CppSettings = new CppSettings();
1813+
util.extensionContext.environmentVariableCollection.persistent = settings.persistVSDeveloperEnvironment;
1814+
}
1815+
}
18101816
this.configuration.onDidChangeSettings();
18111817
telemetry.logLanguageServerEvent("CppSettingsChange", changedSettings, undefined);
18121818
}

Extension/src/LanguageServer/devcmd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export async function setEnvironment(context?: vscode.ExtensionContext) {
6868
host: match(host, { 'x86': 'x86', 'x64': 'x64' }) ?? 'x64',
6969
target: match(target, { 'x86': 'x86', 'x64': 'x64', 'arm64': 'ARM64', 'arm': 'ARM' }) ?? 'x64'
7070
});
71-
const settings = new CppSettings(vscode.workspace.workspaceFolders?.at(0)?.uri);
71+
const settings = new CppSettings();
7272

7373
context.environmentVariableCollection.clear();
7474
for (const key of Object.keys(vars)) {

0 commit comments

Comments
 (0)