Skip to content

Commit 4cd1a40

Browse files
committed
PR feedback
1 parent 731bd01 commit 4cd1a40

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
@@ -3542,7 +3542,7 @@
35423542
"C_Cpp.persistVsDeveloperEnvironment": {
35433543
"type": "boolean",
35443544
"default": true,
3545-
"markdownDescription": "%c_cpp.configuration.persistVsDeveloperEnvironment.markdownDescription%",
3545+
"markdownDescription": "%c_cpp.configuration.persistVsDeveloperEnvironment.description%",
35463546
"scope": "window"
35473547
}
35483548
}

Extension/package.nls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@
851851
]
852852
},
853853
"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.",
854-
"c_cpp.configuration.persistVsDeveloperEnvironment.markdownDescription": "Remember the last used Visual Studio developer environment for the current workspace. This setting is only applicable for Windows.",
854+
"c_cpp.configuration.persistVsDeveloperEnvironment.description": "Remember the last used Visual Studio developer environment for the current workspace. This setting is only applicable for Windows.",
855855
"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).",
856856
"c_cpp.debuggers.pipeTransport.default.pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'.",
857857
"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
@@ -1796,18 +1796,18 @@ export class DefaultClient implements Client {
17961796

17971797
if (Object.keys(changedSettings).length > 0) {
17981798
if (this === defaultClient) {
1799-
if (changedSettings.commentContinuationPatterns) {
1799+
if (changedSettings.commentContinuationPatterns !== undefined) {
18001800
updateLanguageConfigurations();
18011801
}
1802-
if (changedSettings.loggingLevel) {
1802+
if (changedSettings.loggingLevel !== undefined) {
18031803
const oldLoggingLevelLogged: boolean = this.loggingLevel > 1;
18041804
this.loggingLevel = util.getNumericLoggingLevel(changedSettings.loggingLevel);
18051805
if (oldLoggingLevelLogged || this.loggingLevel > 1) {
18061806
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));
18071807
}
18081808
}
18091809
const settings: CppSettings = new CppSettings();
1810-
if (changedSettings.enhancedColorization) {
1810+
if (changedSettings.enhancedColorization !== undefined) {
18111811
if (settings.isEnhancedColorizationEnabled && semanticTokensLegend) {
18121812
this.semanticTokensProvider = new SemanticTokensProvider();
18131813
this.semanticTokensProviderDisposable = vscode.languages.registerDocumentSemanticTokensProvider(util.documentSelector, this.semanticTokensProvider, semanticTokensLegend);
@@ -1849,12 +1849,18 @@ export class DefaultClient implements Client {
18491849
void ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.CompilerPath, showButtonSender);
18501850
}
18511851
}
1852-
if (changedSettings.legacyCompilerArgsBehavior) {
1852+
if (changedSettings.legacyCompilerArgsBehavior !== undefined) {
18531853
this.configuration.handleConfigurationChange();
18541854
}
18551855
if (changedSettings["default.compilerPath"] !== undefined || changedSettings["default.compileCommands"] !== undefined || changedSettings["default.configurationProvider"] !== undefined) {
18561856
void ui.ShowConfigureIntelliSenseButton(false, this).catch(logAndReturn.undefined);
18571857
}
1858+
if (changedSettings.persistVsDeveloperEnvironment !== undefined) {
1859+
if (util.extensionContext) {
1860+
const settings: CppSettings = new CppSettings();
1861+
util.extensionContext.environmentVariableCollection.persistent = settings.persistVSDeveloperEnvironment;
1862+
}
1863+
}
18581864
this.configuration.onDidChangeSettings();
18591865
telemetry.logLanguageServerEvent("CppSettingsChange", changedSettings, undefined);
18601866
}

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)