Skip to content

Commit 421300d

Browse files
authored
Merge branch 'main' into handle-multiple-compile-commands
2 parents cc09fff + a172a42 commit 421300d

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

Extension/package.nls.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
]
174174
},
175175
"c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription": {
176-
"message": "The full path of the `clang-tidy` executable. If not specified, and `clang-tidy` is available in the environment path, that is used. If not found in the environment path, the `clang-tidy` bundled with the extension will be used.",
176+
"message": "The full path of the `clang-tidy` executable. If not specified, and `clang-tidy` is available in the environment path, that is used unless the version bundled with the extension is newer. If not found in the environment path, the `clang-tidy` bundled with the extension will be used.",
177177
"comment": [
178178
"Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered."
179179
]
@@ -446,7 +446,7 @@
446446
]
447447
},
448448
"c_cpp.configuration.clang_format_path.markdownDescription": {
449-
"message": "The full path of the `clang-format` executable. If not specified, and `clang-format` is available in the environment path, that is used. If not found in the environment path, the `clang-format` bundled with the extension will be used.",
449+
"message": "The full path of the `clang-format` executable. If not specified, and `clang-format` is available in the environment path, that is used unless the version bundled with the extension is newer. If not found in the environment path, the `clang-format` bundled with the extension will be used.",
450450
"comment": [
451451
"Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered."
452452
]

Extension/src/LanguageServer/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ export class DefaultClient implements Client {
13841384
const filesEncoding: string = otherSettings.filesEncoding;
13851385
let filesEncodingChanged: boolean = false;
13861386
if (workspaceFolder) {
1387-
const lastFilesEncoding: PersistentFolderState<string> = new PersistentFolderState<string>("CPP.lastFilesEncoding", "", workspaceFolder);
1387+
const lastFilesEncoding: PersistentFolderState<string> = new PersistentFolderState<string>("CPP.lastFilesEncoding", filesEncoding, workspaceFolder);
13881388
filesEncodingChanged = lastFilesEncoding.Value !== filesEncoding;
13891389
}
13901390
const result: WorkspaceFolderSettingsParams = {
@@ -1519,7 +1519,7 @@ export class DefaultClient implements Client {
15191519
void util.promptForReloadWindowDueToSettingsChange();
15201520
}
15211521
const workspaceFallbackEncoding: string = workspaceOtherSettings.filesEncoding;
1522-
const lastWorkspaceFallbackEncoding: PersistentState<string> = new PersistentState<string>("CPP.lastWorkspaceFallbackEncoding", "");
1522+
const lastWorkspaceFallbackEncoding: PersistentState<string> = new PersistentState<string>("CPP.lastWorkspaceFallbackEncoding", workspaceFallbackEncoding);
15231523
const workspaceFallbackEncodingChanged = lastWorkspaceFallbackEncoding.Value !== workspaceFallbackEncoding;
15241524
return {
15251525
filesAssociations: workspaceOtherSettings.filesAssociations,

Extension/src/LanguageServer/persistentState.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ class PersistentStateBase<T> {
1919
this.defaultvalue = defaultValue;
2020
this.state = state;
2121
this.curvalue = defaultValue;
22+
23+
// Ensure the default is written to the state store.
24+
if (this.state && this.state.get<T>(this.key) === undefined) {
25+
void this.state.update(this.key, this.defaultvalue);
26+
}
2227
}
2328

2429
public get Value(): T {

Extension/src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ function sendTelemetry(info: PlatformInformation): void {
221221
default:
222222
break;
223223
}
224+
telemetryProperties['appName'] = vscode.env.appName;
224225
Telemetry.logDebuggerEvent("acquisition", telemetryProperties);
225226
logMachineIdMappings().catch(logAndReturn.undefined);
226227
}

0 commit comments

Comments
 (0)