From 20cf85c39d599b373a08781b1d52c318c9143fcb Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 9 Jul 2021 20:25:53 -0700 Subject: [PATCH 001/101] Update Clang tools fwlinks. --- Extension/package.json | 72 +++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index fc5d8b8dc0..bd79868a3c 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -2901,8 +2901,8 @@ "integrity": "26CCA79735F15BE0595510E2A170794CBF7E2EE72F2A565CD9D26970EA35547F" }, { - "description": "ClangFormat (Linux / x86_64)", - "url": "https://go.microsoft.com/fwlink/?LinkID=2162325", + "description": "Clang tools (Linux / x86_64)", + "url": "https://go.microsoft.com/fwlink/?LinkID=2167549", "platforms": [ "linux" ], @@ -2910,13 +2910,14 @@ "x64" ], "binaries": [ - "./LLVM/bin/clang-format" + "./LLVM/bin/clang-format", + "./LLVM/bin/clang-tidy" ], - "integrity": "3F10BAD92274A07DB5DE0FD922C0CEDA034DECDB9E73DC477DD43CF30B500A7B" + "integrity": "3F3E0C7219ABF9B4D17113B6DDE94A062365E38BABAE6E53721CC98444C8F4FA" }, { - "description": "ClangFormat (Linux / armhf)", - "url": "https://go.microsoft.com/fwlink/?LinkID=2162327", + "description": "Clang tools (Linux / armhf)", + "url": "https://go.microsoft.com/fwlink/?LinkID=2167551", "platforms": [ "linux" ], @@ -2924,13 +2925,14 @@ "arm" ], "binaries": [ - "./LLVM/bin/clang-format" + "./LLVM/bin/clang-format", + "./LLVM/bin/clang-tidy" ], - "integrity": "1098291D78FB3E9411C445218BE14D1A96E7242E0B70549DA499C6551D8CA538" + "integrity": "2A8F48B0B3CC8D516C177CF0A0FD671E688FB37A075151C4413D55FE0194A831" }, { - "description": "ClangFormat (Linux / aarch64)", - "url": "https://go.microsoft.com/fwlink/?LinkID=2162412", + "description": "Clang tools (Linux / aarch64)", + "url": "https://go.microsoft.com/fwlink/?LinkID=2167656", "platforms": [ "linux" ], @@ -2938,13 +2940,14 @@ "arm64" ], "binaries": [ - "./LLVM/bin/clang-format" + "./LLVM/bin/clang-format", + "./LLVM/bin/clang-tidy" ], - "integrity": "CD5578A21C8D515D15C0611621E44C03DE4E667EFB4EE1A0DE18B08FD9B96794" + "integrity": "08EA62D201DA0744277969142AA376B9FCCE74BE7A86B65A71AE64D68D60496E" }, { - "description": "ClangFormat (macOS / x86_64)", - "url": "https://go.microsoft.com/fwlink/?LinkID=2162416", + "description": "Clang tools (macOS / x86_64)", + "url": "https://go.microsoft.com/fwlink/?LinkID=2167655", "platforms": [ "darwin" ], @@ -2952,13 +2955,14 @@ "x64" ], "binaries": [ - "./LLVM/bin/clang-format.darwin" + "./LLVM/bin/clang-format.darwin", + "./LLVM/bin/clang-tidy.darwin" ], - "integrity": "AEB24D394118EAD87087DCC651F2EE329FC335ECE88ED6C8C2A9E93ED60DFECD" + "integrity": "E4027DA8771AF28E1EBDC4B554B72D7501BF4989B0B5A0C374D7FC82A5C1BF5F" }, { - "description": "ClangFormat (macOS / ARM64)", - "url": "https://go.microsoft.com/fwlink/?LinkID=2162413", + "description": "Clang tools (macOS / ARM64)", + "url": "https://go.microsoft.com/fwlink/?LinkID=2167548", "platforms": [ "darwin" ], @@ -2966,13 +2970,14 @@ "arm64" ], "binaries": [ - "./LLVM/bin/clang-format.darwin" + "./LLVM/bin/clang-format.darwin", + "./LLVM/bin/clang-tidy.darwin" ], - "integrity": "AE5507F54562B9DA99E3F8318E25C93BD38AD2FBF4238ADF1C152ECFB0C10FA9" + "integrity": "67BDAC6D46A3F8C5F491D6BC9A461C1CF6179C57B1CA7F6643512A1338C44E17" }, { - "description": "ClangFormat (Windows x86)", - "url": "https://go.microsoft.com/fwlink/?LinkID=2162326", + "description": "Clang tools (Windows x86)", + "url": "https://go.microsoft.com/fwlink/?LinkID=2167552", "platforms": [ "win32" ], @@ -2980,13 +2985,14 @@ "x86" ], "binaries": [ - "./LLVM/bin/clang-format.exe" + "./LLVM/bin/clang-format.exe", + "./LLVM/bin/clang-tidy.exe" ], - "integrity": "928AF7C36F0E148537D8DF4D7AEEAD8A18DF9E4CA5C8BF23E49776EFBE078453" + "integrity": "4600A5030CF419880D80F9C55A9346C21F6BA79CD8F540DB1576595DFE093492" }, { - "description": "ClangFormat (Windows x64)", - "url": "https://go.microsoft.com/fwlink/?LinkID=2162415", + "description": "Clang tools (Windows x64)", + "url": "https://go.microsoft.com/fwlink/?LinkID=2167550", "platforms": [ "win32" ], @@ -2994,13 +3000,14 @@ "x64" ], "binaries": [ - "./LLVM/bin/clang-format.exe" + "./LLVM/bin/clang-format.exe", + "./LLVM/bin/clang-tidy.exe" ], - "integrity": "7977B82D6BD88C1AEB5071146EDCB45976D1EA66E312EEF9156957CAD0702F35" + "integrity": "3BBC1ABAD14E7A6F2709708E1534DD1B912575682872614E780E2EC398F31B49" }, { - "description": "ClangFormat (Windows arm64)", - "url": "https://go.microsoft.com/fwlink/?LinkID=2162414", + "description": "Clang tools (Windows arm64)", + "url": "https://go.microsoft.com/fwlink/?LinkID=2167548", "platforms": [ "win32" ], @@ -3008,9 +3015,10 @@ "arm64" ], "binaries": [ - "./LLVM/bin/clang-format.exe" + "./LLVM/bin/clang-format.exe", + "./LLVM/bin/clang-tidy.exe" ], - "integrity": "6756365C82B5BD90C6A40C13CF8E3599E4A1DB50628111FFDB3A76FF85256BA4" + "integrity": "67BDAC6D46A3F8C5F491D6BC9A461C1CF6179C57B1CA7F6643512A1338C44E17" }, { "description": "Mono Framework Assemblies", From 700fcf7a22fddf9777b89ef9ac3bb766c1cee03a Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 13 Jul 2021 13:39:10 -0700 Subject: [PATCH 002/101] Fix incorrect fwlink. --- Extension/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/package.json b/Extension/package.json index bd79868a3c..2c2ac5ecdb 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -2962,7 +2962,7 @@ }, { "description": "Clang tools (macOS / ARM64)", - "url": "https://go.microsoft.com/fwlink/?LinkID=2167548", + "url": "https://go.microsoft.com/fwlink/?LinkID=2167654", "platforms": [ "darwin" ], From 8be69e24b3f6437f2ecd417cb283567fc53ed840 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 14 Jul 2021 13:00:26 -0700 Subject: [PATCH 003/101] Add commands. --- Extension/package.json | 15 +++++++++++++++ Extension/package.nls.json | 3 +++ Extension/src/LanguageServer/client.ts | 18 ++++++++++++++++++ Extension/src/LanguageServer/extension.ts | 18 ++++++++++++++++++ Extension/src/LanguageServer/settings.ts | 16 ++++++++++++---- Extension/src/commands.ts | 5 ++++- Extension/src/main.ts | 3 +++ 7 files changed, 73 insertions(+), 5 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 2c2ac5ecdb..d23dc02314 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -1429,6 +1429,21 @@ "command": "C_Cpp.GoToPrevDirectiveInGroup", "title": "%c_cpp.command.GoToPrevDirectiveInGroup.title%", "category": "C/C++" + }, + { + "command": "C_Cpp.RunClangTidyOnActiveFile", + "title": "%c_cpp.command.RunClangTidyOnActiveFile.title%", + "category": "C/C++" + }, + { + "command": "C_Cpp.RunClangTidyOnOpenFiles", + "title": "%c_cpp.command.RunClangTidyOnOpenFiles.title%", + "category": "C/C++" + }, + { + "command": "C_Cpp.RunClangTidyOnAllFiles", + "title": "%c_cpp.command.RunClangTidyOnAllFiles.title%", + "category": "C/C++" } ], "keybindings": [ diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 0d0336b093..633971cee2 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -21,6 +21,9 @@ "c_cpp.command.generateEditorConfig.title": "Generate EditorConfig contents from VC Format settings", "c_cpp.command.GoToNextDirectiveInGroup.title": "Go to next preprocessor directive in conditional group", "c_cpp.command.GoToPrevDirectiveInGroup.title": "Go to previous preprocessor directive in conditional group", + "c_cpp.command.RunClangTidyOnActiveFile.title": "Run clang-tidy on the active file.", + "c_cpp.command.RunClangTidyOnOpenFiles.title": "Run clang-tidy on all open files.", + "c_cpp.command.RunClangTidyOnAllFiles.title": "Run clang-tidy on all source files.", "c_cpp.configuration.formatting.description": "Configures the formatting engine", "c_cpp.configuration.formatting.clangFormat.description": "clang-format will be used to format code.", "c_cpp.configuration.formatting.vcFormat.description": "The Visual C++ formatting engine will be used to format code.", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index e554770adf..a9ca981d0d 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -617,6 +617,9 @@ export interface Client { handleAddToIncludePathCommand(path: string): void; handleGoToDirectiveInGroup(next: boolean): Promise; handleCheckForCompiler(): Promise; + handleRunClangTidyOnActiveFile(): Promise; + handleRunClangTidyOnOpenFiles(): Promise; + handleRunClangTidyOnAllFiles(): Promise; onInterval(): void; dispose(): void; addFileAssociations(fileAssociations: string, languageId: string): void; @@ -2713,6 +2716,18 @@ export class DefaultClient implements Client { } } + public async handleRunClangTidyOnActiveFile(): Promise { + await this.awaitUntilLanguageClientReady(); + } + + public async handleRunClangTidyOnOpenFiles(): Promise { + await this.awaitUntilLanguageClientReady(); + } + + public async handleRunClangTidyOnAllFiles(): Promise { + await this.awaitUntilLanguageClientReady(); + } + public onInterval(): void { // These events can be discarded until the language client is ready. // Don't queue them up with this.notifyWhenLanguageClientReady calls. @@ -2882,6 +2897,9 @@ class NullClient implements Client { handleAddToIncludePathCommand(path: string): void { } handleGoToDirectiveInGroup(next: boolean): Promise { return Promise.resolve(); } handleCheckForCompiler(): Promise { return Promise.resolve(); } + handleRunClangTidyOnActiveFile(): Promise { return Promise.resolve(); } + handleRunClangTidyOnOpenFiles(): Promise { return Promise.resolve(); } + handleRunClangTidyOnAllFiles(): Promise { return Promise.resolve(); } onInterval(): void { } dispose(): void { this.booleanEvent.dispose(); diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index fbfcdd8a82..db9ffdfb34 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -789,6 +789,9 @@ export function registerCommands(): void { disposables.push(vscode.commands.registerCommand('C_Cpp.GoToNextDirectiveInGroup', onGoToNextDirectiveInGroup)); disposables.push(vscode.commands.registerCommand('C_Cpp.GoToPrevDirectiveInGroup', onGoToPrevDirectiveInGroup)); disposables.push(vscode.commands.registerCommand('C_Cpp.CheckForCompiler', onCheckForCompiler)); + disposables.push(vscode.commands.registerCommand('C_Cpp.RunClangTidyOnActiveFile', onRunClangTidyOnActiveFile)); + disposables.push(vscode.commands.registerCommand('C_Cpp.RunClangTidyOnOpenFiles', onRunClangTidyOnOpenFiles)); + disposables.push(vscode.commands.registerCommand('C_Cpp.RunClangTidyOnAllFiles', onRunClangTidyOnAllFiles)); disposables.push(vscode.commands.registerCommand('cpptools.activeConfigName', onGetActiveConfigName)); disposables.push(vscode.commands.registerCommand('cpptools.activeConfigCustomVariable', onGetActiveConfigCustomVariable)); disposables.push(vscode.commands.registerCommand('cpptools.setActiveConfigName', onSetActiveConfigName)); @@ -940,6 +943,21 @@ function onCheckForCompiler(): void { client.handleCheckForCompiler(); } +function onRunClangTidyOnActiveFile(): void { + onActivationEvent(); + getActiveClient().handleRunClangTidyOnActiveFile(); +} + +function onRunClangTidyOnOpenFiles(): void { + onActivationEvent(); + getActiveClient().handleRunClangTidyOnOpenFiles(); +} + +function onRunClangTidyOnAllFiles(): void { + onActivationEvent(); + getActiveClient().handleRunClangTidyOnAllFiles(); +} + function onAddToIncludePath(path: string): void { if (!isFolderOpen()) { vscode.window.showInformationMessage(localize('add.includepath.open.first', 'Open a folder first to add to {0}', "includePath")); diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 89f2cd5f03..d87805e5a3 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -59,18 +59,26 @@ export class CppSettings extends Settings { super("C_Cpp", resource); } - private get clangFormatName(): string { + private get LLVMExtension(): string { switch (os.platform()) { case "win32": - return "clang-format.exe"; + return ".exe"; case "darwin": - return "clang-format.darwin"; + return ".darwin"; case "linux": default: - return "clang-format"; + return ""; } } + private get clangFormatName(): string { + return "clang-format" + this.LLVMExtension; + } + + public get clangTidyName(): string { + return "clang-tidy" + this.LLVMExtension; + } + public get clangFormatPath(): string | undefined { let path: string | undefined | null = super.Section.get("clang_format_path"); if (!path) { diff --git a/Extension/src/commands.ts b/Extension/src/commands.ts index 5c376e5467..d0f0e81f5f 100644 --- a/Extension/src/commands.ts +++ b/Extension/src/commands.ts @@ -36,7 +36,10 @@ class TemporaryCommandRegistrar { "C_Cpp.GenerateEditorConfig", "C_Cpp.VcpkgClipboardInstallSuggested", "C_Cpp.VcpkgOnlineHelpSuggested", - "C_Cpp.CheckForCompiler" + "C_Cpp.CheckForCompiler", + "C_Cpp.RunClangTidyOnActiveFile", + "C_Cpp.RunClangTidyOnOpenFiles", + "C_Cpp.RunClangTidyOnAllFiles" ]; constructor() { diff --git a/Extension/src/main.ts b/Extension/src/main.ts index 36e9c112d6..27f45bbcf6 100644 --- a/Extension/src/main.ts +++ b/Extension/src/main.ts @@ -489,6 +489,9 @@ function rewriteManifest(): Promise { "onCommand:C_Cpp.GoToNextDirectiveInGroup", "onCommand:C_Cpp.GoToPrevDirectiveInGroup", "onCommand:C_Cpp.CheckForCompiler", + "onCommand:C_Cpp.RunClangTidyOnActiveFile", + "onCommand:C_Cpp.RunClangTidyOnOpenFiles", + "onCommand:C_Cpp.RunClangTidyOnAllFiles", "onDebugInitialConfigurations", "onDebugResolve:cppdbg", "onDebugResolve:cppvsdbg", From bc92c4df6ab64f94b90930975492db757ce170b7 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 20 Jul 2021 10:36:03 -0700 Subject: [PATCH 004/101] Some work in progress. --- Extension/package.nls.json | 2 +- Extension/src/LanguageServer/client.ts | 10 ++++++++++ Extension/src/LanguageServer/extension.ts | 10 +++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 633971cee2..da42d4c629 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -23,7 +23,7 @@ "c_cpp.command.GoToPrevDirectiveInGroup.title": "Go to previous preprocessor directive in conditional group", "c_cpp.command.RunClangTidyOnActiveFile.title": "Run clang-tidy on the active file.", "c_cpp.command.RunClangTidyOnOpenFiles.title": "Run clang-tidy on all open files.", - "c_cpp.command.RunClangTidyOnAllFiles.title": "Run clang-tidy on all source files.", + "c_cpp.command.RunClangTidyOnAllFiles.title": "Run clang-tidy on all source files (that don't match C_Cpp.clangTidy.exclude).", "c_cpp.configuration.formatting.description": "Configures the formatting engine", "c_cpp.configuration.formatting.clangFormat.description": "clang-format will be used to format code.", "c_cpp.configuration.formatting.vcFormat.description": "The Visual C++ formatting engine will be used to format code.", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index a9ca981d0d..a1fc318c97 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -455,6 +455,12 @@ interface SetTemporaryTextDocumentLanguageParams { isCuda: boolean; } +enum CodeAnalysisScope { + ActiveFile, + OpenFiles, + AllFiles +}; + // Requests const QueryCompilerDefaultsRequest: RequestType = new RequestType('cpptools/queryCompilerDefaults'); const QueryTranslationUnitSourceRequest: RequestType = new RequestType('cpptools/queryTranslationUnitSource'); @@ -496,6 +502,7 @@ const FindAllReferencesNotification: NotificationType = new NotificationType('cpptools/rename'); const DidChangeSettingsNotification: NotificationType = new NotificationType('cpptools/didChangeSettings'); const AbortRequestNotification: NotificationType = new NotificationType('cpptools/abortRequest'); +const ClangTidyNotification: NotificationType = new NotificationType('cpptools/runClangTidy'); // Notifications from the server const ReloadWindowNotification: NotificationType = new NotificationType('cpptools/reloadWindow'); @@ -2718,14 +2725,17 @@ export class DefaultClient implements Client { public async handleRunClangTidyOnActiveFile(): Promise { await this.awaitUntilLanguageClientReady(); + this.languageClient.sendNotification(ClangTidyNotification, CodeAnalysisScope.ActiveFile); } public async handleRunClangTidyOnOpenFiles(): Promise { await this.awaitUntilLanguageClientReady(); + this.languageClient.sendNotification(ClangTidyNotification, CodeAnalysisScope.OpenFiles); } public async handleRunClangTidyOnAllFiles(): Promise { await this.awaitUntilLanguageClientReady(); + this.languageClient.sendNotification(ClangTidyNotification, CodeAnalysisScope.AllFiles); } public onInterval(): void { diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index db9ffdfb34..5a5aa75a2f 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -12,7 +12,7 @@ import * as util from '../common'; import * as telemetry from '../telemetry'; import { TreeNode, NodeType } from './referencesModel'; import { UI, getUI } from './ui'; -import { Client } from './client'; +import { Client, openFileVersions } from './client'; import { ClientCollection } from './clientCollection'; import { CppSettings, generateEditorConfig, OtherSettings } from './settings'; import { PersistentWorkspaceState, PersistentState } from './persistentState'; @@ -945,12 +945,16 @@ function onCheckForCompiler(): void { function onRunClangTidyOnActiveFile(): void { onActivationEvent(); - getActiveClient().handleRunClangTidyOnActiveFile(); + if (activeDocument !== "") { + getActiveClient().handleRunClangTidyOnActiveFile(); + } } function onRunClangTidyOnOpenFiles(): void { onActivationEvent(); - getActiveClient().handleRunClangTidyOnOpenFiles(); + if (openFileVersions.size > 0) { + getActiveClient().handleRunClangTidyOnOpenFiles(); + } } function onRunClangTidyOnAllFiles(): void { From 79f0c9ac1fb6ea7d67c41fac2cda3e94d3b25a43 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 22 Jul 2021 16:14:10 -0700 Subject: [PATCH 005/101] Start adding clangTidy.path. --- Extension/package.json | 5 +++++ Extension/package.nls.json | 3 ++- Extension/src/LanguageServer/client.ts | 3 +++ Extension/src/LanguageServer/settings.ts | 2 +- Extension/src/LanguageServer/settingsTracker.ts | 2 +- Extension/src/common.ts | 8 ++++++++ 6 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index cf38c8fcf5..743724ae2d 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -252,6 +252,11 @@ "description": "%c_cpp.configuration.clang_format_style.description%", "scope": "machine-overridable" }, + "C_Cpp.clangTidy.path": { + "type": "string", + "description": "%c_cpp.configuration.clangTidy.path.description%", + "scope": "machine-overridable" + }, "C_Cpp.formatting": { "type": "string", "enum": [ diff --git a/Extension/package.nls.json b/Extension/package.nls.json index da42d4c629..218d1ac233 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -1,5 +1,5 @@ { - "c_cpp.capabilities.untrustedWorkspaces.description": "Multiple settings can cause processes local to the workspace to be executed, e.g. C_Cpp.clang_format_path, C_Cpp.addNodeAddonIncludePaths, C_Cpp.default.compilerPath, C_Cpp.default.configurationProvider, and C_Cpp.default.compileCommands, and the equivalent properties in c_cpp_properties.json.", + "c_cpp.capabilities.untrustedWorkspaces.description": "Multiple settings can cause processes local to the workspace to be executed, e.g. C_Cpp.clang_format_path, C_Cpp.clangTidy.path, C_Cpp.addNodeAddonIncludePaths, C_Cpp.default.compilerPath, C_Cpp.default.configurationProvider, and C_Cpp.default.compileCommands, and the equivalent properties in c_cpp_properties.json.", "c_cpp.command.configurationSelect.title": "Select a Configuration...", "c_cpp.command.configurationProviderSelect.title": "Change Configuration Provider...", "c_cpp.command.configurationEditJSON.title": "Edit Configurations (JSON)", @@ -118,6 +118,7 @@ "c_cpp.configuration.clang_format_style.description": "Coding style, currently supports: Visual Studio, LLVM, Google, Chromium, Mozilla, WebKit. Use \"file\" to load the style from a .clang-format file in the current or parent directory. Use {key: value, ...} to set specific parameters. For example, the \"Visual Studio\" style is similar to: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }", "c_cpp.configuration.clang_format_fallbackStyle.description": "Name of the predefined style used as a fallback in case clang-format is invoked with style \"file\" but the .clang-format file is not found. Possible values are Visual Studio, LLVM, Google, Chromium, Mozilla, WebKit, none, or use {key: value, ...} to set specific parameters. For example, the \"Visual Studio\" style is similar to: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }", "c_cpp.configuration.clang_format_sortIncludes.description": "If set, overrides the include sorting behavior determined by the SortIncludes parameter.", + "c_cpp.configuration.clangTidy.path.description": "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, a copy of clang-tidy bundled with the extension will be used.", "c_cpp.configuration.intelliSenseEngine.description": "Controls the IntelliSense provider. \"Tag Parser\" provides \"fuzzy\" results that are not context-aware. \"Default\" provides context-aware results. \"Disabled\" turns off C/C++ language service features.", "c_cpp.configuration.intelliSenseEngineFallback.description": "Controls whether the IntelliSense engine will automatically switch to the Tag Parser for translation units containing #include errors.", "c_cpp.configuration.autocomplete.description": "Controls the auto-completion provider. \"Default\" uses the active IntelliSense engine. \"Disabled\" uses the word-based completion provided by Visual Studio Code.", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 8679335f90..7e76f73eef 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -996,6 +996,7 @@ export class DefaultClient implements Client { const settings_clangFormatStyle: (string | undefined)[] = []; const settings_clangFormatFallbackStyle: (string | undefined)[] = []; const settings_clangFormatSortIncludes: (string | undefined)[] = []; + const settings_clangTidyPath: (string | undefined)[] = []; const settings_filesEncoding: (string | undefined)[] = []; const settings_cppFilesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; const settings_filesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; @@ -1093,6 +1094,7 @@ export class DefaultClient implements Client { for (const setting of settings) { settings_clangFormatPath.push(util.resolveVariables(setting.clangFormatPath, this.AdditionalEnvironment)); + settings_clangTidyPath.push(util.resolveVariables(setting.clangTidyPath, this.AdditionalEnvironment)); settings_formattingEngine.push(setting.formattingEngine); settings_indentBraces.push(setting.vcFormatIndentBraces); settings_indentWithinParentheses.push(setting.vcFormatIndentWithinParentheses); @@ -1203,6 +1205,7 @@ export class DefaultClient implements Client { initializationOptions: { clang_format_path: settings_clangFormatPath, clang_format_style: settings_clangFormatStyle, + clang_tidy_path: settings_clangTidyPath, formatting: settings_formattingEngine, vcFormat: { indent: { diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index d87805e5a3..73f90546dd 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -6,7 +6,7 @@ import * as vscode from 'vscode'; import { CommentPattern } from './languageConfig'; -import { getExtensionFilePath, getCachedClangFormatPath, setCachedClangFormatPath } from '../common'; +import { getExtensionFilePath, getCachedClangFormatPath, setCachedClangFormatPath, getCachedClangTidyPath, setCachedClangTidyPath } from '../common'; import * as os from 'os'; import * as which from 'which'; import { execSync } from 'child_process'; diff --git a/Extension/src/LanguageServer/settingsTracker.ts b/Extension/src/LanguageServer/settingsTracker.ts index f685e2fe7b..df37dbfc6e 100644 --- a/Extension/src/LanguageServer/settingsTracker.ts +++ b/Extension/src/LanguageServer/settingsTracker.ts @@ -177,7 +177,7 @@ export class SettingsTracker { break; } default: { - if (key === "clang_format_path" || key === "intelliSenseCachePath" || key.startsWith("default.")) { + if (key === "clang_format_path" || key === "path" || key === "intelliSenseCachePath" || key.startsWith("default.")) { value = this.areEqual(val, settings.inspect(key)?.defaultValue) ? "" : "..."; // Track whether it's being used, but nothing specific about it. } else { value = String(this.previousCppSettings[key]); diff --git a/Extension/src/common.ts b/Extension/src/common.ts index 3584c7ecc0..86672b9327 100644 --- a/Extension/src/common.ts +++ b/Extension/src/common.ts @@ -54,6 +54,14 @@ export function setCachedClangFormatPath(path: string | null): void { cachedClangFormatPath = path; } +let cachedClangTidyPath: string | null | undefined; +export function getCachedClangTidyPath(): string | null | undefined { + return cachedClangTidyPath; +} +export function setCachedClangTidyPath(path: string | null): void { + cachedClangTidyPath = path; +} + // Use this package.json to read values export const packageJson: any = vscode.extensions.getExtension("ms-vscode.cpptools")?.packageJSON; From f5132c5ae9b8b683c09b14dcadadef1232b11403 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 22 Jul 2021 16:21:46 -0700 Subject: [PATCH 006/101] Fix build errors. --- Extension/src/LanguageServer/settings.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 73f90546dd..50b826178f 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -6,7 +6,7 @@ import * as vscode from 'vscode'; import { CommentPattern } from './languageConfig'; -import { getExtensionFilePath, getCachedClangFormatPath, setCachedClangFormatPath, getCachedClangTidyPath, setCachedClangTidyPath } from '../common'; +import { getExtensionFilePath, getCachedClangFormatPath, setCachedClangFormatPath /* , getCachedClangTidyPath, setCachedClangTidyPath */ } from '../common'; import * as os from 'os'; import * as which from 'which'; import { execSync } from 'child_process'; @@ -79,6 +79,10 @@ export class CppSettings extends Settings { return "clang-tidy" + this.LLVMExtension; } + public get clangTidyPath(): string | undefined { + return this.clangFormatPath; // TODO + } + public get clangFormatPath(): string | undefined { let path: string | undefined | null = super.Section.get("clang_format_path"); if (!path) { From 9411bcecdc10f06aa6bf4b43aa510f744c5fbd89 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 22 Jul 2021 19:09:21 -0700 Subject: [PATCH 007/101] Updates. --- Extension/package.json | 12 ++++++------ Extension/src/LanguageServer/settings.ts | 10 +--------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 743724ae2d..619dd82120 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -3271,10 +3271,10 @@ "x64" ], "binaries": [ - "./LLVM/bin/clang-format.darwin", - "./LLVM/bin/clang-tidy.darwin" + "./LLVM/bin/clang-format", + "./LLVM/bin/clang-tidy" ], - "integrity": "E4027DA8771AF28E1EBDC4B554B72D7501BF4989B0B5A0C374D7FC82A5C1BF5F" + "integrity": "ADD73C4822497BDB03328FC50046A5B5C5A0D89E62835C0180EE7DC857801B10" }, { "description": "Clang tools (macOS / ARM64)", @@ -3286,10 +3286,10 @@ "arm64" ], "binaries": [ - "./LLVM/bin/clang-format.darwin", - "./LLVM/bin/clang-tidy.darwin" + "./LLVM/bin/clang-format", + "./LLVM/bin/clang-tidy" ], - "integrity": "67BDAC6D46A3F8C5F491D6BC9A461C1CF6179C57B1CA7F6643512A1338C44E17" + "integrity": "14DBEFB75DF25553939CFF56E5FC9F5E1520E81B716EA45C9E710C80F254CE34" }, { "description": "Clang tools (Windows x86)", diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 50b826178f..bf60533170 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -60,15 +60,7 @@ export class CppSettings extends Settings { } private get LLVMExtension(): string { - switch (os.platform()) { - case "win32": - return ".exe"; - case "darwin": - return ".darwin"; - case "linux": - default: - return ""; - } + return os.platform() === "win32" ? ".exe" : ""; } private get clangFormatName(): string { From 50b815ae8d06b4d3fba3f82fbe51e90a65b134fa Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 23 Jul 2021 11:19:45 -0700 Subject: [PATCH 008/101] Settings fixes. --- Extension/src/LanguageServer/settings.ts | 56 ++++++++++++++++-------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index bf60533170..c482a1ff1a 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -6,7 +6,7 @@ import * as vscode from 'vscode'; import { CommentPattern } from './languageConfig'; -import { getExtensionFilePath, getCachedClangFormatPath, setCachedClangFormatPath /* , getCachedClangTidyPath, setCachedClangTidyPath */ } from '../common'; +import { getExtensionFilePath, getCachedClangFormatPath, setCachedClangFormatPath, getCachedClangTidyPath, setCachedClangTidyPath } from '../common'; import * as os from 'os'; import * as which from 'which'; import { execSync } from 'child_process'; @@ -63,51 +63,69 @@ export class CppSettings extends Settings { return os.platform() === "win32" ? ".exe" : ""; } + private get clangFormatStr(): string { + return "clang-format"; + } + + private get clangTidyStr(): string { + return "clang-tidy"; + } + private get clangFormatName(): string { - return "clang-format" + this.LLVMExtension; + return this.clangFormatStr + this.LLVMExtension; } - public get clangTidyName(): string { - return "clang-tidy" + this.LLVMExtension; + private get clangTidyName(): string { + return this.clangTidyStr + this.LLVMExtension; } public get clangTidyPath(): string | undefined { - return this.clangFormatPath; // TODO + return this.getClangPath(false); } public get clangFormatPath(): string | undefined { - let path: string | undefined | null = super.Section.get("clang_format_path"); + return this.getClangPath(true); + } + + private getClangPath(isFormat: boolean): string | undefined { + let path: string | undefined | null = super.Section.get(isFormat ? "clang_format_path" : "clangTidy.path"); if (!path) { - const cachedClangFormatPath: string | null | undefined = getCachedClangFormatPath(); - if (cachedClangFormatPath !== undefined) { - if (cachedClangFormatPath === null) { + const cachedClangPath: string | null | undefined = isFormat ? getCachedClangFormatPath() : getCachedClangTidyPath(); + if (cachedClangPath !== undefined) { + if (cachedClangPath === null) { return undefined; } - return cachedClangFormatPath; + return cachedClangPath; + } + const clangStr: string = isFormat ? this.clangFormatStr : this.clangTidyStr; + const clangName: string = isFormat ? this.clangFormatName : this.clangTidyName; + path = which.sync(clangName, { nothrow: true }); + if (isFormat) { + setCachedClangFormatPath(path); + } else { + setCachedClangTidyPath(path); } - path = which.sync('clang-format', { nothrow: true }); - setCachedClangFormatPath(path); if (!path) { return undefined; } else { - // Attempt to invoke both our own version of clang-format to see if we can successfully execute it, and to get it's version. - let clangFormatVersion: string; + // Attempt to invoke both our own version of clang-* to see if we can successfully execute it, and to get it's version. + let clangVersion: string; try { - const exePath: string = getExtensionFilePath(`./LLVM/bin/${this.clangFormatName}`); + const exePath: string = getExtensionFilePath(`./LLVM/bin/${clangName}`); const output: string[] = execSync(`${exePath} --version`).toString().split(" "); - if (output.length < 3 || output[0] !== "clang-format" || output[1] !== "version" || !semver.valid(output[2])) { + if (output.length < 3 || output[0] !== clangStr || output[1] !== "version" || !semver.valid(output[2])) { return path; } - clangFormatVersion = output[2]; + clangVersion = output[2]; } catch (e) { - // Unable to invoke our own clang-format. Use the system installed clang-format. + // Unable to invoke our own clang-*. Use the system installed clang-*. return path; } // Invoke the version on the system to compare versions. Use ours if it's more recent. try { const output: string[] = execSync(`"${path}" --version`).toString().split(" "); - if (output.length < 3 || output[0] !== "clang-format" || output[1] !== "version" || semver.ltr(output[2], clangFormatVersion)) { + if (output.length < 3 || output[0] !== clangStr || output[1] !== "version" || semver.ltr(output[2], clangVersion)) { path = ""; } } catch (e) { From 25e8418f871eb3f5be2869f0596250d4e32912ae Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 23 Jul 2021 14:19:38 -0700 Subject: [PATCH 009/101] Minor update. --- Extension/package.json | 8 ++++++++ Extension/package.nls.json | 1 + Extension/src/LanguageServer/settings.ts | 9 ++++----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 619dd82120..47902b503f 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -257,6 +257,14 @@ "description": "%c_cpp.configuration.clangTidy.path.description%", "scope": "machine-overridable" }, + "C_Cpp.clangTidy.maxProcesses": { + "type": "integer", + "description": "%c_cpp.configuration.clangTidy.maxProcesses.description%", + "default": null, + "minimum": 1, + "maximum": 32, + "scope": "machine" + }, "C_Cpp.formatting": { "type": "string", "enum": [ diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 218d1ac233..837293a7ea 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -119,6 +119,7 @@ "c_cpp.configuration.clang_format_fallbackStyle.description": "Name of the predefined style used as a fallback in case clang-format is invoked with style \"file\" but the .clang-format file is not found. Possible values are Visual Studio, LLVM, Google, Chromium, Mozilla, WebKit, none, or use {key: value, ...} to set specific parameters. For example, the \"Visual Studio\" style is similar to: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }", "c_cpp.configuration.clang_format_sortIncludes.description": "If set, overrides the include sorting behavior determined by the SortIncludes parameter.", "c_cpp.configuration.clangTidy.path.description": "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, a copy of clang-tidy bundled with the extension will be used.", + "c_cpp.configuration.clangTidy.maxProcesses.description": "The maximum number of clang-tidy processes to launch concurrently. The default of \"null\" uses the number of logical processors available.", "c_cpp.configuration.intelliSenseEngine.description": "Controls the IntelliSense provider. \"Tag Parser\" provides \"fuzzy\" results that are not context-aware. \"Default\" provides context-aware results. \"Disabled\" turns off C/C++ language service features.", "c_cpp.configuration.intelliSenseEngineFallback.description": "Controls whether the IntelliSense engine will automatically switch to the Tag Parser for translation units containing #include errors.", "c_cpp.configuration.autocomplete.description": "Controls the auto-completion provider. \"Default\" uses the active IntelliSense engine. \"Disabled\" uses the word-based completion provided by Visual Studio Code.", diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index c482a1ff1a..bb2a1de598 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -99,12 +99,9 @@ export class CppSettings extends Settings { } const clangStr: string = isFormat ? this.clangFormatStr : this.clangTidyStr; const clangName: string = isFormat ? this.clangFormatName : this.clangTidyName; + const setCachedClangPath: (path: string | null) => void = isFormat ? setCachedClangFormatPath : setCachedClangTidyPath; path = which.sync(clangName, { nothrow: true }); - if (isFormat) { - setCachedClangFormatPath(path); - } else { - setCachedClangTidyPath(path); - } + setCachedClangPath(path); if (!path) { return undefined; } else { @@ -127,9 +124,11 @@ export class CppSettings extends Settings { const output: string[] = execSync(`"${path}" --version`).toString().split(" "); if (output.length < 3 || output[0] !== clangStr || output[1] !== "version" || semver.ltr(output[2], clangVersion)) { path = ""; + setCachedClangPath(path); } } catch (e) { path = ""; + setCachedClangPath(path); } } } From b2594db8da453a38e6bbcfd516c0b94d61f089e8 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 23 Jul 2021 17:18:25 -0700 Subject: [PATCH 010/101] clangTidy.maxProcesses --- Extension/package.json | 2 +- Extension/src/LanguageServer/client.ts | 3 +++ Extension/src/LanguageServer/settings.ts | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Extension/package.json b/Extension/package.json index 47902b503f..7511563d8a 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -262,7 +262,7 @@ "description": "%c_cpp.configuration.clangTidy.maxProcesses.description%", "default": null, "minimum": 1, - "maximum": 32, + "maximum": 16, "scope": "machine" }, "C_Cpp.formatting": { diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 7e76f73eef..2abdf74a56 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -997,6 +997,7 @@ export class DefaultClient implements Client { const settings_clangFormatFallbackStyle: (string | undefined)[] = []; const settings_clangFormatSortIncludes: (string | undefined)[] = []; const settings_clangTidyPath: (string | undefined)[] = []; + const settings_clangTidyMaxProcesses: (number | undefined)[] = []; const settings_filesEncoding: (string | undefined)[] = []; const settings_cppFilesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; const settings_filesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; @@ -1095,6 +1096,7 @@ export class DefaultClient implements Client { for (const setting of settings) { settings_clangFormatPath.push(util.resolveVariables(setting.clangFormatPath, this.AdditionalEnvironment)); settings_clangTidyPath.push(util.resolveVariables(setting.clangTidyPath, this.AdditionalEnvironment)); + settings_clangTidyMaxProcesses.push(setting.clangTidyMaxProcesses); settings_formattingEngine.push(setting.formattingEngine); settings_indentBraces.push(setting.vcFormatIndentBraces); settings_indentWithinParentheses.push(setting.vcFormatIndentWithinParentheses); @@ -1206,6 +1208,7 @@ export class DefaultClient implements Client { clang_format_path: settings_clangFormatPath, clang_format_style: settings_clangFormatStyle, clang_tidy_path: settings_clangTidyPath, + clang_tidy_max_processes: settings_clangTidyMaxProcesses, formatting: settings_formattingEngine, vcFormat: { indent: { diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index bb2a1de598..f769062072 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -83,6 +83,10 @@ export class CppSettings extends Settings { return this.getClangPath(false); } + public get clangTidyMaxProcesses(): number | undefined { + return super.Section.get("clangTidy.maxProcesses"); + } + public get clangFormatPath(): string | undefined { return this.getClangPath(true); } From a2232202dbfc3415e623af49d40f55046d65fd4a Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 26 Jul 2021 11:28:59 -0700 Subject: [PATCH 011/101] Fix settings bug. --- Extension/src/LanguageServer/settingsTracker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/settingsTracker.ts b/Extension/src/LanguageServer/settingsTracker.ts index df37dbfc6e..9c7fccc834 100644 --- a/Extension/src/LanguageServer/settingsTracker.ts +++ b/Extension/src/LanguageServer/settingsTracker.ts @@ -177,7 +177,7 @@ export class SettingsTracker { break; } default: { - if (key === "clang_format_path" || key === "path" || key === "intelliSenseCachePath" || key.startsWith("default.")) { + if (key === "clang_format_path" || key === "clangTidy.path" || key === "intelliSenseCachePath" || key.startsWith("default.")) { value = this.areEqual(val, settings.inspect(key)?.defaultValue) ? "" : "..."; // Track whether it's being used, but nothing specific about it. } else { value = String(this.previousCppSettings[key]); From 6801ea59c29bec3bc684c77f431d98bec7b2c8d2 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 28 Jul 2021 10:57:01 -0700 Subject: [PATCH 012/101] Add some settings. --- Extension/package.json | 64 ++++++++++++++++++++++++++++++++++++-- Extension/package.nls.json | 11 +++++-- 2 files changed, 70 insertions(+), 5 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 36706e9174..9114856789 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -241,6 +241,38 @@ "type": "object", "title": "C/C++", "properties": { + "C_Cpp.maxThreads": { + "type": "integer", + "description": "%c_cpp.configuration.maxThreads.description%", + "default": null, + "minimum": 2, + "maximum": 32, + "scope": "machine" + }, + "C_Cpp.intelliSense.maxThreads": { + "type": "integer", + "description": "%c_cpp.configuration.intelliSense.maxThreads.description%", + "default": null, + "minimum": 2, + "maximum": 32, + "scope": "machine" + }, + "C_Cpp.intelliSense.maxMemory": { + "type": "integer", + "description": "%c_cpp.configuration.intelliSense.maxMemory.description%", + "default": 1024, + "minimum": 256, + "maximum": 65536, + "scope": "machine" + }, + "C_Cpp.references.maxThreads": { + "type": "integer", + "description": "%c_cpp.configuration.references.maxThreads.description%", + "default": null, + "minimum": 2, + "maximum": 32, + "scope": "machine" + }, "C_Cpp.clang_format_path": { "type": "string", "description": "%c_cpp.configuration.clang_format_path.description%", @@ -257,12 +289,38 @@ "description": "%c_cpp.configuration.clangTidy.path.description%", "scope": "machine-overridable" }, - "C_Cpp.clangTidy.maxProcesses": { + "C_Cpp.clangTidy.exclude": { + "type": "object", + "markdownDescription": "%c_cpp.configuration.clangTidy.exclude.description%", + "default": { + }, + "additionalProperties": { + "anyOf": [ + { + "type": "boolean", + "description": "%c_cpp.configuration.clangTidy.excludeBoolean.description%" + }, + { + "type": "object", + "properties": { + "when": { + "type": "string", + "pattern": "\\w*\\$\\(basename\\)\\w*", + "default": "$(basename).ext", + "description": "%c_cpp.configuration.clangTidy.excludeWhen.description%" + } + } + } + ] + }, + "scope": "resource" + }, + "C_Cpp.clangTidy.maxThreads": { "type": "integer", "description": "%c_cpp.configuration.clangTidy.maxProcesses.description%", "default": null, - "minimum": 1, - "maximum": 16, + "minimum": 2, + "maximum": 32, "scope": "machine" }, "C_Cpp.formatting": { diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 837293a7ea..b1f17b7cd0 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -23,7 +23,11 @@ "c_cpp.command.GoToPrevDirectiveInGroup.title": "Go to previous preprocessor directive in conditional group", "c_cpp.command.RunClangTidyOnActiveFile.title": "Run clang-tidy on the active file.", "c_cpp.command.RunClangTidyOnOpenFiles.title": "Run clang-tidy on all open files.", - "c_cpp.command.RunClangTidyOnAllFiles.title": "Run clang-tidy on all source files (that don't match C_Cpp.clangTidy.exclude).", + "c_cpp.command.RunClangTidyOnAllFiles.title": "Run clang-tidy on all source files.", + "c_cpp.configuration.maxThreads.description": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may be exceedeed in some cases. The default of \"null\" uses the number of logical processors available.", + "c_cpp.configuration.intelliSense.maxThreads.description": "The maximum number of concurrent threads to use for IntelliSense processing. The value may be reduced further due to \"C_Cpp.intelliSense.maxMemory\". The default of \"null\" uses the value inherited from \"C_Cpp.maxThreads\".", + "c_cpp.configuration.references.maxThreads.description": "The maximum number of concurrent threads to use for find all references and rename. The default of \"null\" uses the value inherited from \"C_Cpp.maxThreads\".", + "c_cpp.configuration.intelliSense.maxMemory.description": "Older IntelliSense processes will shutdown before new processes are created after this memory limit is exceeded.", "c_cpp.configuration.formatting.description": "Configures the formatting engine", "c_cpp.configuration.formatting.clangFormat.description": "clang-format will be used to format code.", "c_cpp.configuration.formatting.vcFormat.description": "The Visual C++ formatting engine will be used to format code.", @@ -119,7 +123,10 @@ "c_cpp.configuration.clang_format_fallbackStyle.description": "Name of the predefined style used as a fallback in case clang-format is invoked with style \"file\" but the .clang-format file is not found. Possible values are Visual Studio, LLVM, Google, Chromium, Mozilla, WebKit, none, or use {key: value, ...} to set specific parameters. For example, the \"Visual Studio\" style is similar to: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }", "c_cpp.configuration.clang_format_sortIncludes.description": "If set, overrides the include sorting behavior determined by the SortIncludes parameter.", "c_cpp.configuration.clangTidy.path.description": "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, a copy of clang-tidy bundled with the extension will be used.", - "c_cpp.configuration.clangTidy.maxProcesses.description": "The maximum number of clang-tidy processes to launch concurrently. The default of \"null\" uses the number of logical processors available.", + "c_cpp.configuration.clangTidy.exclude.description": "Configure glob patterns for excluding folders and files for clang-tidy. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", + "c_cpp.configuration.clangTidy.excludeBoolean.description": "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.", + "c_cpp.configuration.clangTidy.excludeWhen.description": "Additional check on the siblings of a matching file. Use $(basename) as variable for the matching file name.", + "c_cpp.configuration.clangTidy.maxThreads.description": "The maximum number of theads to use for clang-tidy processing. The default of \"null\" uses the value inherited from \"C_Cpp.maxThreads\".", "c_cpp.configuration.intelliSenseEngine.description": "Controls the IntelliSense provider. \"Tag Parser\" provides \"fuzzy\" results that are not context-aware. \"Default\" provides context-aware results. \"Disabled\" turns off C/C++ language service features.", "c_cpp.configuration.intelliSenseEngineFallback.description": "Controls whether the IntelliSense engine will automatically switch to the Tag Parser for translation units containing #include errors.", "c_cpp.configuration.autocomplete.description": "Controls the auto-completion provider. \"Default\" uses the active IntelliSense engine. \"Disabled\" uses the word-based completion provided by Visual Studio Code.", From 14275d101b5c6c9abda06b058b7f3bd7c5c7815c Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 28 Jul 2021 13:31:45 -0700 Subject: [PATCH 013/101] Settings changes. --- Extension/package.json | 3 +-- Extension/src/LanguageServer/client.ts | 13 +++++++++---- Extension/src/LanguageServer/settings.ts | 10 ++++++---- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 9114856789..9b9851d69d 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -292,8 +292,7 @@ "C_Cpp.clangTidy.exclude": { "type": "object", "markdownDescription": "%c_cpp.configuration.clangTidy.exclude.description%", - "default": { - }, + "default": {}, "additionalProperties": { "anyOf": [ { diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 2abdf74a56..dcf5e9657b 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -997,7 +997,7 @@ export class DefaultClient implements Client { const settings_clangFormatFallbackStyle: (string | undefined)[] = []; const settings_clangFormatSortIncludes: (string | undefined)[] = []; const settings_clangTidyPath: (string | undefined)[] = []; - const settings_clangTidyMaxProcesses: (number | undefined)[] = []; + const settings_clangTidyExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; const settings_filesEncoding: (string | undefined)[] = []; const settings_cppFilesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; const settings_filesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; @@ -1096,7 +1096,7 @@ export class DefaultClient implements Client { for (const setting of settings) { settings_clangFormatPath.push(util.resolveVariables(setting.clangFormatPath, this.AdditionalEnvironment)); settings_clangTidyPath.push(util.resolveVariables(setting.clangTidyPath, this.AdditionalEnvironment)); - settings_clangTidyMaxProcesses.push(setting.clangTidyMaxProcesses); + settings_clangTidyExclude.push(setting.clangTidyExclude); settings_formattingEngine.push(setting.formattingEngine); settings_indentBraces.push(setting.vcFormatIndentBraces); settings_indentWithinParentheses.push(setting.vcFormatIndentWithinParentheses); @@ -1205,10 +1205,14 @@ export class DefaultClient implements Client { { scheme: 'file', language: 'cuda-cpp' } ], initializationOptions: { + maxThreads: workspaceSettings.maxThreads, + intelliSenseMaxThreads: workspaceSettings.intelliSenseMaxThreads, + intelliSenseMaxMemory: workspaceSettings.intelliSenseMaxMemory, + referencesMaxThreads: workspaceSettings.referencesMaxThreads, clang_format_path: settings_clangFormatPath, clang_format_style: settings_clangFormatStyle, - clang_tidy_path: settings_clangTidyPath, - clang_tidy_max_processes: settings_clangTidyMaxProcesses, + clangTidyPath: settings_clangTidyPath, + clangTidyMaxThreads: workspaceSettings.clangTidyMaxThreads, formatting: settings_formattingEngine, vcFormat: { indent: { @@ -1293,6 +1297,7 @@ export class DefaultClient implements Client { autoClosingBrackets: settings_editorAutoClosingBrackets }, workspace_fallback_encoding: workspaceOtherSettings.filesEncoding, + clang_tidy_exclude_files: settings_clangTidyExclude, cpp_exclude_files: settings_cppFilesExclude, exclude_files: settings_filesExclude, exclude_search: settings_searchExclude, diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index f769062072..a4a1f2ab8f 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -83,10 +83,6 @@ export class CppSettings extends Settings { return this.getClangPath(false); } - public get clangTidyMaxProcesses(): number | undefined { - return super.Section.get("clangTidy.maxProcesses"); - } - public get clangFormatPath(): string | undefined { return this.getClangPath(true); } @@ -139,6 +135,12 @@ export class CppSettings extends Settings { return path; } + public get maxThreads(): number | undefined { return super.Section.get("maxThreads"); } + public get intelliSenseMaxThreads(): number | undefined { return super.Section.get("intelliSense.maxThreads"); } + public get intelliSenseMaxMemory(): number | undefined { return super.Section.get("intelliSense.maxMemory"); } + public get referencesMaxThreads(): number | undefined { return super.Section.get("references.maxThreads"); } + public get clangTidyMaxThreads(): number | undefined { return super.Section.get("clangTidy.maxThreads"); } + public get clangTidyExclude(): vscode.WorkspaceConfiguration | undefined { return super.Section.get("clangTidy.exclude"); } public get clangFormatStyle(): string | undefined { return super.Section.get("clang_format_style"); } public get clangFormatFallbackStyle(): string | undefined { return super.Section.get("clang_format_fallbackStyle"); } public get clangFormatSortIncludes(): string | undefined { return super.Section.get("clang_format_sortIncludes"); } From e95d7675f572d8f5078552a7d2b1503c9c826048 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 28 Jul 2021 18:21:57 -0700 Subject: [PATCH 014/101] Work in progress adding settings. --- Extension/package.json | 14 +++++++++++--- Extension/package.nls.json | 3 ++- Extension/src/LanguageServer/client.ts | 1 + Extension/src/LanguageServer/settings.ts | 1 + 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 9b9851d69d..5857583c71 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -249,11 +249,19 @@ "maximum": 32, "scope": "machine" }, + "C_Cpp.maxMemory": { + "type": "integer", + "description": "%c_cpp.configuration.maxMemory.description%", + "default": null, + "minimum": 1024, + "maximum": 65536, + "scope": "machine" + }, "C_Cpp.intelliSense.maxThreads": { "type": "integer", "description": "%c_cpp.configuration.intelliSense.maxThreads.description%", "default": null, - "minimum": 2, + "minimum": 3, "maximum": 32, "scope": "machine" }, @@ -262,14 +270,14 @@ "description": "%c_cpp.configuration.intelliSense.maxMemory.description%", "default": 1024, "minimum": 256, - "maximum": 65536, + "maximum": 32768, "scope": "machine" }, "C_Cpp.references.maxThreads": { "type": "integer", "description": "%c_cpp.configuration.references.maxThreads.description%", "default": null, - "minimum": 2, + "minimum": 1, "maximum": 32, "scope": "machine" }, diff --git a/Extension/package.nls.json b/Extension/package.nls.json index b1f17b7cd0..1e294c6e16 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -25,7 +25,8 @@ "c_cpp.command.RunClangTidyOnOpenFiles.title": "Run clang-tidy on all open files.", "c_cpp.command.RunClangTidyOnAllFiles.title": "Run clang-tidy on all source files.", "c_cpp.configuration.maxThreads.description": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may be exceedeed in some cases. The default of \"null\" uses the number of logical processors available.", - "c_cpp.configuration.intelliSense.maxThreads.description": "The maximum number of concurrent threads to use for IntelliSense processing. The value may be reduced further due to \"C_Cpp.intelliSense.maxMemory\". The default of \"null\" uses the value inherited from \"C_Cpp.maxThreads\".", + "c_cpp.configuration.maxMemory.description": "The maximum memory available for the extension. Fewer processes will run concurrently after this memory limit is exceeded. The default of \"null\" uses the system's free physical memory.", + "c_cpp.configuration.intelliSense.maxThreads.description": "The maximum number of concurrent threads to use for IntelliSense processing. The default of \"null\" uses the value inherited from \"C_Cpp.maxThreads\".", "c_cpp.configuration.references.maxThreads.description": "The maximum number of concurrent threads to use for find all references and rename. The default of \"null\" uses the value inherited from \"C_Cpp.maxThreads\".", "c_cpp.configuration.intelliSense.maxMemory.description": "Older IntelliSense processes will shutdown before new processes are created after this memory limit is exceeded.", "c_cpp.configuration.formatting.description": "Configures the formatting engine", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index dcf5e9657b..ac5b08c11b 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1206,6 +1206,7 @@ export class DefaultClient implements Client { ], initializationOptions: { maxThreads: workspaceSettings.maxThreads, + maxMemory: workspaceSettings.maxMemory ?? os.freemem() / 1024, intelliSenseMaxThreads: workspaceSettings.intelliSenseMaxThreads, intelliSenseMaxMemory: workspaceSettings.intelliSenseMaxMemory, referencesMaxThreads: workspaceSettings.referencesMaxThreads, diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index a4a1f2ab8f..1cfcf116f0 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -136,6 +136,7 @@ export class CppSettings extends Settings { } public get maxThreads(): number | undefined { return super.Section.get("maxThreads"); } + public get maxMemory(): number | undefined { return super.Section.get("maxMemory"); } public get intelliSenseMaxThreads(): number | undefined { return super.Section.get("intelliSense.maxThreads"); } public get intelliSenseMaxMemory(): number | undefined { return super.Section.get("intelliSense.maxMemory"); } public get referencesMaxThreads(): number | undefined { return super.Section.get("references.maxThreads"); } From 8adcaae27644c665af30ccb79daeb3207440abff Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 29 Jul 2021 18:38:09 -0700 Subject: [PATCH 015/101] Settings work in progress. --- Extension/package.json | 1416 ++++++++++++++++++++++-- Extension/package.nls.json | 150 +-- Extension/src/LanguageServer/client.ts | 2 +- 3 files changed, 1380 insertions(+), 188 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 5857583c71..847177d3ec 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -45,7 +45,39 @@ "virtualWorkspaces": false }, "activationEvents": [ - "*" + "onLanguage:c", + "onLanguage:cpp", + "onLanguage:cuda-cpp", + "onCommand:extension.pickNativeProcess", + "onCommand:extension.pickRemoteNativeProcess", + "onCommand:C_Cpp.BuildAndDebugActiveFile", + "onCommand:C_Cpp.ConfigurationEditJSON", + "onCommand:C_Cpp.ConfigurationEditUI", + "onCommand:C_Cpp.ConfigurationSelect", + "onCommand:C_Cpp.ConfigurationProviderSelect", + "onCommand:C_Cpp.SwitchHeaderSource", + "onCommand:C_Cpp.EnableErrorSquiggles", + "onCommand:C_Cpp.DisableErrorSquiggles", + "onCommand:C_Cpp.ToggleIncludeFallback", + "onCommand:C_Cpp.ToggleDimInactiveRegions", + "onCommand:C_Cpp.ResetDatabase", + "onCommand:C_Cpp.TakeSurvey", + "onCommand:C_Cpp.LogDiagnostics", + "onCommand:C_Cpp.RescanWorkspace", + "onCommand:C_Cpp.VcpkgClipboardInstallSuggested", + "onCommand:C_Cpp.VcpkgOnlineHelpSuggested", + "onCommand:C_Cpp.GenerateEditorConfig", + "onCommand:C_Cpp.GoToNextDirectiveInGroup", + "onCommand:C_Cpp.GoToPrevDirectiveInGroup", + "onCommand:C_Cpp.CheckForCompiler", + "onCommand:C_Cpp.RunClangTidyOnActiveFile", + "onCommand:C_Cpp.RunClangTidyOnOpenFiles", + "onCommand:C_Cpp.RunClangTidyOnAllFiles", + "onDebugInitialConfigurations", + "onDebugResolve:cppdbg", + "onDebugResolve:cppvsdbg", + "workspaceContains:/.vscode/c_cpp_properties.json", + "onFileSystem:cpptools-schema" ], "main": "./dist/main", "contributes": { @@ -242,45 +274,93 @@ "title": "C/C++", "properties": { "C_Cpp.maxThreads": { - "type": "integer", - "description": "%c_cpp.configuration.maxThreads.description%", + "type": [ + "integer", + "null" + ], + "markdownDescription": "%c_cpp.configuration.maxThreads.markdownDescription%", "default": null, "minimum": 2, "maximum": 32, "scope": "machine" }, "C_Cpp.maxMemory": { - "type": "integer", - "description": "%c_cpp.configuration.maxMemory.description%", + "type": [ + "integer", + "null" + ], + "markdownDescription": "%c_cpp.configuration.maxMemory.markdownDescription%", "default": null, - "minimum": 1024, + "minimum": 256, "maximum": 65536, "scope": "machine" }, "C_Cpp.intelliSense.maxThreads": { - "type": "integer", - "description": "%c_cpp.configuration.intelliSense.maxThreads.description%", + "type": [ + "integer", + "null" + ], + "markdownDescription": "%c_cpp.configuration.intelliSense.maxThreads.markdownDescription%", "default": null, "minimum": 3, "maximum": 32, "scope": "machine" }, "C_Cpp.intelliSense.maxMemory": { - "type": "integer", - "description": "%c_cpp.configuration.intelliSense.maxMemory.description%", - "default": 1024, + "type": [ + "integer", + "null" + ], + "markdownDescription": "%c_cpp.configuration.intelliSense.maxMemory.markdownDescription%", + "default": null, "minimum": 256, - "maximum": 32768, + "maximum": 65536, "scope": "machine" }, "C_Cpp.references.maxThreads": { - "type": "integer", - "description": "%c_cpp.configuration.references.maxThreads.description%", + "type": [ + "integer", + "null" + ], + "markdownDescription": "%c_cpp.configuration.references.maxThreads.markdownDescription%", "default": null, "minimum": 1, "maximum": 32, "scope": "machine" }, + "C_Cpp.references.maxMemory": { + "type": [ + "integer", + "null" + ], + "markdownDescription": "%c_cpp.configuration.references.maxMemory.markdownDescription%", + "default": null, + "minimum": 256, + "maximum": 65536, + "scope": "machine" + }, + "C_Cpp.clangTidy.maxThreads": { + "type": [ + "integer", + "null" + ], + "markdownDescription": "%c_cpp.configuration.clangTidy.maxThreads.markdownDescription%", + "default": null, + "minimum": 2, + "maximum": 32, + "scope": "machine" + }, + "C_Cpp.clangTidy.maxMemory": { + "type": [ + "integer", + "null" + ], + "markdownDescription": "%c_cpp.configuration.clangTidy.maxMemory.markdownDescription%", + "default": null, + "minimum": 256, + "maximum": 65536, + "scope": "machine" + }, "C_Cpp.clang_format_path": { "type": "string", "description": "%c_cpp.configuration.clang_format_path.description%", @@ -289,8 +369,8 @@ "C_Cpp.clang_format_style": { "type": "string", "default": "file", - "description": "%c_cpp.configuration.clang_format_style.description%", - "scope": "machine-overridable" + "markdownDescription": "%c_cpp.configuration.clang_format_style.markdownDescription%", + "scope": "resource" }, "C_Cpp.clangTidy.path": { "type": "string", @@ -299,7 +379,7 @@ }, "C_Cpp.clangTidy.exclude": { "type": "object", - "markdownDescription": "%c_cpp.configuration.clangTidy.exclude.description%", + "markdownDescription": "%c_cpp.configuration.clangTidy.exclude.markdownDescription%", "default": {}, "additionalProperties": { "anyOf": [ @@ -314,7 +394,7 @@ "type": "string", "pattern": "\\w*\\$\\(basename\\)\\w*", "default": "$(basename).ext", - "description": "%c_cpp.configuration.clangTidy.excludeWhen.description%" + "markdownDescription": "%c_cpp.configuration.clangTidy.excludeWhen.markdownDescription%" } } } @@ -322,13 +402,1126 @@ }, "scope": "resource" }, - "C_Cpp.clangTidy.maxThreads": { - "type": "integer", - "description": "%c_cpp.configuration.clangTidy.maxProcesses.description%", - "default": null, - "minimum": 2, - "maximum": 32, - "scope": "machine" + "C_Cpp.clangTidy.runInBackground": { + "type": "boolean", + "markdownDescription": "%c_cpp.configuration.clangTidy.runInBackground.markdownDescription%", + "default": false, + "scope": "application" + }, + "C_Cpp.clangTidy.buildPath": { + "type": "string", + "markdownDescription": "%c_cpp.configuration.clangTidy.buildPath.markdownDescription%", + "scope": "machine-overridable" + }, + "C_Cpp.clangTidy.config": { + "type": "string", + "markdownDescription": "%c_cpp.configuration.clangTidy.config.markdownDescription%", + "scope": "resource" + }, + "C_Cpp.clangTidy.fix": { + "type": "string", + "enum": [ + "Disabled", + "FixIfNoErrors", + "FixErrors" + ], + "default": "Disabled", + "description": "%c_cpp.configuration.clangTidy.fix.description%", + "enumDescriptions": [ + "%c_cpp.configuration.clangTidy.fix.disabled.description%", + "%c_cpp.configuration.clangTidy.fix.fixIfNoError.description%", + "%c_cpp.configuration.clangTidy.fix.fixError.description%" + ], + "scope": "resource" + }, + "C_Cpp.clangTidy.args": { + "type": "string", + "markdownDescription": "%c_cpp.configuration.clangTidy.args.markdownDescription%", + "scope": "resource" + }, + "C_Cpp.clangTidy.checks": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "*", + "abseil-*", + "abseil-duration-*", + "abseil-duration-addition", + "abseil-duration-comparison", + "abseil-duration-conversion-cast", + "abseil-duration-division", + "abseil-duration-factory-*", + "abseil-duration-factory-float", + "abseil-duration-factory-scale", + "abseil-duration-subtraction", + "abseil-duration-unnecessary-conversion", + "abseil-faster-strsplit-delimiter", + "abseil-no-*", + "abseil-no-internal-dependencies", + "abseil-no-namespace", + "abseil-redundant-strcat-calls", + "abseil-str-cat-append", + "abseil-string-find-*", + "abseil-string-find-startswith", + "abseil-string-find-str-contains", + "abseil-time-*", + "abseil-time-comparison", + "abseil-time-subtraction", + "abseil-upgrade-duration-conversions", + "altera-*", + "altera-kernel-name-restriction", + "altera-single-work-item-barrier", + "altera-struct-pack-align", + "android-*", + "android-cloexec-*", + "android-cloexec-accept", + "android-cloexec-accept4", + "android-cloexec-creat", + "android-cloexec-dup", + "android-cloexec-epoll-*", + "android-cloexec-epoll-create", + "android-cloexec-epoll-create1", + "android-cloexec-fopen", + "android-cloexec-inotify-*", + "android-cloexec-inotify-init", + "android-cloexec-inotify-init1", + "android-cloexec-memfd-create", + "android-cloexec-open", + "android-cloexec-pipe", + "android-cloexec-pipe2", + "android-cloexec-socket", + "android-comparison-in-temp-failure-retry", + "boost-use-to-string", + "bugprone-*", + "bugprone-argument-comment", + "bugprone-assert-side-effect", + "bugprone-bad-signal-to-kill-thread", + "bugprone-bool-pointer-implicit-conversion", + "bugprone-branch-clone", + "bugprone-copy-constructor-init", + "bugprone-dangling-handle", + "bugprone-dynamic-static-initializers", + "bugprone-exception-escape", + "bugprone-fold-init-type", + "bugprone-forward-declaration-namespace", + "bugprone-forwarding-reference-overload", + "bugprone-inaccurate-erase", + "bugprone-incorrect-roundings", + "bugprone-infinite-loop", + "bugprone-integer-division", + "bugprone-lambda-function-name", + "bugprone-macro-parentheses", + "bugprone-macro-repeated-side-effects", + "bugprone-misplaced-*", + "bugprone-misplaced-operator-in-strlen-in-alloc", + "bugprone-misplaced-pointer-arithmetic-in-alloc", + "bugprone-misplaced-widening-cast", + "bugprone-move-forwarding-reference", + "bugprone-multiple-statement-macro", + "bugprone-narrowing-conversions", + "bugprone-no-escape", + "bugprone-not-null-terminated-result", + "bugprone-parent-virtual-call", + "bugprone-posix-return", + "bugprone-redundant-branch-condition", + "bugprone-reserved-identifier", + "bugprone-signal-handler", + "bugprone-signed-char-misuse", + "bugprone-sizeof-*", + "bugprone-sizeof-container", + "bugprone-sizeof-expression", + "bugprone-spuriously-wake-up-functions", + "bugprone-string-*", + "bugprone-string-constructor", + "bugprone-string-integer-assignment", + "bugprone-string-literal-with-embedded-nul", + "bugprone-suspicious-*", + "bugprone-suspicious-enum-usage", + "bugprone-suspicious-include", + "bugprone-suspicious-memset-usage", + "bugprone-suspicious-missing-comma", + "bugprone-suspicious-semicolon", + "bugprone-suspicious-string-compare", + "bugprone-swapped-arguments", + "bugprone-terminating-continue", + "bugprone-throw-keyword-missing", + "bugprone-too-small-loop-variable", + "bugprone-undefined-memory-manipulation", + "bugprone-undelegated-constructor", + "bugprone-unhandled-self-assignment", + "bugprone-unused-raii", + "bugprone-unused-return-value", + "bugprone-use-after-move", + "bugprone-virtual-near-miss", + "cert-*", + "cert-con*", + "cert-con36-c", + "cert-con54-cpp", + "cert-dcl*", + "cert-dcl03-c", + "cert-dcl16-c", + "cert-dcl21-cpp", + "cert-dcl37-c", + "cert-dcl50-cpp", + "cert-dcl51-cpp", + "cert-dcl54-cpp", + "cert-dcl58-cpp", + "cert-dcl59-cpp", + "cert-env33-c", + "cert-err*", + "cert-err09-cpp", + "cert-err34-c", + "cert-err52-cpp", + "cert-err58-cpp", + "cert-err60-cpp", + "cert-err61-cpp", + "cert-fio38-c", + "cert-flp30-c", + "cert-mem57-cpp", + "cert-msc*", + "cert-msc30-c", + "cert-msc32-c", + "cert-msc50-cpp", + "cert-msc51-cpp", + "cert-oop*", + "cert-oop11-cpp", + "cert-oop54-cpp", + "cert-oop57-cpp", + "cert-oop58-cpp", + "cert-pos44-c", + "cert-sig30-c", + "cert-str34-c", + "clang-analyzer-*", + "clang-analyzer-apiModeling.*", + "clang-analyzer-apiModeling.StdCLibraryFunctions", + "clang-analyzer-apiModeling.TrustNonnull", + "clang-analyzer-apiModeling.google.GTest", + "clang-analyzer-apiModeling.llvm.*", + "clang-analyzer-apiModeling.llvm.CastValue", + "clang-analyzer-apiModeling.llvm.ReturnValue", + "clang-analyzer-core.*", + "clang-analyzer-core.CallAndMessage", + "clang-analyzer-core.CallAndMessageModeling", + "clang-analyzer-core.DivideZero", + "clang-analyzer-core.DynamicTypePropagation", + "clang-analyzer-core.NonNullParamChecker", + "clang-analyzer-core.NonnilStringConstants", + "clang-analyzer-core.NullDereference", + "clang-analyzer-core.StackAddrEscapeBase", + "clang-analyzer-core.StackAddressEscape", + "clang-analyzer-core.UndefinedBinaryOperatorResult", + "clang-analyzer-core.VLASize", + "clang-analyzer-core.builtin.*", + "clang-analyzer-core.builtin.BuiltinFunctions", + "clang-analyzer-core.builtin.NoReturnFunctions", + "clang-analyzer-core.uninitialized.*", + "clang-analyzer-core.uninitialized.ArraySubscript", + "clang-analyzer-core.uninitialized.Assign", + "clang-analyzer-core.uninitialized.Branch", + "clang-analyzer-core.uninitialized.CapturedBlockVariable", + "clang-analyzer-core.uninitialized.UndefReturn", + "clang-analyzer-cplusplus.*", + "clang-analyzer-cplusplus.InnerPointer", + "clang-analyzer-cplusplus.Move", + "clang-analyzer-cplusplus.NewDelete", + "clang-analyzer-cplusplus.NewDeleteLeaks", + "clang-analyzer-cplusplus.PlacementNew", + "clang-analyzer-cplusplus.PureVirtualCall", + "clang-analyzer-cplusplus.SelfAssignment", + "clang-analyzer-cplusplus.SmartPtrModeling", + "clang-analyzer-cplusplus.VirtualCallModeling", + "clang-analyzer-deadcode.DeadStores", + "clang-analyzer-fuchsia.HandleChecker", + "clang-analyzer-nullablity.*", + "clang-analyzer-nullability.NullPassedToNonnull", + "clang-analyzer-nullability.NullReturnedFromNonnull", + "clang-analyzer-nullability.NullabilityBase", + "clang-analyzer-nullability.NullableDereferenced", + "clang-analyzer-nullability.NullablePassedToNonnull", + "clang-analyzer-nullability.NullableReturnedFromNonnull", + "clang-analyzer-optin.*", + "clang-analyzer-optin.cplusplus.*", + "clang-analyzer-optin.cplusplus.UninitializedObject", + "clang-analyzer-optin.cplusplus.VirtualCall", + "clang-analyzer-optin.mpi.MPI-Checker", + "clang-analyzer-optin.osx.*", + "clang-analyzer-optin.osx.OSObjectCStyleCast", + "clang-analyzer-optin.osx.cocoa.localizability.*", + "clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker", + "clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker", + "clang-analyzer-optin.performance.*", + "clang-analyzer-optin.performance.GCDAntipattern", + "clang-analyzer-optin.performance.Padding", + "clang-analyzer-optin.portability.UnixAPI", + "clang-analyzer-osx.*", + "clang-analyzer-osx.API", + "clang-analyzer-osx.MIG", + "clang-analyzer-osx.NSOrCFErrorDerefChecker", + "clang-analyzer-osx.NumberObjectConversion", + "clang-analyzer-osx.OSObjectRetainCount", + "clang-analyzer-osx.ObjCProperty", + "clang-analyzer-osx.SecKeychainAPI", + "clang-analyzer-osx.cocoa.*", + "clang-analyzer-osx.cocoa.AtSync", + "clang-analyzer-osx.cocoa.AutoreleaseWrite", + "clang-analyzer-osx.cocoa.ClassRelease", + "clang-analyzer-osx.cocoa.Dealloc", + "clang-analyzer-osx.cocoa.IncompatibleMethodTypes", + "clang-analyzer-osx.cocoa.Loops", + "clang-analyzer-osx.cocoa.MissingSuperCall", + "clang-analyzer-osx.cocoa.NSAutoreleasePool", + "clang-analyzer-osx.cocoa.NSError", + "clang-analyzer-osx.cocoa.NilArg", + "clang-analyzer-osx.cocoa.NonNilReturnValue", + "clang-analyzer-osx.cocoa.ObjCGenerics", + "clang-analyzer-osx.cocoa.RetainCount", + "clang-analyzer-osx.cocoa.RetainCountBase", + "clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak", + "clang-analyzer-osx.cocoa.SelfInit", + "clang-analyzer-osx.cocoa.SuperDealloc", + "clang-analyzer-osx.cocoa.UnusedIvars", + "clang-analyzer-osx.cocoa.VariadicMethodTypes", + "clang-analyzer-osx.coreFoundation.*", + "clang-analyzer-osx.coreFoundation.CFError", + "clang-analyzer-osx.coreFoundation.CFNumber", + "clang-analyzer-osx.coreFoundation.CFRetainRelease", + "clang-analyzer-osx.coreFoundation.containers.*", + "clang-analyzer-osx.coreFoundation.containers.OutOfBounds", + "clang-analyzer-osx.coreFoundation.containers.PointerSizedValues", + "clang-analyzer-security.*", + "clang-analyzer-security.FloatLoopCounter", + "clang-analyzer-security.insecureAPI.*", + "clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling", + "clang-analyzer-security.insecureAPI.SecuritySyntaxChecker", + "clang-analyzer-security.insecureAPI.UncheckedReturn", + "clang-analyzer-security.insecureAPI.bcmp", + "clang-analyzer-security.insecureAPI.bcopy", + "clang-analyzer-security.insecureAPI.bzero", + "clang-analyzer-security.insecureAPI.decodeValueOfObjCType", + "clang-analyzer-security.insecureAPI.getpw", + "clang-analyzer-security.insecureAPI.gets", + "clang-analyzer-security.insecureAPI.mkstemp", + "clang-analyzer-security.insecureAPI.mktemp", + "clang-analyzer-security.insecureAPI.rand", + "clang-analyzer-security.insecureAPI.strcpy", + "clang-analyzer-security.insecureAPI.vfork", + "clang-analyzer-unix.*", + "clang-analyzer-unix.API", + "clang-analyzer-unix.DynamicMemoryModeling", + "clang-analyzer-unix.Malloc", + "clang-analyzer-unix.MallocSizeof", + "clang-analyzer-unix.MismatchedDeallocator", + "clang-analyzer-unix.Vfork", + "clang-analyzer-unix.cstring.*", + "clang-analyzer-unix.cstring.BadSizeArg", + "clang-analyzer-unix.cstring.CStringModeling", + "clang-analyzer-unix.cstring.NullArg", + "clang-analyzer-valist.*", + "clang-analyzer-valist.CopyToSelf", + "clang-analyzer-valist.Uninitialized", + "clang-analyzer-valist.Unterminated", + "clang-analyzer-valist.ValistBase", + "clang-analyzer-webkit.*", + "clang-analyzer-webkit.NoUncountedMemberChecker", + "clang-analyzer-webkit.RefCntblBaseVirtualDtor", + "clang-analyzer-webkit.UncountedLambdaCapturesChecker", + "concurrency-mt-unsafe", + "cppcoreguidelines-*", + "cppcoreguidelines-avoid-*", + "cppcoreguidelines-avoid-c-arrays", + "cppcoreguidelines-avoid-goto", + "cppcoreguidelines-avoid-magic-numbers", + "cppcoreguidelines-avoid-non-const-global-variables", + "cppcoreguidelines-c-copy-assignment-signature", + "cppcoreguidelines-explicit-virtual-functions", + "cppcoreguidelines-init-variables", + "cppcoreguidelines-interfaces-global-init", + "cppcoreguidelines-macro-usage", + "cppcoreguidelines-narrowing-conversions", + "cppcoreguidelines-no-malloc", + "cppcoreguidelines-non-private-member-variables-in-classes", + "cppcoreguidelines-owning-memory", + "cppcoreguidelines-pro-bounds-*", + "cppcoreguidelines-pro-bounds-array-to-pointer-decay", + "cppcoreguidelines-pro-bounds-constant-array-index", + "cppcoreguidelines-pro-bounds-pointer-arithmetic", + "cppcoreguidelines-pro-type-*", + "cppcoreguidelines-pro-type-const-cast", + "cppcoreguidelines-pro-type-cstyle-cast", + "cppcoreguidelines-pro-type-member-init", + "cppcoreguidelines-pro-type-reinterpret-cast", + "cppcoreguidelines-pro-type-static-cast-downcast", + "cppcoreguidelines-pro-type-union-access", + "cppcoreguidelines-pro-type-vararg", + "cppcoreguidelines-slicing", + "cppcoreguidelines-special-member-functions", + "darwin-*", + "darwin-avoid-spinlock", + "darwin-dispatch-once-nonstatic", + "fuschsia-*", + "fuschsia-default-*", + "fuchsia-default-arguments-calls", + "fuchsia-default-arguments-declarations", + "fuchsia-header-anon-namespaces", + "fuchsia-multiple-inheritance", + "fuchsia-overloaded-operator", + "fuchsia-statically-constructed-objects", + "fuchsia-trailing-return", + "fuchsia-virtual-inheritance", + "google-*", + "google-build-*", + "google-build-explicit-make-pair", + "google-build-namespaces", + "google-build-using-namespace", + "google-default-arguments", + "google-explicit-constructor", + "google-global-names-in-headers", + "google-objc-*", + "google-objc-avoid-*", + "google-objc-avoid-nsobject-new", + "google-objc-avoid-throwing-exception", + "google-objc-function-naming", + "google-objc-global-variable-declaration", + "google-readability-*", + "google-readability-avoid-underscore-in-googletest-name", + "google-readability-braces-around-statements", + "google-readability-casting", + "google-readability-function-size", + "google-readability-namespace-comments", + "google-readability-todo", + "google-runtime-*", + "google-runtime-int", + "google-runtime-operator", + "google-upgrade-googletest-case", + "hicpp-*", + "hicpp-avoid-*", + "hicpp-avoid-c-arrays", + "hicpp-avoid-goto", + "hicpp-braces-around-statements", + "hicpp-deprecated-headers", + "hicpp-exception-baseclass", + "hicpp-explicit-conversions", + "hicpp-function-size", + "hicpp-invalid-access-moved", + "hicpp-member-init", + "hicpp-move-const-arg", + "hicpp-multiway-paths-covered", + "hicpp-named-parameter", + "hicpp-new-delete-operators", + "hicpp-no-*", + "hicpp-no-array-decay", + "hicpp-no-assembler", + "hicpp-no-malloc", + "hicpp-noexcept-move", + "hicpp-signed-bitwise", + "hicpp-special-member-functions", + "hicpp-static-assert", + "hicpp-undelegated-constructor", + "hicpp-uppercase-literal-suffix", + "hicpp-use-*", + "hicpp-use-auto", + "hicpp-use-emplace", + "hicpp-use-equals-*", + "hicpp-use-equals-default", + "hicpp-use-equals-delete", + "hicpp-use-noexcept", + "hicpp-use-nullptr", + "hicpp-use-override", + "hicpp-vararg", + "linuxkernel-must-check-errs", + "llvm-*", + "llvm-else-after-return", + "llvm-header-guard", + "llvm-include-order", + "llvm-namespace-comment", + "llvm-prefer-*", + "llvm-prefer-isa-or-dyn-cast-in-conditionals", + "llvm-prefer-register-over-unsigned", + "llvm-qualified-auto", + "llvm-twine-local", + "llvmlibc-*", + "llvmlibc-callee-namespace", + "llvmlibc-implementation-in-namespace", + "llvmlibc-restrict-system-libc-headers", + "misc-*", + "misc-definitions-in-headers", + "misc-misplaced-const", + "misc-new-delete-overloads", + "misc-no-recursion", + "misc-non-*", + "misc-non-copyable-objects", + "misc-non-private-member-variables-in-classes", + "misc-redundant-expression", + "misc-static-assert", + "misc-throw-by-value-catch-by-reference", + "misc-unconventional-assign-operator", + "misc-uniqueptr-reset-release", + "misc-unused-*", + "misc-unused-alias-decls", + "misc-unused-parameters", + "misc-unused-using-decls", + "modernize-*", + "modernize-avoid-*", + "modernize-avoid-bind", + "modernize-avoid-c-arrays", + "modernize-concat-nested-namespaces", + "modernize-deprecated-*", + "modernize-deprecated-headers", + "modernize-deprecated-ios-base-aliases", + "modernize-loop-convert", + "modernize-make-*", + "modernize-make-shared", + "modernize-make-unique", + "modernize-pass-by-value", + "modernize-raw-string-literal", + "modernize-redundant-void-arg", + "modernize-replace-*", + "modernize-replace-auto-ptr", + "modernize-replace-disallow-copy-and-assign-macro", + "modernize-replace-random-shuffle", + "modernize-return-braced-init-list", + "modernize-shrink-to-fit", + "modernize-unary-static-assert", + "modernize-use-*", + "modernize-use-auto", + "modernize-use-bool-literals", + "modernize-use-default-member-init", + "modernize-use-emplace", + "modernize-use-equals-*", + "modernize-use-equals-default", + "modernize-use-equals-delete", + "modernize-use-nodiscard", + "modernize-use-noexcept", + "modernize-use-nullptr", + "modernize-use-override", + "modernize-use-trailing-return-type", + "modernize-use-transparent-functors", + "modernize-use-uncaught-exceptions", + "modernize-use-using", + "mpi-*", + "mpi-buffer-deref", + "mpi-type-mismatch", + "objc-*", + "objc-avoid-nserror-init", + "objc-dealloc-in-category", + "objc-forbidden-subclassing", + "objc-missing-hash", + "objc-nsinvocation-argument-lifetime", + "objc-property-declaration", + "objc-super-self", + "openmp-*", + "openmp-exception-escape", + "openmp-use-default-none", + "performance-*", + "performance-faster-string-find", + "performance-for-range-copy", + "performance-implicit-conversion-in-loop", + "performance-inefficient-*", + "performance-inefficient-algorithm", + "performance-inefficient-string-concatenation", + "performance-inefficient-vector-operation", + "performance-move-*", + "performance-move-const-arg", + "performance-move-constructor-init", + "performance-no-*", + "performance-no-automatic-move", + "performance-no-int-to-ptr", + "performance-noexcept-move-constructor", + "performance-trivially-destructible", + "performance-type-promotion-in-math-fn", + "performance-unnecessary-*", + "performance-unnecessary-copy-initialization", + "performance-unnecessary-value-param", + "portability-*", + "portability-restrict-system-includes", + "portability-simd-intrinsics", + "readability-*", + "readability-avoid-const-params-in-decls", + "readability-braces-around-statements", + "readability-const-return-type", + "readability-container-size-empty", + "readability-convert-member-functions-to-static", + "readability-delete-null-pointer", + "readability-deleted-default", + "readability-else-after-return", + "readability-function-*", + "readability-function-cognitive-complexity", + "readability-function-size", + "readability-identifier-naming", + "readability-implicit-bool-conversion", + "readability-inconsistent-declaration-parameter-name", + "readability-isolate-declaration", + "readability-magic-numbers", + "readability-make-member-function-const", + "readability-misleading-indentation", + "readability-misplaced-array-index", + "readability-named-parameter", + "readability-non-const-parameter", + "readability-qualified-auto", + "readability-redundant-*", + "readability-redundant-access-specifiers", + "readability-redundant-control-flow", + "readability-redundant-declaration", + "readability-redundant-function-ptr-dereference", + "readability-redundant-member-init", + "readability-redundant-preprocessor", + "readability-redundant-smartptr-get", + "readability-redundant-string-*", + "readability-redundant-string-cstr", + "readability-redundant-string-init", + "readability-simplify-*", + "readability-simplify-boolean-expr", + "readability-simplify-subscript-expr", + "readability-static-*", + "readability-static-accessed-through-instance", + "readability-static-definition-in-anonymous-namespace", + "readability-string-compare", + "readability-uniqueptr-delete-release", + "readability-uppercase-literal-suffix", + "readability-use-anyofallof", + "zircon-temporary-objects", + "-*", + "-abseil-*", + "-abseil-duration-*", + "-abseil-duration-addition", + "-abseil-duration-comparison", + "-abseil-duration-conversion-cast", + "-abseil-duration-division", + "-abseil-duration-factory-*", + "-abseil-duration-factory-float", + "-abseil-duration-factory-scale", + "-abseil-duration-subtraction", + "-abseil-duration-unnecessary-conversion", + "-abseil-faster-strsplit-delimiter", + "-abseil-no-*", + "-abseil-no-internal-dependencies", + "-abseil-no-namespace", + "-abseil-redundant-strcat-calls", + "-abseil-str-cat-append", + "-abseil-string-find-*", + "-abseil-string-find-startswith", + "-abseil-string-find-str-contains", + "-abseil-time-*", + "-abseil-time-comparison", + "-abseil-time-subtraction", + "-abseil-upgrade-duration-conversions", + "-altera-*", + "-altera-kernel-name-restriction", + "-altera-single-work-item-barrier", + "-altera-struct-pack-align", + "-android-*", + "-android-cloexec-*", + "-android-cloexec-accept", + "-android-cloexec-accept4", + "-android-cloexec-creat", + "-android-cloexec-dup", + "-android-cloexec-epoll-*", + "-android-cloexec-epoll-create", + "-android-cloexec-epoll-create1", + "-android-cloexec-fopen", + "-android-cloexec-inotify-*", + "-android-cloexec-inotify-init", + "-android-cloexec-inotify-init1", + "-android-cloexec-memfd-create", + "-android-cloexec-open", + "-android-cloexec-pipe", + "-android-cloexec-pipe2", + "-android-cloexec-socket", + "-android-comparison-in-temp-failure-retry", + "-boost-use-to-string", + "-bugprone-*", + "-bugprone-argument-comment", + "-bugprone-assert-side-effect", + "-bugprone-bad-signal-to-kill-thread", + "-bugprone-bool-pointer-implicit-conversion", + "-bugprone-branch-clone", + "-bugprone-copy-constructor-init", + "-bugprone-dangling-handle", + "-bugprone-dynamic-static-initializers", + "-bugprone-exception-escape", + "-bugprone-fold-init-type", + "-bugprone-forward-declaration-namespace", + "-bugprone-forwarding-reference-overload", + "-bugprone-inaccurate-erase", + "-bugprone-incorrect-roundings", + "-bugprone-infinite-loop", + "-bugprone-integer-division", + "-bugprone-lambda-function-name", + "-bugprone-macro-parentheses", + "-bugprone-macro-repeated-side-effects", + "-bugprone-misplaced-*", + "-bugprone-misplaced-operator-in-strlen-in-alloc", + "-bugprone-misplaced-pointer-arithmetic-in-alloc", + "-bugprone-misplaced-widening-cast", + "-bugprone-move-forwarding-reference", + "-bugprone-multiple-statement-macro", + "-bugprone-narrowing-conversions", + "-bugprone-no-escape", + "-bugprone-not-null-terminated-result", + "-bugprone-parent-virtual-call", + "-bugprone-posix-return", + "-bugprone-redundant-branch-condition", + "-bugprone-reserved-identifier", + "-bugprone-signal-handler", + "-bugprone-signed-char-misuse", + "-bugprone-sizeof-*", + "-bugprone-sizeof-container", + "-bugprone-sizeof-expression", + "-bugprone-spuriously-wake-up-functions", + "-bugprone-string-*", + "-bugprone-string-constructor", + "-bugprone-string-integer-assignment", + "-bugprone-string-literal-with-embedded-nul", + "-bugprone-suspicious-*", + "-bugprone-suspicious-enum-usage", + "-bugprone-suspicious-include", + "-bugprone-suspicious-memset-usage", + "-bugprone-suspicious-missing-comma", + "-bugprone-suspicious-semicolon", + "-bugprone-suspicious-string-compare", + "-bugprone-swapped-arguments", + "-bugprone-terminating-continue", + "-bugprone-throw-keyword-missing", + "-bugprone-too-small-loop-variable", + "-bugprone-undefined-memory-manipulation", + "-bugprone-undelegated-constructor", + "-bugprone-unhandled-self-assignment", + "-bugprone-unused-raii", + "-bugprone-unused-return-value", + "-bugprone-use-after-move", + "-bugprone-virtual-near-miss", + "-cert-*", + "-cert-con*", + "-cert-con36-c", + "-cert-con54-cpp", + "-cert-dcl*", + "-cert-dcl03-c", + "-cert-dcl16-c", + "-cert-dcl21-cpp", + "-cert-dcl37-c", + "-cert-dcl50-cpp", + "-cert-dcl51-cpp", + "-cert-dcl54-cpp", + "-cert-dcl58-cpp", + "-cert-dcl59-cpp", + "-cert-env33-c", + "-cert-err*", + "-cert-err09-cpp", + "-cert-err34-c", + "-cert-err52-cpp", + "-cert-err58-cpp", + "-cert-err60-cpp", + "-cert-err61-cpp", + "-cert-fio38-c", + "-cert-flp30-c", + "-cert-mem57-cpp", + "-cert-msc*", + "-cert-msc30-c", + "-cert-msc32-c", + "-cert-msc50-cpp", + "-cert-msc51-cpp", + "-cert-oop*", + "-cert-oop11-cpp", + "-cert-oop54-cpp", + "-cert-oop57-cpp", + "-cert-oop58-cpp", + "-cert-pos44-c", + "-cert-sig30-c", + "-cert-str34-c", + "-clang-analyzer-*", + "-clang-analyzer-apiModeling.*", + "-clang-analyzer-apiModeling.StdCLibraryFunctions", + "-clang-analyzer-apiModeling.TrustNonnull", + "-clang-analyzer-apiModeling.google.GTest", + "-clang-analyzer-apiModeling.llvm.*", + "-clang-analyzer-apiModeling.llvm.CastValue", + "-clang-analyzer-apiModeling.llvm.ReturnValue", + "-clang-analyzer-core.*", + "-clang-analyzer-core.CallAndMessage", + "-clang-analyzer-core.CallAndMessageModeling", + "-clang-analyzer-core.DivideZero", + "-clang-analyzer-core.DynamicTypePropagation", + "-clang-analyzer-core.NonNullParamChecker", + "-clang-analyzer-core.NonnilStringConstants", + "-clang-analyzer-core.NullDereference", + "-clang-analyzer-core.StackAddrEscapeBase", + "-clang-analyzer-core.StackAddressEscape", + "-clang-analyzer-core.UndefinedBinaryOperatorResult", + "-clang-analyzer-core.VLASize", + "-clang-analyzer-core.builtin.*", + "-clang-analyzer-core.builtin.BuiltinFunctions", + "-clang-analyzer-core.builtin.NoReturnFunctions", + "-clang-analyzer-core.uninitialized.*", + "-clang-analyzer-core.uninitialized.ArraySubscript", + "-clang-analyzer-core.uninitialized.Assign", + "-clang-analyzer-core.uninitialized.Branch", + "-clang-analyzer-core.uninitialized.CapturedBlockVariable", + "-clang-analyzer-core.uninitialized.UndefReturn", + "-clang-analyzer-cplusplus.*", + "-clang-analyzer-cplusplus.InnerPointer", + "-clang-analyzer-cplusplus.Move", + "-clang-analyzer-cplusplus.NewDelete", + "-clang-analyzer-cplusplus.NewDeleteLeaks", + "-clang-analyzer-cplusplus.PlacementNew", + "-clang-analyzer-cplusplus.PureVirtualCall", + "-clang-analyzer-cplusplus.SelfAssignment", + "-clang-analyzer-cplusplus.SmartPtrModeling", + "-clang-analyzer-cplusplus.VirtualCallModeling", + "-clang-analyzer-deadcode.DeadStores", + "-clang-analyzer-fuchsia.HandleChecker", + "-clang-analyzer-nullablity.*", + "-clang-analyzer-nullability.NullPassedToNonnull", + "-clang-analyzer-nullability.NullReturnedFromNonnull", + "-clang-analyzer-nullability.NullabilityBase", + "-clang-analyzer-nullability.NullableDereferenced", + "-clang-analyzer-nullability.NullablePassedToNonnull", + "-clang-analyzer-nullability.NullableReturnedFromNonnull", + "-clang-analyzer-optin.*", + "-clang-analyzer-optin.cplusplus.*", + "-clang-analyzer-optin.cplusplus.UninitializedObject", + "-clang-analyzer-optin.cplusplus.VirtualCall", + "-clang-analyzer-optin.mpi.MPI-Checker", + "-clang-analyzer-optin.osx.*", + "-clang-analyzer-optin.osx.OSObjectCStyleCast", + "-clang-analyzer-optin.osx.cocoa.localizability.*", + "-clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker", + "-clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker", + "-clang-analyzer-optin.performance.*", + "-clang-analyzer-optin.performance.GCDAntipattern", + "-clang-analyzer-optin.performance.Padding", + "-clang-analyzer-optin.portability.UnixAPI", + "-clang-analyzer-osx.*", + "-clang-analyzer-osx.API", + "-clang-analyzer-osx.MIG", + "-clang-analyzer-osx.NSOrCFErrorDerefChecker", + "-clang-analyzer-osx.NumberObjectConversion", + "-clang-analyzer-osx.OSObjectRetainCount", + "-clang-analyzer-osx.ObjCProperty", + "-clang-analyzer-osx.SecKeychainAPI", + "-clang-analyzer-osx.cocoa.*", + "-clang-analyzer-osx.cocoa.AtSync", + "-clang-analyzer-osx.cocoa.AutoreleaseWrite", + "-clang-analyzer-osx.cocoa.ClassRelease", + "-clang-analyzer-osx.cocoa.Dealloc", + "-clang-analyzer-osx.cocoa.IncompatibleMethodTypes", + "-clang-analyzer-osx.cocoa.Loops", + "-clang-analyzer-osx.cocoa.MissingSuperCall", + "-clang-analyzer-osx.cocoa.NSAutoreleasePool", + "-clang-analyzer-osx.cocoa.NSError", + "-clang-analyzer-osx.cocoa.NilArg", + "-clang-analyzer-osx.cocoa.NonNilReturnValue", + "-clang-analyzer-osx.cocoa.ObjCGenerics", + "-clang-analyzer-osx.cocoa.RetainCount", + "-clang-analyzer-osx.cocoa.RetainCountBase", + "-clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak", + "-clang-analyzer-osx.cocoa.SelfInit", + "-clang-analyzer-osx.cocoa.SuperDealloc", + "-clang-analyzer-osx.cocoa.UnusedIvars", + "-clang-analyzer-osx.cocoa.VariadicMethodTypes", + "-clang-analyzer-osx.coreFoundation.*", + "-clang-analyzer-osx.coreFoundation.CFError", + "-clang-analyzer-osx.coreFoundation.CFNumber", + "-clang-analyzer-osx.coreFoundation.CFRetainRelease", + "-clang-analyzer-osx.coreFoundation.containers.*", + "-clang-analyzer-osx.coreFoundation.containers.OutOfBounds", + "-clang-analyzer-osx.coreFoundation.containers.PointerSizedValues", + "-clang-analyzer-security.*", + "-clang-analyzer-security.FloatLoopCounter", + "-clang-analyzer-security.insecureAPI.*", + "-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling", + "-clang-analyzer-security.insecureAPI.SecuritySyntaxChecker", + "-clang-analyzer-security.insecureAPI.UncheckedReturn", + "-clang-analyzer-security.insecureAPI.bcmp", + "-clang-analyzer-security.insecureAPI.bcopy", + "-clang-analyzer-security.insecureAPI.bzero", + "-clang-analyzer-security.insecureAPI.decodeValueOfObjCType", + "-clang-analyzer-security.insecureAPI.getpw", + "-clang-analyzer-security.insecureAPI.gets", + "-clang-analyzer-security.insecureAPI.mkstemp", + "-clang-analyzer-security.insecureAPI.mktemp", + "-clang-analyzer-security.insecureAPI.rand", + "-clang-analyzer-security.insecureAPI.strcpy", + "-clang-analyzer-security.insecureAPI.vfork", + "-clang-analyzer-unix.*", + "-clang-analyzer-unix.API", + "-clang-analyzer-unix.DynamicMemoryModeling", + "-clang-analyzer-unix.Malloc", + "-clang-analyzer-unix.MallocSizeof", + "-clang-analyzer-unix.MismatchedDeallocator", + "-clang-analyzer-unix.Vfork", + "-clang-analyzer-unix.cstring.*", + "-clang-analyzer-unix.cstring.BadSizeArg", + "-clang-analyzer-unix.cstring.CStringModeling", + "-clang-analyzer-unix.cstring.NullArg", + "-clang-analyzer-valist.*", + "-clang-analyzer-valist.CopyToSelf", + "-clang-analyzer-valist.Uninitialized", + "-clang-analyzer-valist.Unterminated", + "-clang-analyzer-valist.ValistBase", + "-clang-analyzer-webkit.*", + "-clang-analyzer-webkit.NoUncountedMemberChecker", + "-clang-analyzer-webkit.RefCntblBaseVirtualDtor", + "-clang-analyzer-webkit.UncountedLambdaCapturesChecker", + "-concurrency-mt-unsafe", + "-cppcoreguidelines-*", + "-cppcoreguidelines-avoid-*", + "-cppcoreguidelines-avoid-c-arrays", + "-cppcoreguidelines-avoid-goto", + "-cppcoreguidelines-avoid-magic-numbers", + "-cppcoreguidelines-avoid-non-const-global-variables", + "-cppcoreguidelines-c-copy-assignment-signature", + "-cppcoreguidelines-explicit-virtual-functions", + "-cppcoreguidelines-init-variables", + "-cppcoreguidelines-interfaces-global-init", + "-cppcoreguidelines-macro-usage", + "-cppcoreguidelines-narrowing-conversions", + "-cppcoreguidelines-no-malloc", + "-cppcoreguidelines-non-private-member-variables-in-classes", + "-cppcoreguidelines-owning-memory", + "-cppcoreguidelines-pro-bounds-*", + "-cppcoreguidelines-pro-bounds-array-to-pointer-decay", + "-cppcoreguidelines-pro-bounds-constant-array-index", + "-cppcoreguidelines-pro-bounds-pointer-arithmetic", + "-cppcoreguidelines-pro-type-*", + "-cppcoreguidelines-pro-type-const-cast", + "-cppcoreguidelines-pro-type-cstyle-cast", + "-cppcoreguidelines-pro-type-member-init", + "-cppcoreguidelines-pro-type-reinterpret-cast", + "-cppcoreguidelines-pro-type-static-cast-downcast", + "-cppcoreguidelines-pro-type-union-access", + "-cppcoreguidelines-pro-type-vararg", + "-cppcoreguidelines-slicing", + "-cppcoreguidelines-special-member-functions", + "-darwin-*", + "-darwin-avoid-spinlock", + "-darwin-dispatch-once-nonstatic", + "-fuschsia-*", + "-fuschsia-default-*", + "-fuchsia-default-arguments-calls", + "-fuchsia-default-arguments-declarations", + "-fuchsia-header-anon-namespaces", + "-fuchsia-multiple-inheritance", + "-fuchsia-overloaded-operator", + "-fuchsia-statically-constructed-objects", + "-fuchsia-trailing-return", + "-fuchsia-virtual-inheritance", + "-google-*", + "-google-build-*", + "-google-build-explicit-make-pair", + "-google-build-namespaces", + "-google-build-using-namespace", + "-google-default-arguments", + "-google-explicit-constructor", + "-google-global-names-in-headers", + "-google-objc-*", + "-google-objc-avoid-*", + "-google-objc-avoid-nsobject-new", + "-google-objc-avoid-throwing-exception", + "-google-objc-function-naming", + "-google-objc-global-variable-declaration", + "-google-readability-*", + "-google-readability-avoid-underscore-in-googletest-name", + "-google-readability-braces-around-statements", + "-google-readability-casting", + "-google-readability-function-size", + "-google-readability-namespace-comments", + "-google-readability-todo", + "-google-runtime-*", + "-google-runtime-int", + "-google-runtime-operator", + "-google-upgrade-googletest-case", + "-hicpp-*", + "-hicpp-avoid-*", + "-hicpp-avoid-c-arrays", + "-hicpp-avoid-goto", + "-hicpp-braces-around-statements", + "-hicpp-deprecated-headers", + "-hicpp-exception-baseclass", + "-hicpp-explicit-conversions", + "-hicpp-function-size", + "-hicpp-invalid-access-moved", + "-hicpp-member-init", + "-hicpp-move-const-arg", + "-hicpp-multiway-paths-covered", + "-hicpp-named-parameter", + "-hicpp-new-delete-operators", + "-hicpp-no-*", + "-hicpp-no-array-decay", + "-hicpp-no-assembler", + "-hicpp-no-malloc", + "-hicpp-noexcept-move", + "-hicpp-signed-bitwise", + "-hicpp-special-member-functions", + "-hicpp-static-assert", + "-hicpp-undelegated-constructor", + "-hicpp-uppercase-literal-suffix", + "-hicpp-use-*", + "-hicpp-use-auto", + "-hicpp-use-emplace", + "-hicpp-use-equals-*", + "-hicpp-use-equals-default", + "-hicpp-use-equals-delete", + "-hicpp-use-noexcept", + "-hicpp-use-nullptr", + "-hicpp-use-override", + "-hicpp-vararg", + "-linuxkernel-must-check-errs", + "-llvm-*", + "-llvm-else-after-return", + "-llvm-header-guard", + "-llvm-include-order", + "-llvm-namespace-comment", + "-llvm-prefer-*", + "-llvm-prefer-isa-or-dyn-cast-in-conditionals", + "-llvm-prefer-register-over-unsigned", + "-llvm-qualified-auto", + "-llvm-twine-local", + "-llvmlibc-*", + "-llvmlibc-callee-namespace", + "-llvmlibc-implementation-in-namespace", + "-llvmlibc-restrict-system-libc-headers", + "-misc-*", + "-misc-definitions-in-headers", + "-misc-misplaced-const", + "-misc-new-delete-overloads", + "-misc-no-recursion", + "-misc-non-*", + "-misc-non-copyable-objects", + "-misc-non-private-member-variables-in-classes", + "-misc-redundant-expression", + "-misc-static-assert", + "-misc-throw-by-value-catch-by-reference", + "-misc-unconventional-assign-operator", + "-misc-uniqueptr-reset-release", + "-misc-unused-*", + "-misc-unused-alias-decls", + "-misc-unused-parameters", + "-misc-unused-using-decls", + "-modernize-*", + "-modernize-avoid-*", + "-modernize-avoid-bind", + "-modernize-avoid-c-arrays", + "-modernize-concat-nested-namespaces", + "-modernize-deprecated-*", + "-modernize-deprecated-headers", + "-modernize-deprecated-ios-base-aliases", + "-modernize-loop-convert", + "-modernize-make-*", + "-modernize-make-shared", + "-modernize-make-unique", + "-modernize-pass-by-value", + "-modernize-raw-string-literal", + "-modernize-redundant-void-arg", + "-modernize-replace-*", + "-modernize-replace-auto-ptr", + "-modernize-replace-disallow-copy-and-assign-macro", + "-modernize-replace-random-shuffle", + "-modernize-return-braced-init-list", + "-modernize-shrink-to-fit", + "-modernize-unary-static-assert", + "-modernize-use-*", + "-modernize-use-auto", + "-modernize-use-bool-literals", + "-modernize-use-default-member-init", + "-modernize-use-emplace", + "-modernize-use-equals-*", + "-modernize-use-equals-default", + "-modernize-use-equals-delete", + "-modernize-use-nodiscard", + "-modernize-use-noexcept", + "-modernize-use-nullptr", + "-modernize-use-override", + "-modernize-use-trailing-return-type", + "-modernize-use-transparent-functors", + "-modernize-use-uncaught-exceptions", + "-modernize-use-using", + "-mpi-*", + "-mpi-buffer-deref", + "-mpi-type-mismatch", + "-objc-*", + "-objc-avoid-nserror-init", + "-objc-dealloc-in-category", + "-objc-forbidden-subclassing", + "-objc-missing-hash", + "-objc-nsinvocation-argument-lifetime", + "-objc-property-declaration", + "-objc-super-self", + "-openmp-*", + "-openmp-exception-escape", + "-openmp-use-default-none", + "-performance-*", + "-performance-faster-string-find", + "-performance-for-range-copy", + "-performance-implicit-conversion-in-loop", + "-performance-inefficient-*", + "-performance-inefficient-algorithm", + "-performance-inefficient-string-concatenation", + "-performance-inefficient-vector-operation", + "-performance-move-*", + "-performance-move-const-arg", + "-performance-move-constructor-init", + "-performance-no-*", + "-performance-no-automatic-move", + "-performance-no-int-to-ptr", + "-performance-noexcept-move-constructor", + "-performance-trivially-destructible", + "-performance-type-promotion-in-math-fn", + "-performance-unnecessary-*", + "-performance-unnecessary-copy-initialization", + "-performance-unnecessary-value-param", + "-portability-*", + "-portability-restrict-system-includes", + "-portability-simd-intrinsics", + "-readability-*", + "-readability-avoid-const-params-in-decls", + "-readability-braces-around-statements", + "-readability-const-return-type", + "-readability-container-size-empty", + "-readability-convert-member-functions-to-static", + "-readability-delete-null-pointer", + "-readability-deleted-default", + "-readability-else-after-return", + "-readability-function-*", + "-readability-function-cognitive-complexity", + "-readability-function-size", + "-readability-identifier-naming", + "-readability-implicit-bool-conversion", + "-readability-inconsistent-declaration-parameter-name", + "-readability-isolate-declaration", + "-readability-magic-numbers", + "-readability-make-member-function-const", + "-readability-misleading-indentation", + "-readability-misplaced-array-index", + "-readability-named-parameter", + "-readability-non-const-parameter", + "-readability-qualified-auto", + "-readability-redundant-*", + "-readability-redundant-access-specifiers", + "-readability-redundant-control-flow", + "-readability-redundant-declaration", + "-readability-redundant-function-ptr-dereference", + "-readability-redundant-member-init", + "-readability-redundant-preprocessor", + "-readability-redundant-smartptr-get", + "-readability-redundant-string-*", + "-readability-redundant-string-cstr", + "-readability-redundant-string-init", + "-readability-simplify-*", + "-readability-simplify-boolean-expr", + "-readability-simplify-subscript-expr", + "-readability-static-*", + "-readability-static-accessed-through-instance", + "-readability-static-definition-in-anonymous-namespace", + "-readability-string-compare", + "-readability-uniqueptr-delete-release", + "-readability-uppercase-literal-suffix", + "-readability-use-anyofallof", + "-zircon-temporary-objects" + ] + }, + "markdownDescription": "%c_cpp.configuration.clangTidy.checks.markdownDescription%", + "scope": "resource" }, "C_Cpp.formatting": { "type": "string", @@ -351,7 +1544,7 @@ "C_Cpp.vcFormat.indent.braces": { "type": "boolean", "default": false, - "description": "%c_cpp.configuration.vcFormat.indent.braces.description%", + "markdownDescription": "%c_cpp.configuration.vcFormat.indent.braces.markdownDescription%", "scope": "resource" }, "C_Cpp.vcFormat.indent.multiLineRelativeTo": { @@ -376,12 +1569,12 @@ "alignToParenthesis", "indent" ], - "enumDescriptions": [ - "%c_cpp.configuration.vcFormat.indent.withinParentheses.alignToParenthesis.description%", - "%c_cpp.configuration.vcFormat.indent.withinParentheses.indent.description%" + "markdownEnumDescriptions": [ + "%c_cpp.configuration.vcFormat.indent.withinParentheses.alignToParenthesis.markdownDescription%", + "%c_cpp.configuration.vcFormat.indent.withinParentheses.indent.markdownDescription%" ], "default": "indent", - "description": "%c_cpp.configuration.vcFormat.indent.withinParentheses.description%", + "markdownDescription": "%c_cpp.configuration.vcFormat.indent.withinParentheses.markdownDescription%", "scope": "resource" }, "C_Cpp.vcFormat.indent.preserveWithinParentheses": { @@ -393,25 +1586,25 @@ "C_Cpp.vcFormat.indent.caseLabels": { "type": "boolean", "default": false, - "description": "%c_cpp.configuration.vcFormat.indent.caseLabels.description%", + "markdownDescription": "%c_cpp.configuration.vcFormat.indent.caseLabels.markdownDescription%", "scope": "resource" }, "C_Cpp.vcFormat.indent.caseContents": { "type": "boolean", "default": true, - "description": "%c_cpp.configuration.vcFormat.indent.caseContents.description%", + "markdownDescription": "%c_cpp.configuration.vcFormat.indent.caseContents.markdownDescription%", "scope": "resource" }, "C_Cpp.vcFormat.indent.caseContentsWhenBlock": { "type": "boolean", "default": false, - "description": "%c_cpp.configuration.vcFormat.indent.caseContentsWhenBlock.description%", + "markdownDescription": "%c_cpp.configuration.vcFormat.indent.caseContentsWhenBlock.markdownDescription%", "scope": "resource" }, "C_Cpp.vcFormat.indent.lambdaBracesWhenParameter": { "type": "boolean", "default": true, - "description": "%c_cpp.configuration.vcFormat.indent.lambdaBracesWhenParameter.description%", + "markdownDescription": "%c_cpp.configuration.vcFormat.indent.lambdaBracesWhenParameter.markdownDescription%", "scope": "resource" }, "C_Cpp.vcFormat.indent.gotoLabels": { @@ -421,10 +1614,10 @@ "leftmostColumn", "none" ], - "enumDescriptions": [ - "%c_cpp.configuration.vcFormat.indent.gotoLabels.oneLeft.description%", - "%c_cpp.configuration.vcFormat.indent.gotoLabels.leftmostColumn.description%", - "%c_cpp.configuration.vcFormat.indent.gotoLabels.none.description%" + "markdownEnumDescriptions": [ + "%c_cpp.configuration.vcFormat.indent.gotoLabels.oneLeft.markdownDescription%", + "%c_cpp.configuration.vcFormat.indent.gotoLabels.leftmostColumn.markdownDescription%", + "%c_cpp.configuration.vcFormat.indent.gotoLabels.none.markdownDescription%" ], "default": "oneLeft", "description": "%c_cpp.configuration.vcFormat.indent.gotoLabels.description%", @@ -437,10 +1630,10 @@ "leftmostColumn", "none" ], - "enumDescriptions": [ - "%c_cpp.configuration.vcFormat.indent.preprocessor.oneLeft.description%", - "%c_cpp.configuration.vcFormat.indent.preprocessor.leftmostColumn.description%", - "%c_cpp.configuration.vcFormat.indent.preprocessor.none.description%" + "markdownEnumDescriptions": [ + "%c_cpp.configuration.vcFormat.indent.preprocessor.oneLeft.markdownDescription%", + "%c_cpp.configuration.vcFormat.indent.preprocessor.leftmostColumn.markdownDescription%", + "%c_cpp.configuration.vcFormat.indent.preprocessor.none.markdownDescription%" ], "default": "leftmostColumn", "description": "%c_cpp.configuration.vcFormat.indent.preprocessor.description%", @@ -449,13 +1642,13 @@ "C_Cpp.vcFormat.indent.accessSpecifiers": { "type": "boolean", "default": false, - "description": "%c_cpp.configuration.vcFormat.indent.accessSpecifiers.description%", + "markdownDescription": "%c_cpp.configuration.vcFormat.indent.accessSpecifiers.markdownDescription%", "scope": "resource" }, "C_Cpp.vcFormat.indent.namespaceContents": { "type": "boolean", "default": true, - "description": "%c_cpp.configuration.vcFormat.indent.namespaceContents.description%", + "markdownDescription": "%c_cpp.configuration.vcFormat.indent.namespaceContents.markdownDescription%", "scope": "resource" }, "C_Cpp.vcFormat.indent.preserveComments": { @@ -848,7 +2041,7 @@ "C_Cpp.clang_format_fallbackStyle": { "type": "string", "default": "Visual Studio", - "description": "%c_cpp.configuration.clang_format_fallbackStyle.description%", + "markdownDescription": "%c_cpp.configuration.clang_format_fallbackStyle.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.clang_format_sortIncludes": { @@ -874,6 +2067,11 @@ ], "default": "Default", "description": "%c_cpp.configuration.intelliSenseEngine.description%", + "enumDescriptions": [ + "%c_cpp.configuration.intelliSenseEngine.default.description%", + "%c_cpp.configuration.intelliSenseEngine.tagParser.description%", + "%c_cpp.configuration.intelliSenseEngine.disabled.description%" + ], "scope": "resource" }, "C_Cpp.intelliSenseEngineFallback": { @@ -893,7 +2091,11 @@ "Disabled" ], "default": "Default", - "description": "%c_cpp.configuration.autocomplete.description%", + "description": "%c_cpp.configuration.autocomplete.markdownDescription%", + "markdownEnumDescriptions": [ + "%c_cpp.configuration.autocomplete.default.description%", + "%c_cpp.configuration.autocomplete.disabled.description%" + ], "scope": "resource" }, "C_Cpp.errorSquiggles": { @@ -916,7 +2118,7 @@ "C_Cpp.inactiveRegionOpacity": { "type:": "number", "default": 0.55, - "description": "%c_cpp.configuration.inactiveRegionOpacity.description%", + "markdownDescription": "%c_cpp.configuration.inactiveRegionOpacity.markdownDescription%", "scope": "resource", "minimum": 0.1, "maximum": 1 @@ -941,13 +2143,13 @@ "Debug" ], "default": "Error", - "description": "%c_cpp.configuration.loggingLevel.description%", + "markdownDescription": "%c_cpp.configuration.loggingLevel.markdownDescription%", "scope": "window" }, "C_Cpp.autoAddFileAssociations": { "type": "boolean", "default": true, - "description": "%c_cpp.configuration.autoAddFileAssociations.description%", + "markdownDescription": "%c_cpp.configuration.autoAddFileAssociations.markdownDescription%", "scope": "window" }, "C_Cpp.workspaceParsingPriority": { @@ -959,7 +2161,7 @@ "low" ], "default": "highest", - "description": "%c_cpp.configuration.workspaceParsingPriority.description%", + "markdownDescription": "%c_cpp.configuration.workspaceParsingPriority.markdownDescription%", "scope": "window" }, "C_Cpp.workspaceSymbols": { @@ -979,7 +2181,11 @@ "checkFilesAndFolders" ], "default": "checkFolders", - "description": "%c_cpp.configuration.exclusionPolicy.description%", + "markdownDescription": "%c_cpp.configuration.exclusionPolicy.markdownDescription%", + "enumDescriptions": [ + "%c_cpp.configuration.exclusionPolicy.checkFolders.description%", + "%c_cpp.configuration.exclusionPolicy.checkFilesAndFolders.description%" + ], "scope": "resource" }, "C_Cpp.preferredPathSeparator": { @@ -995,7 +2201,7 @@ "C_Cpp.simplifyStructuredComments": { "type": "boolean", "default": true, - "description": "%c_cpp.configuration.simplifyStructuredComments.description%", + "markdownDescription": "%c_cpp.configuration.simplifyStructuredComments.markdownDescription%", "scope": "application" }, "C_Cpp.commentContinuationPatterns": { @@ -1039,7 +2245,7 @@ }, "C_Cpp.intelliSenseCachePath": { "type": "string", - "description": "%c_cpp.configuration.intelliSenseCachePath.description%", + "markdownDescription": "%c_cpp.configuration.intelliSenseCachePath.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.intelliSenseCacheSize": { @@ -1066,62 +2272,46 @@ "maximum": 3000 }, "C_Cpp.default.includePath": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "type": "string" }, - "default": null, - "description": "%c_cpp.configuration.default.includePath.description%", + "markdownDescription": "%c_cpp.configuration.default.includePath.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.default.defines": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "type": "string" }, - "default": null, - "description": "%c_cpp.configuration.default.defines.description%", + "markdownDescription": "%c_cpp.configuration.default.defines.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.default.macFrameworkPath": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "type": "string" }, - "default": null, - "description": "%c_cpp.configuration.default.macFrameworkPath.description%", + "markdownDescription": "%c_cpp.configuration.default.macFrameworkPath.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.default.windowsSdkVersion": { "type": "string", - "description": "%c_cpp.configuration.default.windowsSdkVersion.description%", + "markdownDescription": "%c_cpp.configuration.default.windowsSdkVersion.markdownDescription%", "pattern": "^((\\d{2}\\.\\d{1}\\.\\d{5}\\.\\d{1}$|^8\\.1)|())$", "scope": "machine-overridable" }, "C_Cpp.default.compileCommands": { "type": "string", - "description": "%c_cpp.configuration.default.compileCommands.description%", + "markdownDescription": "%c_cpp.configuration.default.compileCommands.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.default.forcedInclude": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "type": "string" }, - "default": null, - "description": "%c_cpp.configuration.default.forcedInclude.description%", + "markdownDescription": "%c_cpp.configuration.default.forcedInclude.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.default.intelliSenseMode": { @@ -1169,28 +2359,20 @@ "msvc-arm", "msvc-arm64" ], - "description": "%c_cpp.configuration.default.intelliSenseMode.description%", + "markdownDescription": "%c_cpp.configuration.default.intelliSenseMode.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.default.compilerPath": { - "type": [ - "string", - "null" - ], - "default": null, - "description": "%c_cpp.configuration.default.compilerPath.description%", + "type": "string", + "markdownDescription": "%c_cpp.configuration.default.compilerPath.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.default.compilerArgs": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "type": "string" }, - "default": null, - "description": "%c_cpp.configuration.default.compilerArgs.description%", + "markdownDescription": "%c_cpp.configuration.default.compilerArgs.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.default.cStandard": { @@ -1206,7 +2388,7 @@ "gnu11", "gnu17" ], - "description": "%c_cpp.configuration.default.cStandard.description%", + "markdownDescription": "%c_cpp.configuration.default.cStandard.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.default.cppStandard": { @@ -1226,47 +2408,39 @@ "gnu++17", "gnu++20" ], - "description": "%c_cpp.configuration.default.cppStandard.description%", + "markdownDescription": "%c_cpp.configuration.default.cppStandard.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.default.configurationProvider": { "type": "string", - "description": "%c_cpp.configuration.default.configurationProvider.description%", + "markdownDescription": "%c_cpp.configuration.default.configurationProvider.markdownDescription%", "scope": "resource" }, "C_Cpp.default.browse.path": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "type": "string" }, - "default": null, - "description": "%c_cpp.configuration.default.browse.path.description%", + "markdownDescription": "%c_cpp.configuration.default.browse.path.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.default.browse.databaseFilename": { "type": "string", - "description": "%c_cpp.configuration.default.browse.databaseFilename.description%", + "markdownDescription": "%c_cpp.configuration.default.browse.databaseFilename.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.default.browse.limitSymbolsToIncludedHeaders": { "type": "boolean", "default": true, - "description": "%c_cpp.configuration.default.browse.limitSymbolsToIncludedHeaders.description%", + "markdownDescription": "%c_cpp.configuration.default.browse.limitSymbolsToIncludedHeaders.markdownDescription%", "scope": "resource" }, "C_Cpp.default.systemIncludePath": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "type": "string" }, - "default": null, - "description": "%c_cpp.configuration.default.systemIncludePath.description%", + "markdownDescription": "%c_cpp.configuration.default.systemIncludePath.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.default.customConfigurationVariables": { @@ -1280,13 +2454,13 @@ "type": "string" } }, - "description": "%c_cpp.configuration.default.customConfigurationVariables.description%", + "markdownDescription": "%c_cpp.configuration.default.customConfigurationVariables.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.default.enableConfigurationSquiggles": { "type": "boolean", "default": true, - "description": "%c_cpp.configuration.default.enableConfigurationSquiggles.description%", + "markdownDescription": "%c_cpp.configuration.default.enableConfigurationSquiggles.markdownDescription%", "scope": "resource" }, "C_Cpp.updateChannel": { @@ -1296,7 +2470,7 @@ "Insiders" ], "default": "Default", - "description": "%c_cpp.configuration.updateChannel.description%", + "markdownDescription": "%c_cpp.configuration.updateChannel.markdownDescription%", "scope": "application" }, "C_Cpp.experimentalFeatures": { @@ -1312,7 +2486,7 @@ "C_Cpp.suggestSnippets": { "type": "boolean", "default": true, - "description": "%c_cpp.configuration.suggestSnippets.description%", + "markdownDescription": "%c_cpp.configuration.suggestSnippets.markdownDescription%", "scope": "resource" }, "C_Cpp.enhancedColorization": { @@ -1322,7 +2496,7 @@ "Disabled" ], "default": "Enabled", - "description": "%c_cpp.configuration.enhancedColorization.description%", + "markdownDescription": "%c_cpp.configuration.enhancedColorization.markdownDescription%", "scope": "window" }, "C_Cpp.vcpkg.enabled": { @@ -1334,19 +2508,19 @@ "C_Cpp.addNodeAddonIncludePaths": { "type": "boolean", "default": false, - "markdownDescription": "%c_cpp.configuration.addNodeAddonIncludePaths.description%", + "markdownDescription": "%c_cpp.configuration.addNodeAddonIncludePaths.markdownDescription%", "scope": "application" }, "C_Cpp.renameRequiresIdentifier": { "type": "boolean", "default": true, - "description": "%c_cpp.configuration.renameRequiresIdentifier.description%", + "markdownDescription": "%c_cpp.configuration.renameRequiresIdentifier.markdownDescription%", "scope": "application" }, "C_Cpp.debugger.useBacktickCommandSubstitution": { "type": "boolean", "default": false, - "description": "%c_cpp.configuration.debugger.useBacktickCommandSubstitution.description%", + "markdownDescription": "%c_cpp.configuration.debugger.useBacktickCommandSubstitution.markdownDescription%", "scope": "window" }, "C_Cpp.codeFolding": { @@ -1362,12 +2536,12 @@ "C_Cpp.autocompleteAddParentheses": { "type": "boolean", "default": false, - "description": "%c_cpp.configuration.autocompleteAddParentheses.description%", + "markdownDescription": "%c_cpp.configuration.autocompleteAddParentheses.markdownDescription%", "scope": "resource" }, "C_Cpp.files.exclude": { "type": "object", - "markdownDescription": "%c_cpp.configuration.filesExclude.description%", + "markdownDescription": "%c_cpp.configuration.filesExclude.markdownDescription%", "default": { "**/.vscode": true }, @@ -1375,7 +2549,7 @@ "anyOf": [ { "type": "boolean", - "description": "%c_cpp.configuration.filesExcludeBoolean.description%" + "markdownDescription": "%c_cpp.configuration.filesExcludeBoolean.markdownDescription%" }, { "type": "object", @@ -1384,7 +2558,7 @@ "type": "string", "pattern": "\\w*\\$\\(basename\\)\\w*", "default": "$(basename).ext", - "description": "%c_cpp.configuration.filesExcludeWhen.description%" + "markdownDescription": "%c_cpp.configuration.filesExcludeWhen.markdownDescription%" } } } diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 1e294c6e16..583555393e 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -24,39 +24,40 @@ "c_cpp.command.RunClangTidyOnActiveFile.title": "Run clang-tidy on the active file.", "c_cpp.command.RunClangTidyOnOpenFiles.title": "Run clang-tidy on all open files.", "c_cpp.command.RunClangTidyOnAllFiles.title": "Run clang-tidy on all source files.", - "c_cpp.configuration.maxThreads.description": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may be exceedeed in some cases. The default of \"null\" uses the number of logical processors available.", - "c_cpp.configuration.maxMemory.description": "The maximum memory available for the extension. Fewer processes will run concurrently after this memory limit is exceeded. The default of \"null\" uses the system's free physical memory.", - "c_cpp.configuration.intelliSense.maxThreads.description": "The maximum number of concurrent threads to use for IntelliSense processing. The default of \"null\" uses the value inherited from \"C_Cpp.maxThreads\".", - "c_cpp.configuration.references.maxThreads.description": "The maximum number of concurrent threads to use for find all references and rename. The default of \"null\" uses the value inherited from \"C_Cpp.maxThreads\".", - "c_cpp.configuration.intelliSense.maxMemory.description": "Older IntelliSense processes will shutdown before new processes are created after this memory limit is exceeded.", + "c_cpp.configuration.maxThreads.markdownDescription": "The maximum number of concurrent threads to use for language service processing. The default of `null` uses the number of logical processors available.", + "c_cpp.configuration.maxMemory.markdownDescription": "The maximum memory (in MB) available for language service processing. Fewer processes will run concurrently after this memory usage is exceeded. The default of `null` uses the system's free memory.", + "c_cpp.configuration.intelliSense.maxThreads.markdownDescription": "The maximum number of concurrent threads to use for IntelliSense processing. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", + "c_cpp.configuration.intelliSense.maxMemory.markdownDescription": "Older IntelliSense processes will shutdown before new processes are created after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", + "c_cpp.configuration.references.maxThreads.markdownDescription": "The maximum number of concurrent threads to use for find all references and rename. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", + "c_cpp.configuration.references.maxMemory.markdownDescription": "Fewer find all references and rename processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "c_cpp.configuration.formatting.description": "Configures the formatting engine", "c_cpp.configuration.formatting.clangFormat.description": "clang-format will be used to format code.", "c_cpp.configuration.formatting.vcFormat.description": "The Visual C++ formatting engine will be used to format code.", "c_cpp.configuration.formatting.Default.description": "clang-format will be used to format code.", "c_cpp.configuration.formatting.Disabled.description": "Code formatting will be disabled.", - "c_cpp.configuration.vcFormat.indent.braces.description": "Braces are indented by the amount specified in the Editor: Tab Size setting.", - "c_cpp.configuration.vcFormat.indent.multiLineRelativeTo.description": "Determines what new line indentation is relative to", + "c_cpp.configuration.vcFormat.indent.braces.markdownDescription": "Braces are indented by the amount specified in the `#editor.tabSize#` setting.", + "c_cpp.configuration.vcFormat.indent.multiLineRelativeTo.description": "Determines what new line indentation is relative to.", "c_cpp.configuration.vcFormat.indent.multiLineRelativeTo.outermostParenthesis.description": "Indent new line relative to the outermost open parenthesis.", "c_cpp.configuration.vcFormat.indent.multiLineRelativeTo.innermostParenthesis.description": "Indent new line relative to the innermost open parenthesis.", "c_cpp.configuration.vcFormat.indent.multiLineRelativeTo.statementBegin.description": "Indent new line relative to the beginning of the current statement.", - "c_cpp.configuration.vcFormat.indent.withinParentheses.description": "When a new line is typed, it is aligned under the opening parenthesis or based on \"C_Cpp.vcFormat.indent.multiLineRelativeTo\".", - "c_cpp.configuration.vcFormat.indent.withinParentheses.alignToParenthesis.description": "New line is aligned under the opening parenthesis.", - "c_cpp.configuration.vcFormat.indent.withinParentheses.indent.description": "New line is indented based on \"C_Cpp.vcFormat.indent.multiLineRelativeTo\".", + "c_cpp.configuration.vcFormat.indent.withinParentheses.markdownDescription": "When a new line is typed, it is aligned under the opening parenthesis or based on `#C_Cpp.vcFormat.indent.multiLineRelativeTo#`.", + "c_cpp.configuration.vcFormat.indent.withinParentheses.alignToParenthesis.markdownDescription": "New line is aligned under the opening parenthesis.", + "c_cpp.configuration.vcFormat.indent.withinParentheses.indent.markdownDescription": "New line is indented based on `#C_Cpp.vcFormat.indent.multiLineRelativeTo#`.", "c_cpp.configuration.vcFormat.indent.preserveWithinParentheses.description": "In existing code, preserve the existing indent alignment of new lines within parentheses.", - "c_cpp.configuration.vcFormat.indent.caseLabels.description": "Labels are indented relative to switch statements by the amount specified in the Editor: Tab Size setting.", - "c_cpp.configuration.vcFormat.indent.caseContents.description": "Code inside case block is indented relative to its label by the amount specified in the Editor: Tab Size setting", - "c_cpp.configuration.vcFormat.indent.caseContentsWhenBlock.description": "Indent braces following a case statement by the amount specified in the Editor: Tab Size setting", - "c_cpp.configuration.vcFormat.indent.lambdaBracesWhenParameter.description": "Indent braces of lambdas used as function parameters relative to the start of the statement by the amount specified in the Editor: Tab Size setting", + "c_cpp.configuration.vcFormat.indent.caseLabels.markdownDescription": "Labels are indented relative to switch statements by the amount specified in the `#editor.tabSize#` setting.", + "c_cpp.configuration.vcFormat.indent.caseContents.markdownDescription": "Code inside case block is indented relative to its label by the amount specified in the `#editor.tabSize#` setting", + "c_cpp.configuration.vcFormat.indent.caseContentsWhenBlock.markdownDescription": "Indent braces following a case statement by the amount specified in the `#editor.tabSize#` setting", + "c_cpp.configuration.vcFormat.indent.lambdaBracesWhenParameter.markdownDescription": "Indent braces of lambdas used as function parameters relative to the start of the statement by the amount specified in the `#editor.tabSize#` setting", "c_cpp.configuration.vcFormat.indent.gotoLabels.description": "The position of goto labels", - "c_cpp.configuration.vcFormat.indent.gotoLabels.oneLeft.description": "Position goto labels to the left of the current code indentation, by the amount specified in the Editor: Tab Size setting", - "c_cpp.configuration.vcFormat.indent.gotoLabels.leftmostColumn.description": "Position goto labels at the leftmost edge of the code.", - "c_cpp.configuration.vcFormat.indent.gotoLabels.none.description": "Goto labels will not be formatted.", + "c_cpp.configuration.vcFormat.indent.gotoLabels.oneLeft.markdownDescription": "Position goto labels to the left of the current code indentation, by the amount specified in the `#editor.tabSize#` setting", + "c_cpp.configuration.vcFormat.indent.gotoLabels.leftmostColumn.markdownDescription": "Position goto labels at the leftmost edge of the code.", + "c_cpp.configuration.vcFormat.indent.gotoLabels.none.markdownDescription": "Goto labels will not be formatted.", "c_cpp.configuration.vcFormat.indent.preprocessor.description": "The position of preprocessor directives", - "c_cpp.configuration.vcFormat.indent.preprocessor.oneLeft.description": "Preprocessor directives are positioned to the left of the current code indentation, by the amount specified in the Editor: Tab Size setting", - "c_cpp.configuration.vcFormat.indent.preprocessor.leftmostColumn.description": "Preprocessor directives are positioned at the leftmost edge of the code.", - "c_cpp.configuration.vcFormat.indent.preprocessor.none.description": "Preprocessor directives will not be formatted.", - "c_cpp.configuration.vcFormat.indent.accessSpecifiers.description": "Access specifiers are indented relative to class or struct definitions by the amount specified in the Editor: Tab Size setting", - "c_cpp.configuration.vcFormat.indent.namespaceContents.description": "Code is indented relative to its enclosing namespace by the amount specified in the Editor: Tab Size setting", + "c_cpp.configuration.vcFormat.indent.preprocessor.oneLeft.markdownDescription": "Preprocessor directives are positioned to the left of the current code indentation, by the amount specified in the `#editor.tabSize#` setting", + "c_cpp.configuration.vcFormat.indent.preprocessor.leftmostColumn.markdownDescription": "Preprocessor directives are positioned at the leftmost edge of the code.", + "c_cpp.configuration.vcFormat.indent.preprocessor.none.markdownDescription": "Preprocessor directives will not be formatted.", + "c_cpp.configuration.vcFormat.indent.accessSpecifiers.markdownDescription": "Access specifiers are indented relative to class or struct definitions by the amount specified in the `#editor.tabSize#` setting", + "c_cpp.configuration.vcFormat.indent.namespaceContents.markdownDescription": "Code is indented relative to its enclosing namespace by the amount specified in the `#editor.tabSize#` setting", "c_cpp.configuration.vcFormat.indent.preserveComments.description": "Indentation of comments is not changed during formatting operations.", "c_cpp.configuration.vcFormat.newLine.beforeOpenBrace.namespace.description": "The position of opening braces for namespaces", "c_cpp.configuration.vcFormat.newLine.beforeOpenBrace.type.description": "The position of opening braces for type definitions", @@ -119,70 +120,87 @@ "c_cpp.configuration.vcFormat.wrap.preserveBlocks.oneLiners.description": "A complete code block that is entered on one line is kept on one line, regardless of the values of any of the VC Format: New Line settings", "c_cpp.configuration.vcFormat.wrap.preserveBlocks.allOneLineScopes.description": "Any code where the opening and closing brace is entered on one line is kept on one line, regardless of the values of any of the VC Format: New Line settings", "c_cpp.configuration.vcFormat.wrap.preserveBlocks.never.description": "Code blocks are always formatted based on the values of the VC Format: New Line settings", - "c_cpp.configuration.clang_format_path.description": "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, a copy of clang-format bundled with the extension will be used.", - "c_cpp.configuration.clang_format_style.description": "Coding style, currently supports: Visual Studio, LLVM, Google, Chromium, Mozilla, WebKit. Use \"file\" to load the style from a .clang-format file in the current or parent directory. Use {key: value, ...} to set specific parameters. For example, the \"Visual Studio\" style is similar to: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }", - "c_cpp.configuration.clang_format_fallbackStyle.description": "Name of the predefined style used as a fallback in case clang-format is invoked with style \"file\" but the .clang-format file is not found. Possible values are Visual Studio, LLVM, Google, Chromium, Mozilla, WebKit, none, or use {key: value, ...} to set specific parameters. For example, the \"Visual Studio\" style is similar to: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }", + "c_cpp.configuration.clang_format_path.description": "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.", + "c_cpp.configuration.clang_format_style.markdownDescription": "Coding style, currently supports: `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`. Use `file` to load the style from a `.clang-format` file in the current or parent directory. Use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", + "c_cpp.configuration.clang_format_fallbackStyle.markdownDescription": "Name of the predefined style used as a fallback in case clang-format is invoked with style `file` but the `.clang-format` file is not found. Possible values are `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `none`, or use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", "c_cpp.configuration.clang_format_sortIncludes.description": "If set, overrides the include sorting behavior determined by the SortIncludes parameter.", - "c_cpp.configuration.clangTidy.path.description": "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, a copy of clang-tidy bundled with the extension will be used.", - "c_cpp.configuration.clangTidy.exclude.description": "Configure glob patterns for excluding folders and files for clang-tidy. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", + "c_cpp.configuration.clangTidy.maxThreads.markdownDescription": "The maximum number of theads to use for clang-tidy processing. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", + "c_cpp.configuration.clangTidy.maxMemory.markdownDescription": "Fewer clang-tidy processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", + "c_cpp.configuration.clangTidy.path.description": "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.", + "c_cpp.configuration.clangTidy.exclude.markdownDescription": "Configure glob patterns for excluding folders and files for clang-tidy. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "c_cpp.configuration.clangTidy.excludeBoolean.description": "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.", - "c_cpp.configuration.clangTidy.excludeWhen.description": "Additional check on the siblings of a matching file. Use $(basename) as variable for the matching file name.", - "c_cpp.configuration.clangTidy.maxThreads.description": "The maximum number of theads to use for clang-tidy processing. The default of \"null\" uses the value inherited from \"C_Cpp.maxThreads\".", - "c_cpp.configuration.intelliSenseEngine.description": "Controls the IntelliSense provider. \"Tag Parser\" provides \"fuzzy\" results that are not context-aware. \"Default\" provides context-aware results. \"Disabled\" turns off C/C++ language service features.", + "c_cpp.configuration.clangTidy.excludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", + "c_cpp.configuration.clangTidy.runInBackground.markdownDescription": "If `true`, clang-tidy will run automatically in the background.", + "c_cpp.configuration.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for clang-tidy. If not specified, the build configuration from IntelliSense will be used.", + "c_cpp.configuration.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file, if any.", + "c_cpp.configuration.clangTidy.config.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format: `{Checks: '*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, clang-tidy will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", + "c_cpp.configuration.clangTidy.fix.description": "Determines when clang-tidy fixes should be automatically applied", + "c_cpp.configuration.clangTidy.fix.disabled.description": "Don't automatically apply clang-tidy fixes.", + "c_cpp.configuration.clangTidy.fix.fixIfNoError.description": "Automatically apply clang-tidy fixes if no errors occur.", + "c_cpp.configuration.clangTidy.fix.fixError.description": "Automatically apply clang-tidy fixes, even if errors occur.", + "c_cpp.configuration.clangTidy.args.markdownDescription": "Additional command line arguments to pass to clang-tidy. These take precedence over the equivalent `C_Cpp.clangTidy.*` settings.", + "c_cpp.configuration.intelliSenseEngine.description": "Controls the IntelliSense provider.", + "c_cpp.configuration.intelliSenseEngine.default.description": "Provides context-aware results via a separate IntelliSense process.", + "c_cpp.configuration.intelliSenseEngine.tagParser.description": "Provides \"fuzzy\" results that are not context-aware.", + "c_cpp.configuration.intelliSenseEngine.disabled.description": "Turns off C/C++ language service features.", "c_cpp.configuration.intelliSenseEngineFallback.description": "Controls whether the IntelliSense engine will automatically switch to the Tag Parser for translation units containing #include errors.", - "c_cpp.configuration.autocomplete.description": "Controls the auto-completion provider. \"Default\" uses the active IntelliSense engine. \"Disabled\" uses the word-based completion provided by Visual Studio Code.", + "c_cpp.configuration.autocomplete.markdownDescription": "Controls the auto-completion provider. If `Disabled` and you want word-based completion, you will also need to set `\"[cpp]\": {\"editor.wordBasedSuggestions\": false}, \"[c]\": {\"editor.wordBasedSuggestions\": false}, \"[cuda-cpp]\": {\"editor.wordBasedSuggestions\": false}`", + "c_cpp.configuration.autocomplete.default.description": "Uses the active IntelliSense engine.", + "c_cpp.configuration.autocomplete.disabled.description": "Uses the word-based completion provided by Visual Studio Code.", "c_cpp.configuration.errorSquiggles.description": "Controls whether suspected compile errors detected by the IntelliSense engine will be reported back to the editor. This setting is ignored by the Tag Parser engine.", "c_cpp.configuration.dimInactiveRegions.description": "Controls whether inactive preprocessor blocks are colored differently than active code. This setting has no effect if IntelliSense is disabled or if using the Default High Contrast theme.", - "c_cpp.configuration.inactiveRegionOpacity.description": "Controls the opacity of inactive preprocessor blocks. Scales between 0.1 and 1.0. This setting only applies when inactive region dimming is enabled.", + "c_cpp.configuration.inactiveRegionOpacity.markdownDescription": "Controls the opacity of inactive preprocessor blocks. Scales between `0.1` and `1.0`. This setting only applies when inactive region dimming is enabled.", "c_cpp.configuration.inactiveRegionForegroundColor.description": "Controls the font coloring of inactive preprocessor blocks. Input is in the form a hexadecimal color code or a valid Theme Color. If not set, this defaults to the syntax coloring scheme of the editor. This setting only applies when inactive region dimming is enabled.", "c_cpp.configuration.inactiveRegionBackgroundColor.description": "Controls the background coloring of inactive preprocessor blocks. Input is in the form a hexadecimal color code or a valid Theme Color. If not set, this defaults to transparent. This setting only applies when inactive region dimming is enabled.", - "c_cpp.configuration.loggingLevel.description": "The verbosity of logging in the Output Panel. The order of levels from least verbose to most verbose is: None < Error < Warning < Information < Debug.", - "c_cpp.configuration.autoAddFileAssociations.description": "Controls whether files are automatically added to files.associations when they are the target of a navigation operation from a C/C++ file.", - "c_cpp.configuration.workspaceParsingPriority.description": "Controls whether parsing of the non-active workspace files uses sleeps to avoid using 100% CPU. The values highest/high/medium/low correspond to approximately 100/75/50/25% CPU usage.", + "c_cpp.configuration.loggingLevel.markdownDescription": "The verbosity of logging in the Output Panel. The order of levels from least verbose to most verbose is: `None` < `Error` < `Warning` < `Information` < `Debug`.", + "c_cpp.configuration.autoAddFileAssociations.markdownDescription": "Controls whether files are automatically added to `#files.associations#` when they are the target of a navigation operation from a C/C++ file.", + "c_cpp.configuration.workspaceParsingPriority.markdownDescription": "Controls whether parsing of the non-active workspace files uses sleeps to avoid using 100% CPU. The values `highest`/`high`/`medium`/`low` correspond to approximately 100/75/50/25% CPU usage.", "c_cpp.configuration.workspaceSymbols.description": "The symbols to include in the query results when 'Go to Symbol in Workspace' is invoked.", - "c_cpp.configuration.exclusionPolicy.description": "Instructs the extension when to use the \"files.exclude\" setting when determining which files should be added to the code navigation database while traversing through the paths in the \"browse.path\" array. \"checkFolders\" means that the exclusion filters will only be evaluated once per folder (individual files are not checked). \"checkFilesAndFolders\" means that the exclusion filters will be evaluated against every file and folder encountered. If your \"files.exclude\" setting only contains folders, then \"checkFolders\" is the best choice and will increase the speed at which the extension can initialize the code navigation database.", + "c_cpp.configuration.exclusionPolicy.markdownDescription": "Instructs the extension when to use the `#files.exclude#` setting when determining which files should be added to the code navigation database while traversing through the paths in the `browse.path` array. If your `#files.exclude#` setting only contains folders, then `checkFolders` is the best choice and will increase the speed at which the extension can initialize the code navigation database.", + "c_cpp.configuration.exclusionPolicy.checkFolders.description": "The exclusion filters will only be evaluated once per folder (individual files are not checked).", + "c_cpp.configuration.exclusionPolicy.checkFilesAndFolders.description": "The exclusion filters will be evaluated against every file and folder encountered.", "c_cpp.configuration.preferredPathSeparator.description": "The character used as a path separator for #include auto-completion results.", - "c_cpp.configuration.simplifyStructuredComments.description": "If true, tooltips of hover and auto-complete will only display certain labels of structured comments. Otherwise, all comments are displayed.", + "c_cpp.configuration.simplifyStructuredComments.markdownDescription": "If `true`, tooltips of hover and auto-complete will only display certain labels of structured comments. Otherwise, all comments are displayed.", "c_cpp.configuration.commentContinuationPatterns.items.anyof.string.description": "The pattern that begins a multiline or single line comment block. The continuation pattern defaults to ' * ' for multiline comment blocks or this string for single line comment blocks.", "c_cpp.configuration.commentContinuationPatterns.items.anyof.object.begin.description": "The pattern that begins a multiline or single line comment block.", "c_cpp.configuration.commentContinuationPatterns.items.anyof.object.continue.description": "The text that will be inserted on the next line when Enter is pressed inside a multiline or single line comment block.", "c_cpp.configuration.commentContinuationPatterns.description": "Defines the editor behavior for when the Enter key is pressed inside a multiline or single line comment block.", "c_cpp.configuration.configurationWarnings.description": "Determines whether pop up notifications will be shown when a configuration provider extension is unable to provide a configuration for a source file.", - "c_cpp.configuration.intelliSenseCachePath.description": "Defines the folder path for cached precompiled headers used by IntelliSense. The default cache path is \"%LocalAppData%/Microsoft/vscode-cpptools\" on Windows, \"$XDG_CACHE_HOME/vscode-cpptools/\" on Linux (or \"$HOME/.cache/vscode-cpptools/\" if XDG_CACHE_HOME is not defined), and \"$HOME/Library/Caches/vscode-cpptools/\" on Mac. The default path will be used if no path is specified or if a specified path is invalid.", + "c_cpp.configuration.intelliSenseCachePath.markdownDescription": "Defines the folder path for cached precompiled headers used by IntelliSense. The default cache path is `%LocalAppData%/Microsoft/vscode-cpptools` on Windows, `$XDG_CACHE_HOME/vscode-cpptools/` on Linux (or `$HOME/.cache/vscode-cpptools/` if `XDG_CACHE_HOME` is not defined), and `$HOME/Library/Caches/vscode-cpptools/` on macOS. The default path will be used if no path is specified or if a specified path is invalid.", "c_cpp.configuration.intelliSenseCacheSize.description": "Maximum size of the per-workspace hard drive space in megabytes (MB) for cached precompiled headers; the actual usage may fluctuate around this value. The default size is 5120 MB. Precompiled header caching is disabled when the size is 0.", "c_cpp.configuration.intelliSenseMemoryLimit.description": "Memory usage limit in megabytes (MB) of an IntelliSense process. The default limit is 4096 MB and the maximum limit is 16 GB. The extension will shutdown and restart an IntelliSense process when it exceeds the limit.", "c_cpp.configuration.intelliSenseUpdateDelay.description": "Controls the delay in milliseconds before IntelliSense starts updating after a modification.", - "c_cpp.configuration.default.includePath.description": "The value to use in a configuration if \"includePath\" is not specified in c_cpp_properties.json. If \"includePath\" is specified, add \"${default}\" to the array to insert the values from this setting.", - "c_cpp.configuration.default.defines.description": "The value to use in a configuration if \"defines\" is not specified, or the values to insert if \"${default}\" is present in \"defines\".", - "c_cpp.configuration.default.macFrameworkPath.description": "The value to use in a configuration if \"macFrameworkPath\" is not specified, or the values to insert if \"${default}\" is present in \"macFrameworkPath\".", - "c_cpp.configuration.default.windowsSdkVersion.description": "Version of the Windows SDK include path to use on Windows, e.g. '10.0.17134.0'.", - "c_cpp.configuration.default.compileCommands.description": "The value to use in a configuration if \"compileCommands\" is either not specified, or set to \"${default}\".", - "c_cpp.configuration.default.forcedInclude.description": "The value to use in a configuration if \"forcedInclude\" is not specified, or the values to insert if \"${default}\" is present in \"forcedInclude\".", - "c_cpp.configuration.default.intelliSenseMode.description": "The value to use in a configuration if \"intelliSenseMode\" is either not specified or set to \"${default}\".", - "c_cpp.configuration.default.compilerPath.description": "The value to use in a configuration if \"compilerPath\" is either not specified or set to \"${default}\".", - "c_cpp.configuration.default.compilerArgs.description": "The value to use in configuration if \"compilerArgs\" is either not specified or set to \"${default}\".", - "c_cpp.configuration.default.cStandard.description": "The value to use in a configuration if \"cStandard\" is either not specified or set to \"${default}\".", - "c_cpp.configuration.default.cppStandard.description": "The value to use in a configuration if \"cppStandard\" is either not specified or set to \"${default}\".", - "c_cpp.configuration.default.configurationProvider.description": "The value to use in a configuration if \"configurationProvider\" is either not specified or set to \"${default}\".", - "c_cpp.configuration.default.browse.path.description": "The value to use in a configuration if \"browse.path\" is not specified, or the values to insert if \"${default}\" is present in \"browse.path\".", - "c_cpp.configuration.default.browse.databaseFilename.description": "The value to use in a configuration if \"browse.databaseFilename\" is either not specified or set to \"${default}\".", - "c_cpp.configuration.default.browse.limitSymbolsToIncludedHeaders.description": "The value to use in a configuration if \"browse.limitSymbolsToIncludedHeaders\" is either not specified or set to \"${default}\".", - "c_cpp.configuration.default.systemIncludePath.description": "The value to use for the system include path. If set, it overrides the system include path acquired via \"compilerPath\" and \"compileCommands\" settings.", - "c_cpp.configuration.default.enableConfigurationSquiggles.description": "Controls whether the extension will report errors detected in c_cpp_properties.json.", - "c_cpp.configuration.default.customConfigurationVariables.description": "The value to use in a configuration if \"customConfigurationVariables\" is not set, or the values to insert if \"${default}\" is present as a key in \"customConfigurationVariables\".", - "c_cpp.configuration.updateChannel.description": "Set to \"Insiders\" to automatically download and install the latest Insiders builds of the extension, which include upcoming features and bug fixes.", + "c_cpp.configuration.default.includePath.markdownDescription": "The value to use in a configuration if `includePath` is not specified in `c_cpp_properties.json`. If `includePath` is specified, add `${default}` to the array to insert the values from this setting.", + "c_cpp.configuration.default.defines.markdownDescription": "The value to use in a configuration if `defines` is not specified, or the values to insert if `${default}` is present in `defines`.", + "c_cpp.configuration.default.macFrameworkPath.markdownDescription": "The value to use in a configuration if `macFrameworkPath` is not specified, or the values to insert if `${default}` is present in `macFrameworkPath`.", + "c_cpp.configuration.default.windowsSdkVersion.markdownDescription": "Version of the Windows SDK include path to use on Windows, e.g. `10.0.17134.0`.", + "c_cpp.configuration.default.compileCommands.markdownDescription": "The value to use in a configuration if `compileCommands` is either not specified, or set to `${default}`.", + "c_cpp.configuration.default.forcedInclude.markdownDescription": "The value to use in a configuration if `forcedInclude` is not specified, or the values to insert if `${default}` is present in `forcedInclude`.", + "c_cpp.configuration.default.intelliSenseMode.markdownDescription": "The value to use in a configuration if `intelliSenseMode` is either not specified or set to `${default}`.", + "c_cpp.configuration.default.compilerPath.markdownDescription": "The value to use in a configuration if `compilerPath` is either not specified or set to `${default}`.", + "c_cpp.configuration.default.compilerArgs.markdownDescription": "The value to use in configuration if `compilerArgs` is either not specified or set to `${default}`.", + "c_cpp.configuration.default.cStandard.markdownDescription": "The value to use in a configuration if `cStandard` is either not specified or set to `${default}`.", + "c_cpp.configuration.default.cppStandard.markdownDescription": "The value to use in a configuration if `cppStandard` is either not specified or set to `${default}`.", + "c_cpp.configuration.default.configurationProvider.markdownDescription": "The value to use in a configuration if `configurationProvider` is either not specified or set to `${default}`.", + "c_cpp.configuration.default.browse.path.markdownDescription": "The value to use in a configuration if `browse.path` is not specified, or the values to insert if `${default}` is present in `browse.path`.", + "c_cpp.configuration.default.browse.databaseFilename.markdownDescription": "The value to use in a configuration if `browse.databaseFilename` is either not specified or set to `${default}`.", + "c_cpp.configuration.default.browse.limitSymbolsToIncludedHeaders.markdownDescription": "The value to use in a configuration if `browse.limitSymbolsToIncludedHeaders` is either not specified or set to `${default}`.", + "c_cpp.configuration.default.systemIncludePath.markdownDescription": "The value to use for the system include path. If set, it overrides the system include path acquired via `compilerPath` and `compileCommands` settings.", + "c_cpp.configuration.default.enableConfigurationSquiggles.markdownDescription": "Controls whether the extension will report errors detected in `c_cpp_properties.json`.", + "c_cpp.configuration.default.customConfigurationVariables.markdownDescription": "The value to use in a configuration if `customConfigurationVariables` is not set, or the values to insert if `${default}` is present as a key in `customConfigurationVariables`.", + "c_cpp.configuration.updateChannel.markdownDescription": "Set to `Insiders` to automatically download and install the latest Insiders builds of the extension, which include upcoming features and bug fixes.", "c_cpp.configuration.experimentalFeatures.description": "Controls whether \"experimental\" features are usable.", - "c_cpp.configuration.suggestSnippets.description": "If true, snippets are provided by the language server.", - "c_cpp.configuration.enhancedColorization.description": "If enabled, code is colorized based on IntelliSense. This setting only applies if intelliSenseEngine is set to \"Default\".", + "c_cpp.configuration.suggestSnippets.markdownDescription": "If `true`, snippets are provided by the language server.", + "c_cpp.configuration.enhancedColorization.markdownDescription": "If enabled, code is colorized based on IntelliSense. This setting only applies if `#C_Cpp.intelliSenseEngine` is set to `Default`.", "c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.", "c_cpp.configuration.vcpkg.enabled.markdownDescription": "Enable integration services for the [vcpkg dependency manager](https://aka.ms/vcpkg/).", - "c_cpp.configuration.addNodeAddonIncludePaths.description": "Add include paths from nan and node-addon-api when they're dependencies.", - "c_cpp.configuration.renameRequiresIdentifier.description": "If true, 'Rename Symbol' will require a valid C/C++ identifier.", - "c_cpp.configuration.autocompleteAddParentheses.description": "If true, autocomplete will automatically add \"(\" after function calls, in which case \")\" may also be added, depending on the value of the \"editor.autoClosingBrackets\" setting.", - "c_cpp.configuration.filesExclude.description": "Configure glob patterns for excluding folders (and files if \"C_Cpp.exclusionPolicy\" is changed). These are specific to the C/C++ extension and are in addition to \"files.exclude\", but unlike \"files.exclude\" they are not removed from the Explorer view. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", - "c_cpp.configuration.filesExcludeBoolean.description": "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.", - "c_cpp.configuration.filesExcludeWhen.description": "Additional check on the siblings of a matching file. Use $(basename) as variable for the matching file name.", - "c_cpp.configuration.debugger.useBacktickCommandSubstitution.description": "If true, debugger shell command substitution will use obsolete backtick (`).", + "c_cpp.configuration.addNodeAddonIncludePaths.markdownDescription": "Add include paths from `nan` and `node-addon-api` when they're dependencies.", + "c_cpp.configuration.renameRequiresIdentifier.markdownDescription": "If `true`, 'Rename Symbol' will require a valid C/C++ identifier.", + "c_cpp.configuration.autocompleteAddParentheses.markdownDescription": "If `true`, autocomplete will automatically add `(` after function calls, in which case `)` may also be added, depending on the value of the `#editor.autoClosingBrackets#` setting.", + "c_cpp.configuration.filesExclude.markdownDescription": "Configure glob patterns for excluding folders (and files if `#C_Cpp.exclusionPolicy#` is changed). These are specific to the C/C++ extension and are in addition to `#files.exclude#`, but unlike `#files.exclude#` they are not removed from the Explorer view. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", + "c_cpp.configuration.filesExcludeBoolean.markdownDescription": "The glob pattern to match file paths against. Set to `true` or `false` to enable or disable the pattern.", + "c_cpp.configuration.filesExcludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", + "c_cpp.configuration.debugger.useBacktickCommandSubstitution.markdownDescription": "If `true`, debugger shell command substitution will use obsolete backtick (`).", "c_cpp.contributes.views.cppReferencesView.title": "C/C++: Other references results", "c_cpp.contributes.viewsWelcome.contents": "To learn more about launch.json, see [Configuring C/C++ debugging](https://code.visualstudio.com/docs/cpp/launch-json-reference).", "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).", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index ac5b08c11b..50d60bac27 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1206,7 +1206,7 @@ export class DefaultClient implements Client { ], initializationOptions: { maxThreads: workspaceSettings.maxThreads, - maxMemory: workspaceSettings.maxMemory ?? os.freemem() / 1024, + maxMemory: workspaceSettings.maxMemory ?? os.freemem() / 1048576, intelliSenseMaxThreads: workspaceSettings.intelliSenseMaxThreads, intelliSenseMaxMemory: workspaceSettings.intelliSenseMaxMemory, referencesMaxThreads: workspaceSettings.referencesMaxThreads, From 68dc2c159bd6851ef761a674e61a45992f971eba Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 29 Jul 2021 18:42:52 -0700 Subject: [PATCH 016/101] Update. --- Extension/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 847177d3ec..a6c305d457 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -2091,8 +2091,8 @@ "Disabled" ], "default": "Default", - "description": "%c_cpp.configuration.autocomplete.markdownDescription%", - "markdownEnumDescriptions": [ + "markdownDescription": "%c_cpp.configuration.autocomplete.markdownDescription%", + "description": [ "%c_cpp.configuration.autocomplete.default.description%", "%c_cpp.configuration.autocomplete.disabled.description%" ], From cd50db1a3626388cade2153d566cde8a0059e62b Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 29 Jul 2021 22:18:26 -0700 Subject: [PATCH 017/101] Fix activation event. --- Extension/package.json | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index a6c305d457..e967945162 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -45,39 +45,7 @@ "virtualWorkspaces": false }, "activationEvents": [ - "onLanguage:c", - "onLanguage:cpp", - "onLanguage:cuda-cpp", - "onCommand:extension.pickNativeProcess", - "onCommand:extension.pickRemoteNativeProcess", - "onCommand:C_Cpp.BuildAndDebugActiveFile", - "onCommand:C_Cpp.ConfigurationEditJSON", - "onCommand:C_Cpp.ConfigurationEditUI", - "onCommand:C_Cpp.ConfigurationSelect", - "onCommand:C_Cpp.ConfigurationProviderSelect", - "onCommand:C_Cpp.SwitchHeaderSource", - "onCommand:C_Cpp.EnableErrorSquiggles", - "onCommand:C_Cpp.DisableErrorSquiggles", - "onCommand:C_Cpp.ToggleIncludeFallback", - "onCommand:C_Cpp.ToggleDimInactiveRegions", - "onCommand:C_Cpp.ResetDatabase", - "onCommand:C_Cpp.TakeSurvey", - "onCommand:C_Cpp.LogDiagnostics", - "onCommand:C_Cpp.RescanWorkspace", - "onCommand:C_Cpp.VcpkgClipboardInstallSuggested", - "onCommand:C_Cpp.VcpkgOnlineHelpSuggested", - "onCommand:C_Cpp.GenerateEditorConfig", - "onCommand:C_Cpp.GoToNextDirectiveInGroup", - "onCommand:C_Cpp.GoToPrevDirectiveInGroup", - "onCommand:C_Cpp.CheckForCompiler", - "onCommand:C_Cpp.RunClangTidyOnActiveFile", - "onCommand:C_Cpp.RunClangTidyOnOpenFiles", - "onCommand:C_Cpp.RunClangTidyOnAllFiles", - "onDebugInitialConfigurations", - "onDebugResolve:cppdbg", - "onDebugResolve:cppvsdbg", - "workspaceContains:/.vscode/c_cpp_properties.json", - "onFileSystem:cpptools-schema" + "*" ], "main": "./dist/main", "contributes": { From 13d70214625e0e51d287d5b0f5c74e12ab151959 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 30 Jul 2021 11:04:31 -0700 Subject: [PATCH 018/101] Settings fixes. --- Extension/package.json | 12 ++--- Extension/package.nls.json | 92 +++++++++++++++++++------------------- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index e1a67a1d05..af97eea659 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -1997,10 +1997,10 @@ "allOneLineScopes", "never" ], - "enumDescriptions": [ - "%c_cpp.configuration.vcFormat.wrap.preserveBlocks.oneLiners.description%", - "%c_cpp.configuration.vcFormat.wrap.preserveBlocks.allOneLineScopes.description%", - "%c_cpp.configuration.vcFormat.wrap.preserveBlocks.never.description%" + "markdownEnumDescriptions": [ + "%c_cpp.configuration.vcFormat.wrap.preserveBlocks.oneLiners.markdownDescription%", + "%c_cpp.configuration.vcFormat.wrap.preserveBlocks.allOneLineScopes.markdownDescription%", + "%c_cpp.configuration.vcFormat.wrap.preserveBlocks.never.markdownDescription%" ], "default": "oneLiners", "description": "%c_cpp.configuration.vcFormat.wrap.preserveBlocks.description%", @@ -2023,7 +2023,7 @@ null ], "default": null, - "description": "%c_cpp.configuration.clang_format_sortIncludes.description%", + "markdownDescription": "%c_cpp.configuration.clang_format_sortIncludes.markdownDescription%", "scope": "resource" }, "C_Cpp.intelliSenseEngine": { @@ -4722,4 +4722,4 @@ "integrity": "698BA3D45B925F998AACE9ED387ADE4927FFE569860408570FD074DD0CD56252" } ] -} +} \ No newline at end of file diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 583555393e..74ccdc91b7 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -21,9 +21,9 @@ "c_cpp.command.generateEditorConfig.title": "Generate EditorConfig contents from VC Format settings", "c_cpp.command.GoToNextDirectiveInGroup.title": "Go to next preprocessor directive in conditional group", "c_cpp.command.GoToPrevDirectiveInGroup.title": "Go to previous preprocessor directive in conditional group", - "c_cpp.command.RunClangTidyOnActiveFile.title": "Run clang-tidy on the active file.", - "c_cpp.command.RunClangTidyOnOpenFiles.title": "Run clang-tidy on all open files.", - "c_cpp.command.RunClangTidyOnAllFiles.title": "Run clang-tidy on all source files.", + "c_cpp.command.RunClangTidyOnActiveFile.title": "Run clang-tidy on the active file", + "c_cpp.command.RunClangTidyOnOpenFiles.title": "Run clang-tidy on all open files", + "c_cpp.command.RunClangTidyOnAllFiles.title": "Run clang-tidy on all source files", "c_cpp.configuration.maxThreads.markdownDescription": "The maximum number of concurrent threads to use for language service processing. The default of `null` uses the number of logical processors available.", "c_cpp.configuration.maxMemory.markdownDescription": "The maximum memory (in MB) available for language service processing. Fewer processes will run concurrently after this memory usage is exceeded. The default of `null` uses the system's free memory.", "c_cpp.configuration.intelliSense.maxThreads.markdownDescription": "The maximum number of concurrent threads to use for IntelliSense processing. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", @@ -45,25 +45,25 @@ "c_cpp.configuration.vcFormat.indent.withinParentheses.indent.markdownDescription": "New line is indented based on `#C_Cpp.vcFormat.indent.multiLineRelativeTo#`.", "c_cpp.configuration.vcFormat.indent.preserveWithinParentheses.description": "In existing code, preserve the existing indent alignment of new lines within parentheses.", "c_cpp.configuration.vcFormat.indent.caseLabels.markdownDescription": "Labels are indented relative to switch statements by the amount specified in the `#editor.tabSize#` setting.", - "c_cpp.configuration.vcFormat.indent.caseContents.markdownDescription": "Code inside case block is indented relative to its label by the amount specified in the `#editor.tabSize#` setting", - "c_cpp.configuration.vcFormat.indent.caseContentsWhenBlock.markdownDescription": "Indent braces following a case statement by the amount specified in the `#editor.tabSize#` setting", - "c_cpp.configuration.vcFormat.indent.lambdaBracesWhenParameter.markdownDescription": "Indent braces of lambdas used as function parameters relative to the start of the statement by the amount specified in the `#editor.tabSize#` setting", - "c_cpp.configuration.vcFormat.indent.gotoLabels.description": "The position of goto labels", - "c_cpp.configuration.vcFormat.indent.gotoLabels.oneLeft.markdownDescription": "Position goto labels to the left of the current code indentation, by the amount specified in the `#editor.tabSize#` setting", + "c_cpp.configuration.vcFormat.indent.caseContents.markdownDescription": "Code inside case block is indented relative to its label by the amount specified in the `#editor.tabSize#` setting.", + "c_cpp.configuration.vcFormat.indent.caseContentsWhenBlock.markdownDescription": "Indent braces following a case statement by the amount specified in the `#editor.tabSize#` setting.", + "c_cpp.configuration.vcFormat.indent.lambdaBracesWhenParameter.markdownDescription": "Indent braces of lambdas used as function parameters relative to the start of the statement by the amount specified in the `#editor.tabSize#` setting.", + "c_cpp.configuration.vcFormat.indent.gotoLabels.description": "The position of goto labels.", + "c_cpp.configuration.vcFormat.indent.gotoLabels.oneLeft.markdownDescription": "Position goto labels to the left of the current code indentation, by the amount specified in the `#editor.tabSize#` setting.", "c_cpp.configuration.vcFormat.indent.gotoLabels.leftmostColumn.markdownDescription": "Position goto labels at the leftmost edge of the code.", "c_cpp.configuration.vcFormat.indent.gotoLabels.none.markdownDescription": "Goto labels will not be formatted.", - "c_cpp.configuration.vcFormat.indent.preprocessor.description": "The position of preprocessor directives", - "c_cpp.configuration.vcFormat.indent.preprocessor.oneLeft.markdownDescription": "Preprocessor directives are positioned to the left of the current code indentation, by the amount specified in the `#editor.tabSize#` setting", + "c_cpp.configuration.vcFormat.indent.preprocessor.description": "The position of preprocessor directives.", + "c_cpp.configuration.vcFormat.indent.preprocessor.oneLeft.markdownDescription": "Preprocessor directives are positioned to the left of the current code indentation, by the amount specified in the `#editor.tabSize#` setting.", "c_cpp.configuration.vcFormat.indent.preprocessor.leftmostColumn.markdownDescription": "Preprocessor directives are positioned at the leftmost edge of the code.", "c_cpp.configuration.vcFormat.indent.preprocessor.none.markdownDescription": "Preprocessor directives will not be formatted.", - "c_cpp.configuration.vcFormat.indent.accessSpecifiers.markdownDescription": "Access specifiers are indented relative to class or struct definitions by the amount specified in the `#editor.tabSize#` setting", - "c_cpp.configuration.vcFormat.indent.namespaceContents.markdownDescription": "Code is indented relative to its enclosing namespace by the amount specified in the `#editor.tabSize#` setting", + "c_cpp.configuration.vcFormat.indent.accessSpecifiers.markdownDescription": "Access specifiers are indented relative to class or struct definitions by the amount specified in the `#editor.tabSize#` setting.", + "c_cpp.configuration.vcFormat.indent.namespaceContents.markdownDescription": "Code is indented relative to its enclosing namespace by the amount specified in the `#editor.tabSize#` setting.", "c_cpp.configuration.vcFormat.indent.preserveComments.description": "Indentation of comments is not changed during formatting operations.", - "c_cpp.configuration.vcFormat.newLine.beforeOpenBrace.namespace.description": "The position of opening braces for namespaces", - "c_cpp.configuration.vcFormat.newLine.beforeOpenBrace.type.description": "The position of opening braces for type definitions", - "c_cpp.configuration.vcFormat.newLine.beforeOpenBrace.lambda.description": "The position of opening braces for lambda functions", - "c_cpp.configuration.vcFormat.newLine.beforeOpenBrace.function.description": "The position of opening braces for functions", - "c_cpp.configuration.vcFormat.newLine.beforeOpenBrace.block.description": "The position of opening braces for control blocks", + "c_cpp.configuration.vcFormat.newLine.beforeOpenBrace.namespace.description": "The position of opening braces for namespaces.", + "c_cpp.configuration.vcFormat.newLine.beforeOpenBrace.type.description": "The position of opening braces for type definitions.", + "c_cpp.configuration.vcFormat.newLine.beforeOpenBrace.lambda.description": "The position of opening braces for lambda functions.", + "c_cpp.configuration.vcFormat.newLine.beforeOpenBrace.function.description": "The position of opening braces for functions.", + "c_cpp.configuration.vcFormat.newLine.beforeOpenBrace.block.description": "The position of opening braces for control blocks.", "c_cpp.configuration.vcFormat.newLine.beforeOpenBrace.newLine.description": "Opening braces are moved to a new line.", "c_cpp.configuration.vcFormat.newLine.beforeOpenBrace.sameLine.description": "Opening braces are kept on the same line and a space is added before each one.", "c_cpp.configuration.vcFormat.newLine.beforeOpenBrace.ignore.description": "Opening braces are not formatted.", @@ -73,7 +73,7 @@ "c_cpp.configuration.vcFormat.newLine.beforeCatch.description": "Place 'catch' and similar keywords on a new line.", "c_cpp.configuration.vcFormat.newLine.beforeElse.description": "Place 'else' on a new line.", "c_cpp.configuration.vcFormat.newLine.beforeWhileInDoWhile.description": "Place 'while' in a do-while loop on a new line.", - "c_cpp.configuration.vcFormat.space.beforeFunctionOpenParenthesis.description": "Spacing between function names and opening parentheses of argument lists", + "c_cpp.configuration.vcFormat.space.beforeFunctionOpenParenthesis.description": "Spacing between function names and opening parentheses of argument lists.", "c_cpp.configuration.vcFormat.space.beforeFunctionOpenParenthesis.insert.description": "Add a space before the opening parenthesis of a function.", "c_cpp.configuration.vcFormat.space.beforeFunctionOpenParenthesis.remove.description": "Spaces before opening parenthesis of a function are removed.", "c_cpp.configuration.vcFormat.space.beforeFunctionOpenParenthesis.ignore.description": "Spaces are left as entered.", @@ -105,26 +105,26 @@ "c_cpp.configuration.vcFormat.space.removeBeforeSemicolon.description": "Spaces are removed before every semicolon.", "c_cpp.configuration.vcFormat.space.insertAfterSemicolon.description": "A space is inserted after every semicolon.", "c_cpp.configuration.vcFormat.space.removeAroundUnaryOperator.description": "Spaces between unary operators and operands are removed.", - "c_cpp.configuration.vcFormat.space.aroundBinaryOperator.description": "Spaces around binary operators", - "c_cpp.configuration.vcFormat.space.aroundAssignmentOperator.description": "Spaces around assignment operators", - "c_cpp.configuration.vcFormat.space.pointerReferenceAlignment.description": "Spaces around pointer and reference operators", + "c_cpp.configuration.vcFormat.space.aroundBinaryOperator.description": "Spaces around binary operators.", + "c_cpp.configuration.vcFormat.space.aroundAssignmentOperator.description": "Spaces around assignment operators.", + "c_cpp.configuration.vcFormat.space.pointerReferenceAlignment.description": "Spaces around pointer and reference operators.", "c_cpp.configuration.vcFormat.space.pointerReferenceAlignment.left.description": "Pointer and reference operators are aligned to the left.", "c_cpp.configuration.vcFormat.space.pointerReferenceAlignment.center.description": "Pointer and reference operators are centered.", "c_cpp.configuration.vcFormat.space.pointerReferenceAlignment.right.description": "Pointer and reference operators are aligned to the right.", "c_cpp.configuration.vcFormat.space.pointerReferenceAlignment.ignore.description": "Pointer and reference operators are not formatted.", - "c_cpp.configuration.vcFormat.space.aroundTernaryOperator.description": "Spaces around conditional operators", + "c_cpp.configuration.vcFormat.space.aroundTernaryOperator.description": "Spaces around conditional operators.", "c_cpp.configuration.vcFormat.space.aroundOperators.insert.description": "A space is added before the operator and also after it.", "c_cpp.configuration.vcFormat.space.aroundOperators.remove.description": "Spaces before and after the operator are removed.", "c_cpp.configuration.vcFormat.space.aroundOperators.ignore.description": "Spaces are left as entered.", - "c_cpp.configuration.vcFormat.wrap.preserveBlocks.description": "Wrapping options for blocks", - "c_cpp.configuration.vcFormat.wrap.preserveBlocks.oneLiners.description": "A complete code block that is entered on one line is kept on one line, regardless of the values of any of the VC Format: New Line settings", - "c_cpp.configuration.vcFormat.wrap.preserveBlocks.allOneLineScopes.description": "Any code where the opening and closing brace is entered on one line is kept on one line, regardless of the values of any of the VC Format: New Line settings", - "c_cpp.configuration.vcFormat.wrap.preserveBlocks.never.description": "Code blocks are always formatted based on the values of the VC Format: New Line settings", + "c_cpp.configuration.vcFormat.wrap.preserveBlocks.description": "Wrapping options for blocks.", + "c_cpp.configuration.vcFormat.wrap.preserveBlocks.oneLiners.markdownDescription": "A complete code block that is entered on one line is kept on one line, regardless of the values of any of the `C_Cpp.vcFormat.newLine.*` settings.", + "c_cpp.configuration.vcFormat.wrap.preserveBlocks.allOneLineScopes.markdownDescription": "Any code where the opening and closing brace is entered on one line is kept on one line, regardless of the values of any of the `C_Cpp.vcFormat.newLine.*` settings.", + "c_cpp.configuration.vcFormat.wrap.preserveBlocks.never.markdownDescription": "Code blocks are always formatted based on the values of the `C_Cpp.vcFormat.newLine.*` settings.", "c_cpp.configuration.clang_format_path.description": "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.", "c_cpp.configuration.clang_format_style.markdownDescription": "Coding style, currently supports: `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`. Use `file` to load the style from a `.clang-format` file in the current or parent directory. Use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", - "c_cpp.configuration.clang_format_fallbackStyle.markdownDescription": "Name of the predefined style used as a fallback in case clang-format is invoked with style `file` but the `.clang-format` file is not found. Possible values are `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `none`, or use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", - "c_cpp.configuration.clang_format_sortIncludes.description": "If set, overrides the include sorting behavior determined by the SortIncludes parameter.", - "c_cpp.configuration.clangTidy.maxThreads.markdownDescription": "The maximum number of theads to use for clang-tidy processing. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", + "c_cpp.configuration.clang_format_fallbackStyle.markdownDescription": "Name of the predefined style used as a fallback in case clang-format is invoked with style `file` but the `.clang-format` file is not found. Possible values are `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`, `none`, or use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", + "c_cpp.configuration.clang_format_sortIncludes.markdownDescription": "If set, overrides the include sorting behavior determined by the `SortIncludes` parameter.", + "c_cpp.configuration.clangTidy.maxThreads.markdownDescription": "The maximum number of concurrent theads to use for clang-tidy processing. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", "c_cpp.configuration.clangTidy.maxMemory.markdownDescription": "Fewer clang-tidy processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "c_cpp.configuration.clangTidy.path.description": "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.", "c_cpp.configuration.clangTidy.exclude.markdownDescription": "Configure glob patterns for excluding folders and files for clang-tidy. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", @@ -134,7 +134,7 @@ "c_cpp.configuration.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for clang-tidy. If not specified, the build configuration from IntelliSense will be used.", "c_cpp.configuration.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file, if any.", "c_cpp.configuration.clangTidy.config.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format: `{Checks: '*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, clang-tidy will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", - "c_cpp.configuration.clangTidy.fix.description": "Determines when clang-tidy fixes should be automatically applied", + "c_cpp.configuration.clangTidy.fix.description": "Determines when clang-tidy fixes should be automatically applied.", "c_cpp.configuration.clangTidy.fix.disabled.description": "Don't automatically apply clang-tidy fixes.", "c_cpp.configuration.clangTidy.fix.fixIfNoError.description": "Automatically apply clang-tidy fixes if no errors occur.", "c_cpp.configuration.clangTidy.fix.fixError.description": "Automatically apply clang-tidy fixes, even if errors occur.", @@ -144,7 +144,7 @@ "c_cpp.configuration.intelliSenseEngine.tagParser.description": "Provides \"fuzzy\" results that are not context-aware.", "c_cpp.configuration.intelliSenseEngine.disabled.description": "Turns off C/C++ language service features.", "c_cpp.configuration.intelliSenseEngineFallback.description": "Controls whether the IntelliSense engine will automatically switch to the Tag Parser for translation units containing #include errors.", - "c_cpp.configuration.autocomplete.markdownDescription": "Controls the auto-completion provider. If `Disabled` and you want word-based completion, you will also need to set `\"[cpp]\": {\"editor.wordBasedSuggestions\": false}, \"[c]\": {\"editor.wordBasedSuggestions\": false}, \"[cuda-cpp]\": {\"editor.wordBasedSuggestions\": false}`", + "c_cpp.configuration.autocomplete.markdownDescription": "Controls the auto-completion provider. If `Disabled` and you want word-based completion, you will also need to set `\"[cpp]\": {\"editor.wordBasedSuggestions\": true} (and similarly for `[c]` and `[cuda-cpp]` languages).", "c_cpp.configuration.autocomplete.default.description": "Uses the active IntelliSense engine.", "c_cpp.configuration.autocomplete.disabled.description": "Uses the word-based completion provided by Visual Studio Code.", "c_cpp.configuration.errorSquiggles.description": "Controls whether suspected compile errors detected by the IntelliSense engine will be reported back to the editor. This setting is ignored by the Tag Parser engine.", @@ -156,7 +156,7 @@ "c_cpp.configuration.autoAddFileAssociations.markdownDescription": "Controls whether files are automatically added to `#files.associations#` when they are the target of a navigation operation from a C/C++ file.", "c_cpp.configuration.workspaceParsingPriority.markdownDescription": "Controls whether parsing of the non-active workspace files uses sleeps to avoid using 100% CPU. The values `highest`/`high`/`medium`/`low` correspond to approximately 100/75/50/25% CPU usage.", "c_cpp.configuration.workspaceSymbols.description": "The symbols to include in the query results when 'Go to Symbol in Workspace' is invoked.", - "c_cpp.configuration.exclusionPolicy.markdownDescription": "Instructs the extension when to use the `#files.exclude#` setting when determining which files should be added to the code navigation database while traversing through the paths in the `browse.path` array. If your `#files.exclude#` setting only contains folders, then `checkFolders` is the best choice and will increase the speed at which the extension can initialize the code navigation database.", + "c_cpp.configuration.exclusionPolicy.markdownDescription": "Instructs the extension when to use the `#files.exclude#` (and `#C_Cpp.files.exclude`) setting when determining which files should be added to the code navigation database while traversing through the paths in the `browse.path` array. If your `#files.exclude#` setting only contains folders, then `checkFolders` is the best choice and will increase the speed at which the extension can initialize the code navigation database.", "c_cpp.configuration.exclusionPolicy.checkFolders.description": "The exclusion filters will only be evaluated once per folder (individual files are not checked).", "c_cpp.configuration.exclusionPolicy.checkFilesAndFolders.description": "The exclusion filters will be evaluated against every file and folder encountered.", "c_cpp.configuration.preferredPathSeparator.description": "The character used as a path separator for #include auto-completion results.", @@ -200,11 +200,11 @@ "c_cpp.configuration.filesExclude.markdownDescription": "Configure glob patterns for excluding folders (and files if `#C_Cpp.exclusionPolicy#` is changed). These are specific to the C/C++ extension and are in addition to `#files.exclude#`, but unlike `#files.exclude#` they are not removed from the Explorer view. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "c_cpp.configuration.filesExcludeBoolean.markdownDescription": "The glob pattern to match file paths against. Set to `true` or `false` to enable or disable the pattern.", "c_cpp.configuration.filesExcludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", - "c_cpp.configuration.debugger.useBacktickCommandSubstitution.markdownDescription": "If `true`, debugger shell command substitution will use obsolete backtick (`).", - "c_cpp.contributes.views.cppReferencesView.title": "C/C++: Other references results", + "c_cpp.configuration.debugger.useBacktickCommandSubstitution.markdownDescription": "If `true`, debugger shell command substitution will use obsolete backtick (```).", + "c_cpp.contributes.views.cppReferencesView.title": "C/C++: Other references results.", "c_cpp.contributes.viewsWelcome.contents": "To learn more about launch.json, see [Configuring C/C++ debugging](https://code.visualstudio.com/docs/cpp/launch-json-reference).", "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).", - "c_cpp.debuggers.pipeTransport.default.pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'", + "c_cpp.debuggers.pipeTransport.default.pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'.", "c_cpp.debuggers.pipeTransport.default.debuggerPath": "The full path to the debugger on the target machine, for example /usr/bin/gdb.", "c_cpp.debuggers.pipeTransport.debuggerPath.description": "The full path to the debugger on the target machine, for example /usr/bin/gdb.", "c_cpp.debuggers.pipeTransport.pipeCwd.description": "The fully qualified path to the working directory for the pipe program.", @@ -229,7 +229,7 @@ "c_cpp.debuggers.cppdbg.type.description": "The type of the engine. Must be \"cppdbg\".", "c_cpp.debuggers.cppvsdbg.type.description": "The type of the engine. Must be \"cppvsdbg\".", "c_cpp.debuggers.targetArchitecture.description": "The architecture of the debuggee. This will automatically be detected unless this parameter is set. Allowed values are x86, arm, arm64, mips, x64, amd64, x86_64.", - "c_cpp.debuggers.cwd.description": "The working directory of the target", + "c_cpp.debuggers.cwd.description": "The working directory of the target.", "c_cpp.debuggers.setupCommands.description": "One or more GDB/LLDB commands to execute in order to setup the underlying debugger. Example: \"setupCommands\": [ { \"text\": \"-enable-pretty-printing\", \"description\": \"Enable GDB pretty printing\", \"ignoreFailures\": true }].", "c_cpp.debuggers.customLaunchSetupCommands.description": "If provided, this replaces the default commands used to launch a target with some other commands. For example, this can be \"-target-attach\" in order to attach to a target process. An empty command list replaces the launch commands with nothing, which can be useful if the debugger is being provided launch options as command line options. Example: \"customLaunchSetupCommands\": [ { \"text\": \"target-run\", \"description\": \"run target\", \"ignoreFailures\": false }].", "c_cpp.debuggers.launchCompleteCommand.description": "The command to execute after the debugger is fully setup in order to cause the target process to run. Allowed values are \"exec-run\", \"exec-continue\", \"None\". The default value is \"exec-run\".", @@ -237,7 +237,7 @@ "c_cpp.debuggers.cppvsdbg.visualizerFile.description": ".natvis file to be used when debugging this process.", "c_cpp.debuggers.showDisplayString.description": "When a visualizerFile is specified, showDisplayString will enable the display string. Turning this option on can cause slower performance during debugging.", "c_cpp.debuggers.environment.description": "Environment variables to add to the environment for the program. Example: [ { \"name\": \"config\", \"value\": \"Debug\" } ], not [ { \"config\": \"Debug\" } ].", - "c_cpp.debuggers.envFile.description": "Absolute path to a file containing environment variable definitions. This file has key value pairs separated by an equals sign per line. E.g. KEY=VALUE", + "c_cpp.debuggers.envFile.description": "Absolute path to a file containing environment variable definitions. This file has key value pairs separated by an equals sign per line. E.g. KEY=VALUE.", "c_cpp.debuggers.additionalSOLibSearchPath.description": "Semicolon separated list of directories to use to search for .so files. Example: \"c:\\dir1;c:\\dir2\".", "c_cpp.debuggers.MIMode.description": "Indicates the console debugger that the MIDebugEngine will connect to. Allowed values are \"gdb\" \"lldb\".", "c_cpp.debuggers.miDebuggerPath.description": "The path to the MI debugger (such as gdb). When unspecified, it will search path first for the debugger.", @@ -254,30 +254,30 @@ "c_cpp.debuggers.cppdbg.externalConsole.description": "If true, a console is launched for the debuggee. If false, on Linux and Windows, it will appear in the Integrated Console.", "c_cpp.debuggers.cppvsdbg.externalConsole.description": "[Deprecated by 'console'] If true, a console is launched for the debuggee. If false, no console is launched.", "c_cpp.debuggers.cppvsdbg.console.description": "Where to launch the debug target. Defaults to 'internalConsole' if not defined.", - "c_cpp.debuggers.cppvsdbg.console.internalConsole.description": "Output to the VS Code Debug Console. This doesn't support reading console input (ex:'std::cin' or 'scanf')", - "c_cpp.debuggers.cppvsdbg.console.integratedTerminal.description": "VS Code's integrated terminal", + "c_cpp.debuggers.cppvsdbg.console.internalConsole.description": "Output to the VS Code Debug Console. This doesn't support reading console input (ex:'std::cin' or 'scanf').", + "c_cpp.debuggers.cppvsdbg.console.integratedTerminal.description": "VS Code's integrated terminal.", "c_cpp.debuggers.cppvsdbg.console.externalTerminal.description": "Console applications will be launched in an external terminal window. The window will be reused in relaunch scenarios and will not automatically disappear when the application exits.", "c_cpp.debuggers.cppvsdbg.console.newExternalWindow.description": "Console applications will be launched in their own external console window which will end when the application stops. Non-console applications will run without a terminal, and stdout/stderr will be ignored.", "c_cpp.debuggers.avoidWindowsConsoleRedirection.description": "If true, disables debuggee console redirection that is required for Integrated Terminal support.", - "c_cpp.debuggers.sourceFileMap.description": "Optional source file mappings passed to the debug engine. Example: '{ \"/original/source/path\":\"/current/source/path\" }'", + "c_cpp.debuggers.sourceFileMap.description": "Optional source file mappings passed to the debug engine. Example: '{ \"/original/source/path\":\"/current/source/path\" }'.", "c_cpp.debuggers.processId.anyOf.description": "Optional process id to attach the debugger to. Use \"${command:pickProcess}\" to get a list of local running processes to attach to. Note that some platforms require administrator privileges in order to attach to a process.", "c_cpp.debuggers.symbolSearchPath.description": "Semicolon separated list of directories to use to search for symbol (that is, pdb) files. Example: \"c:\\dir1;c:\\dir2\".", "c_cpp.debuggers.dumpPath.description": "Optional full path to a dump file for the specified program. Example: \"c:\\temp\\app.dmp\". Defaults to null.", "c_cpp.debuggers.enableDebugHeap.description": "If false, the process will be launched with debug heap disabled. This sets the environment variable '_NO_DEBUG_HEAP' to '1'.", "c_cpp.debuggers.symbolLoadInfo.description": "Explicit control of symbol loading.", "c_cpp.debuggers.symbolLoadInfo.loadAll.description": "If true, symbols for all libs will be loaded, otherwise no solib symbols will be loaded. Default value is true.", - "c_cpp.debuggers.symbolLoadInfo.exceptionList.description": "List of filenames (wildcards allowed) separated by semicolons ';'. Modifies behavior of LoadAll. If LoadAll is true then don't load symbols for libs that match any name in the list. Otherwise only load symbols for libs that match. Example: \"foo.so;bar.so\"", + "c_cpp.debuggers.symbolLoadInfo.exceptionList.description": "List of filenames (wildcards allowed) separated by semicolons ';'. Modifies behavior of LoadAll. If LoadAll is true then don't load symbols for libs that match any name in the list. Otherwise only load symbols for libs that match. Example: \"foo.so;bar.so\".", "c_cpp.debuggers.requireExactSource.description": "Optional flag to require current source code to match the pdb.", "c_cpp.debuggers.stopAtConnect.description": "If true, the debugger should stop after connecting to the target. If false, the debugger will continue after connecting. Defaults to false.", "c_cpp.debuggers.hardwareBreakpoints.description": "Explicit control of hardware breakpoint behavior for remote targets.", "c_cpp.debuggers.hardwareBreakpoints.require.description": "If true, always use hardware breakpoints. Defaults to false.", "c_cpp.debuggers.hardwareBreakpoints.limit.description": "Optional limit on the number of available hardware breakpoints to use. Only enforced when \"require\" is true and \"limit\" is greater than 0. Defaults to 0.", - "c_cpp.taskDefinitions.name.description": "The name of the task", - "c_cpp.taskDefinitions.command.description": "The path to either a compiler or script that performs compilation", - "c_cpp.taskDefinitions.args.description": "Additional arguments to pass to the compiler or compilation script", - "c_cpp.taskDefinitions.options.description": "Additional command options", + "c_cpp.taskDefinitions.name.description": "The name of the task.", + "c_cpp.taskDefinitions.command.description": "The path to either a compiler or script that performs compilation.", + "c_cpp.taskDefinitions.args.description": "Additional arguments to pass to the compiler or compilation script.", + "c_cpp.taskDefinitions.options.description": "Additional command options.", "c_cpp.taskDefinitions.options.cwd.description": "The current working directory of the executed program or script. If omitted Code's current workspace root is used.", - "c_cpp.taskDefinitions.detail.description": "Additional details of the task", + "c_cpp.taskDefinitions.detail.description": "Additional details of the task.", "c_cpp.debuggers.sourceFileMap.sourceFileMapEntry.description": "Current and compile-time paths to the same source trees. Files found under the EditorPath are mapped to the CompileTimePath path for breakpoint matching and mapped from CompileTimePath to EditorPath when displaying stacktrace locations.", "c_cpp.debuggers.sourceFileMap.sourceFileMapEntry.editorPath.description": "The path to the source tree the editor will use.", "c_cpp.debuggers.sourceFileMap.sourceFileMapEntry.useForBreakpoints.description": "False if this entry is only used for stack frame location mapping. True if this entry should also be used when specifying breakpoint locations.", From 14fcd05766cec3bb85de87a5eeeb499849f21ae5 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 30 Jul 2021 14:33:05 -0700 Subject: [PATCH 019/101] More settings fixes. --- Extension/package.json | 7 ++++++- Extension/package.nls.json | 29 +++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index af97eea659..f5e60caf73 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -386,6 +386,11 @@ "markdownDescription": "%c_cpp.configuration.clangTidy.config.markdownDescription%", "scope": "resource" }, + "C_Cpp.clangTidy.fallbackConfig": { + "type": "string", + "markdownDescription": "%c_cpp.configuration.clangTidy.fallbackConfig.markdownDescription%", + "scope": "resource" + }, "C_Cpp.clangTidy.fix": { "type": "string", "enum": [ @@ -2060,7 +2065,7 @@ ], "default": "Default", "markdownDescription": "%c_cpp.configuration.autocomplete.markdownDescription%", - "description": [ + "enumDescription": [ "%c_cpp.configuration.autocomplete.default.description%", "%c_cpp.configuration.autocomplete.disabled.description%" ], diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 74ccdc91b7..d7745ef629 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -121,8 +121,14 @@ "c_cpp.configuration.vcFormat.wrap.preserveBlocks.allOneLineScopes.markdownDescription": "Any code where the opening and closing brace is entered on one line is kept on one line, regardless of the values of any of the `C_Cpp.vcFormat.newLine.*` settings.", "c_cpp.configuration.vcFormat.wrap.preserveBlocks.never.markdownDescription": "Code blocks are always formatted based on the values of the `C_Cpp.vcFormat.newLine.*` settings.", "c_cpp.configuration.clang_format_path.description": "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.", - "c_cpp.configuration.clang_format_style.markdownDescription": "Coding style, currently supports: `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`. Use `file` to load the style from a `.clang-format` file in the current or parent directory. Use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", - "c_cpp.configuration.clang_format_fallbackStyle.markdownDescription": "Name of the predefined style used as a fallback in case clang-format is invoked with style `file` but the `.clang-format` file is not found. Possible values are `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`, `none`, or use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", + "c_cpp.configuration.clang_format_style.markdownDescription": { + "message": "Coding style, currently supports: `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`. Use `file` to load the style from a `.clang-format` file in the current or parent directory. Use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", + "comment": ["Normally, text in the \\`\\` are literal values that should not be translated, but `key` and `value` are a special case that should probably be translated, since they're meant to be placeholders."] + }, + "c_cpp.configuration.clang_format_fallbackStyle.markdownDescription": { + "message": "Name of the predefined style used as a fallback in case clang-format is invoked with style `file` but the `.clang-format` file is not found. Possible values are `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`, `none`, or use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", + "comment": ["Normally, text in the \\`\\` are literal values that should not be translated, but `key` and `value` are a special case that should probably be translated, since they're meant to be placeholders."] + }, "c_cpp.configuration.clang_format_sortIncludes.markdownDescription": "If set, overrides the include sorting behavior determined by the `SortIncludes` parameter.", "c_cpp.configuration.clangTidy.maxThreads.markdownDescription": "The maximum number of concurrent theads to use for clang-tidy processing. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", "c_cpp.configuration.clangTidy.maxMemory.markdownDescription": "Fewer clang-tidy processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", @@ -132,8 +138,15 @@ "c_cpp.configuration.clangTidy.excludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", "c_cpp.configuration.clangTidy.runInBackground.markdownDescription": "If `true`, clang-tidy will run automatically in the background.", "c_cpp.configuration.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for clang-tidy. If not specified, the build configuration from IntelliSense will be used.", - "c_cpp.configuration.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file, if any.", - "c_cpp.configuration.clangTidy.config.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format: `{Checks: '*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, clang-tidy will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", + "c_cpp.configuration.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file, if any. The default check `clang-analyzer-*` is always used unless it's explicitly removed.", + "c_cpp.configuration.clangTidy.config.markdownDescription": { + "message": "Specifies a clang-tidy configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, clang-tidy will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", + "comment": ["Normally, text in the \\`\\` are literal values that should not be translated, but `key` and `value` are a special case that should probably be translated, since they're meant to be placeholders."] + }, + "c_cpp.configuration.clangTidy.fallbackConfig.markdownDescription": { + "message": "Specifies a clang-tidy configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", + "comment": ["Normally, text in the \\`\\` are literal values that should not be translated, but `key` and `value` are a special case that should probably be translated, since they're meant to be placeholders."] + }, "c_cpp.configuration.clangTidy.fix.description": "Determines when clang-tidy fixes should be automatically applied.", "c_cpp.configuration.clangTidy.fix.disabled.description": "Don't automatically apply clang-tidy fixes.", "c_cpp.configuration.clangTidy.fix.fixIfNoError.description": "Automatically apply clang-tidy fixes if no errors occur.", @@ -144,7 +157,7 @@ "c_cpp.configuration.intelliSenseEngine.tagParser.description": "Provides \"fuzzy\" results that are not context-aware.", "c_cpp.configuration.intelliSenseEngine.disabled.description": "Turns off C/C++ language service features.", "c_cpp.configuration.intelliSenseEngineFallback.description": "Controls whether the IntelliSense engine will automatically switch to the Tag Parser for translation units containing #include errors.", - "c_cpp.configuration.autocomplete.markdownDescription": "Controls the auto-completion provider. If `Disabled` and you want word-based completion, you will also need to set `\"[cpp]\": {\"editor.wordBasedSuggestions\": true} (and similarly for `[c]` and `[cuda-cpp]` languages).", + "c_cpp.configuration.autocomplete.markdownDescription": "Controls the auto-completion provider. If `Disabled` and you want word-based completion, you will also need to set `\"[cpp]\": {\"editor.wordBasedSuggestions\": true}` (and similarly for `c` and `cuda-cpp` languages).", "c_cpp.configuration.autocomplete.default.description": "Uses the active IntelliSense engine.", "c_cpp.configuration.autocomplete.disabled.description": "Uses the word-based completion provided by Visual Studio Code.", "c_cpp.configuration.errorSquiggles.description": "Controls whether suspected compile errors detected by the IntelliSense engine will be reported back to the editor. This setting is ignored by the Tag Parser engine.", @@ -156,7 +169,7 @@ "c_cpp.configuration.autoAddFileAssociations.markdownDescription": "Controls whether files are automatically added to `#files.associations#` when they are the target of a navigation operation from a C/C++ file.", "c_cpp.configuration.workspaceParsingPriority.markdownDescription": "Controls whether parsing of the non-active workspace files uses sleeps to avoid using 100% CPU. The values `highest`/`high`/`medium`/`low` correspond to approximately 100/75/50/25% CPU usage.", "c_cpp.configuration.workspaceSymbols.description": "The symbols to include in the query results when 'Go to Symbol in Workspace' is invoked.", - "c_cpp.configuration.exclusionPolicy.markdownDescription": "Instructs the extension when to use the `#files.exclude#` (and `#C_Cpp.files.exclude`) setting when determining which files should be added to the code navigation database while traversing through the paths in the `browse.path` array. If your `#files.exclude#` setting only contains folders, then `checkFolders` is the best choice and will increase the speed at which the extension can initialize the code navigation database.", + "c_cpp.configuration.exclusionPolicy.markdownDescription": "Instructs the extension when to use the `#files.exclude#` (and `#C_Cpp.files.exclude#`) setting when determining which files should be added to the code navigation database while traversing through the paths in the `browse.path` array. If your `#files.exclude#` setting only contains folders, then `checkFolders` is the best choice and will increase the speed at which the extension can initialize the code navigation database.", "c_cpp.configuration.exclusionPolicy.checkFolders.description": "The exclusion filters will only be evaluated once per folder (individual files are not checked).", "c_cpp.configuration.exclusionPolicy.checkFilesAndFolders.description": "The exclusion filters will be evaluated against every file and folder encountered.", "c_cpp.configuration.preferredPathSeparator.description": "The character used as a path separator for #include auto-completion results.", @@ -191,7 +204,7 @@ "c_cpp.configuration.updateChannel.markdownDescription": "Set to `Insiders` to automatically download and install the latest Insiders builds of the extension, which include upcoming features and bug fixes.", "c_cpp.configuration.experimentalFeatures.description": "Controls whether \"experimental\" features are usable.", "c_cpp.configuration.suggestSnippets.markdownDescription": "If `true`, snippets are provided by the language server.", - "c_cpp.configuration.enhancedColorization.markdownDescription": "If enabled, code is colorized based on IntelliSense. This setting only applies if `#C_Cpp.intelliSenseEngine` is set to `Default`.", + "c_cpp.configuration.enhancedColorization.markdownDescription": "If enabled, code is colorized based on IntelliSense. This setting only applies if `#C_Cpp.intelliSenseEngine#` is set to `Default`.", "c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.", "c_cpp.configuration.vcpkg.enabled.markdownDescription": "Enable integration services for the [vcpkg dependency manager](https://aka.ms/vcpkg/).", "c_cpp.configuration.addNodeAddonIncludePaths.markdownDescription": "Add include paths from `nan` and `node-addon-api` when they're dependencies.", @@ -200,7 +213,7 @@ "c_cpp.configuration.filesExclude.markdownDescription": "Configure glob patterns for excluding folders (and files if `#C_Cpp.exclusionPolicy#` is changed). These are specific to the C/C++ extension and are in addition to `#files.exclude#`, but unlike `#files.exclude#` they are not removed from the Explorer view. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "c_cpp.configuration.filesExcludeBoolean.markdownDescription": "The glob pattern to match file paths against. Set to `true` or `false` to enable or disable the pattern.", "c_cpp.configuration.filesExcludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", - "c_cpp.configuration.debugger.useBacktickCommandSubstitution.markdownDescription": "If `true`, debugger shell command substitution will use obsolete backtick (```).", + "c_cpp.configuration.debugger.useBacktickCommandSubstitution.markdownDescription": "If `true`, debugger shell command substitution will use obsolete backtick (\\`).", "c_cpp.contributes.views.cppReferencesView.title": "C/C++: Other references results.", "c_cpp.contributes.viewsWelcome.contents": "To learn more about launch.json, see [Configuring C/C++ debugging](https://code.visualstudio.com/docs/cpp/launch-json-reference).", "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).", From c20fb640fde0eb9deb8e2252a234279f5f6ac1fa Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 30 Jul 2021 15:50:35 -0700 Subject: [PATCH 020/101] Settings updates. --- Extension/package.json | 14 ++++++++++++++ Extension/package.nls.json | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Extension/package.json b/Extension/package.json index f5e60caf73..8fb9646089 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -376,6 +376,20 @@ "default": false, "scope": "application" }, + "C_Cpp.clangTidy.updateDelay": { + "type": "number", + "default": 3000, + "description": "%c_cpp.configuration.clangTidy.updateDelay.description%", + "scope": "application", + "minimum": 1000, + "maximum": 5000 + }, + "C_Cpp.clangTidy.runOnBuild": { + "type": "boolean", + "markdownDescription": "%c_cpp.configuration.clangTidy.runInBuild.markdownDescription%", + "default": false, + "scope": "application" + }, "C_Cpp.clangTidy.buildPath": { "type": "string", "markdownDescription": "%c_cpp.configuration.clangTidy.buildPath.markdownDescription%", diff --git a/Extension/package.nls.json b/Extension/package.nls.json index d7745ef629..8d9d9b8bfe 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -137,8 +137,10 @@ "c_cpp.configuration.clangTidy.excludeBoolean.description": "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.", "c_cpp.configuration.clangTidy.excludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", "c_cpp.configuration.clangTidy.runInBackground.markdownDescription": "If `true`, clang-tidy will run automatically in the background.", + "c_cpp.configuration.clangTidy.runOnBuild.markdownDescription": "If `true`, clang-tidy will run automatically after a build is completed.", + "c_cpp.configuration.clangTidy.updateDelay.description": "Controls the delay in milliseconds before clang-tidy starts processing after a modification.", "c_cpp.configuration.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for clang-tidy. If not specified, the build configuration from IntelliSense will be used.", - "c_cpp.configuration.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file, if any. The default check `clang-analyzer-*` is always used unless it's explicitly removed.", + "c_cpp.configuration.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it's explicitly removed.", "c_cpp.configuration.clangTidy.config.markdownDescription": { "message": "Specifies a clang-tidy configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, clang-tidy will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", "comment": ["Normally, text in the \\`\\` are literal values that should not be translated, but `key` and `value` are a special case that should probably be translated, since they're meant to be placeholders."] From 6bd6c2cf9f0bb63c721631a5af46b6553f27ea51 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 30 Jul 2021 16:50:46 -0700 Subject: [PATCH 021/101] Settings fixes. --- Extension/package.json | 4 ++-- Extension/package.nls.json | 20 ++++---------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 8fb9646089..88d285c606 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -386,7 +386,7 @@ }, "C_Cpp.clangTidy.runOnBuild": { "type": "boolean", - "markdownDescription": "%c_cpp.configuration.clangTidy.runInBuild.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.clangTidy.runOnBuild.markdownDescription%", "default": false, "scope": "application" }, @@ -2079,7 +2079,7 @@ ], "default": "Default", "markdownDescription": "%c_cpp.configuration.autocomplete.markdownDescription%", - "enumDescription": [ + "enumDescriptions": [ "%c_cpp.configuration.autocomplete.default.description%", "%c_cpp.configuration.autocomplete.disabled.description%" ], diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 8d9d9b8bfe..f1a26c7307 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -121,14 +121,8 @@ "c_cpp.configuration.vcFormat.wrap.preserveBlocks.allOneLineScopes.markdownDescription": "Any code where the opening and closing brace is entered on one line is kept on one line, regardless of the values of any of the `C_Cpp.vcFormat.newLine.*` settings.", "c_cpp.configuration.vcFormat.wrap.preserveBlocks.never.markdownDescription": "Code blocks are always formatted based on the values of the `C_Cpp.vcFormat.newLine.*` settings.", "c_cpp.configuration.clang_format_path.description": "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.", - "c_cpp.configuration.clang_format_style.markdownDescription": { - "message": "Coding style, currently supports: `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`. Use `file` to load the style from a `.clang-format` file in the current or parent directory. Use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", - "comment": ["Normally, text in the \\`\\` are literal values that should not be translated, but `key` and `value` are a special case that should probably be translated, since they're meant to be placeholders."] - }, - "c_cpp.configuration.clang_format_fallbackStyle.markdownDescription": { - "message": "Name of the predefined style used as a fallback in case clang-format is invoked with style `file` but the `.clang-format` file is not found. Possible values are `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`, `none`, or use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", - "comment": ["Normally, text in the \\`\\` are literal values that should not be translated, but `key` and `value` are a special case that should probably be translated, since they're meant to be placeholders."] - }, + "c_cpp.configuration.clang_format_style.markdownDescription": "Coding style, currently supports: `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`. Use `file` to load the style from a `.clang-format` file in the current or parent directory. Use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", + "c_cpp.configuration.clang_format_fallbackStyle.markdownDescription": "Name of the predefined style used as a fallback in case clang-format is invoked with style `file` but the `.clang-format` file is not found. Possible values are `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`, `none`, or use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", "c_cpp.configuration.clang_format_sortIncludes.markdownDescription": "If set, overrides the include sorting behavior determined by the `SortIncludes` parameter.", "c_cpp.configuration.clangTidy.maxThreads.markdownDescription": "The maximum number of concurrent theads to use for clang-tidy processing. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", "c_cpp.configuration.clangTidy.maxMemory.markdownDescription": "Fewer clang-tidy processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", @@ -141,14 +135,8 @@ "c_cpp.configuration.clangTidy.updateDelay.description": "Controls the delay in milliseconds before clang-tidy starts processing after a modification.", "c_cpp.configuration.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for clang-tidy. If not specified, the build configuration from IntelliSense will be used.", "c_cpp.configuration.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it's explicitly removed.", - "c_cpp.configuration.clangTidy.config.markdownDescription": { - "message": "Specifies a clang-tidy configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, clang-tidy will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", - "comment": ["Normally, text in the \\`\\` are literal values that should not be translated, but `key` and `value` are a special case that should probably be translated, since they're meant to be placeholders."] - }, - "c_cpp.configuration.clangTidy.fallbackConfig.markdownDescription": { - "message": "Specifies a clang-tidy configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", - "comment": ["Normally, text in the \\`\\` are literal values that should not be translated, but `key` and `value` are a special case that should probably be translated, since they're meant to be placeholders."] - }, + "c_cpp.configuration.clangTidy.config.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, clang-tidy will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", + "c_cpp.configuration.clangTidy.fallbackConfig.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", "c_cpp.configuration.clangTidy.fix.description": "Determines when clang-tidy fixes should be automatically applied.", "c_cpp.configuration.clangTidy.fix.disabled.description": "Don't automatically apply clang-tidy fixes.", "c_cpp.configuration.clangTidy.fix.fixIfNoError.description": "Automatically apply clang-tidy fixes if no errors occur.", From abccf51a454a6bca032f7c5d7bf7447de8d3f825 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 30 Jul 2021 17:28:48 -0700 Subject: [PATCH 022/101] More settings fixes. --- Extension/package.json | 14 +++++++------- Extension/package.nls.json | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 88d285c606..7cfeebe577 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -1744,19 +1744,19 @@ "C_Cpp.vcFormat.newLine.beforeCatch": { "type": "boolean", "default": true, - "description": "%c_cpp.configuration.vcFormat.newLine.beforeCatch.description%", + "markdownDescription": "%c_cpp.configuration.vcFormat.newLine.beforeCatch.markdownDescription%", "scope": "resource" }, "C_Cpp.vcFormat.newLine.beforeElse": { "type": "boolean", "default": true, - "description": "%c_cpp.configuration.vcFormat.newLine.beforeElse.description%", + "markdownDescription": "%c_cpp.configuration.vcFormat.newLine.beforeElse.markdownDescription%", "scope": "resource" }, "C_Cpp.vcFormat.newLine.beforeWhileInDoWhile": { "type": "boolean", "default": false, - "description": "%c_cpp.configuration.vcFormat.newLine.beforeWhileInDoWhile.description%", + "markdownDescription": "%c_cpp.configuration.vcFormat.newLine.beforeWhileInDoWhile.markdownDescription%", "scope": "resource" }, "C_Cpp.vcFormat.space.beforeFunctionOpenParenthesis": { @@ -2068,7 +2068,7 @@ "Disabled" ], "default": "Disabled", - "description": "%c_cpp.configuration.intelliSenseEngineFallback.description%", + "markdownDescription": "%c_cpp.configuration.intelliSenseEngineFallback.markdownDescription%", "scope": "resource" }, "C_Cpp.autocomplete": { @@ -2200,7 +2200,7 @@ "anyOf": [ { "type": "string", - "description": "%c_cpp.configuration.commentContinuationPatterns.items.anyof.string.description%" + "markdownDescription": "%c_cpp.configuration.commentContinuationPatterns.items.anyof.string.markdownDescription%" }, { "type": "object", @@ -2238,14 +2238,14 @@ "C_Cpp.intelliSenseCacheSize": { "type": "number", "default": 5120, - "description": "%c_cpp.configuration.intelliSenseCacheSize.description%", + "markdownDescription": "%c_cpp.configuration.intelliSenseCacheSize.markdownDescription%", "scope": "machine-overridable", "minimum": 0 }, "C_Cpp.intelliSenseMemoryLimit": { "type": "number", "default": 4096, - "description": "%c_cpp.configuration.intelliSenseMemoryLimit.description%", + "markdownDescription": "%c_cpp.configuration.intelliSenseMemoryLimit.markdownDescription%", "scope": "machine-overridable", "minimum": 256, "maximum": 16384 diff --git a/Extension/package.nls.json b/Extension/package.nls.json index f1a26c7307..32891ef164 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -70,9 +70,9 @@ "c_cpp.configuration.vcFormat.newLine.scopeBracesOnSeparateLines.description": "Place opening and closing braces for scopes on separate lines.", "c_cpp.configuration.vcFormat.newLine.closeBraceSameLine.emptyType.description": "For empty types, move closing braces to the same line as opening braces.", "c_cpp.configuration.vcFormat.newLine.closeBraceSameLine.emptyFunction.description": "For empty function bodies, move closing braces to the same line as opening braces.", - "c_cpp.configuration.vcFormat.newLine.beforeCatch.description": "Place 'catch' and similar keywords on a new line.", - "c_cpp.configuration.vcFormat.newLine.beforeElse.description": "Place 'else' on a new line.", - "c_cpp.configuration.vcFormat.newLine.beforeWhileInDoWhile.description": "Place 'while' in a do-while loop on a new line.", + "c_cpp.configuration.vcFormat.newLine.beforeCatch.markdownDescription": "Place `catch` and similar keywords on a new line.", + "c_cpp.configuration.vcFormat.newLine.beforeElse.markdownDescription": "Place `else` on a new line.", + "c_cpp.configuration.vcFormat.newLine.beforeWhileInDoWhile.markdownDescription": "Place `while` in a `do`-`while` loop on a new line.", "c_cpp.configuration.vcFormat.space.beforeFunctionOpenParenthesis.description": "Spacing between function names and opening parentheses of argument lists.", "c_cpp.configuration.vcFormat.space.beforeFunctionOpenParenthesis.insert.description": "Add a space before the opening parenthesis of a function.", "c_cpp.configuration.vcFormat.space.beforeFunctionOpenParenthesis.remove.description": "Spaces before opening parenthesis of a function are removed.", @@ -134,11 +134,11 @@ "c_cpp.configuration.clangTidy.runOnBuild.markdownDescription": "If `true`, clang-tidy will run automatically after a build is completed.", "c_cpp.configuration.clangTidy.updateDelay.description": "Controls the delay in milliseconds before clang-tidy starts processing after a modification.", "c_cpp.configuration.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for clang-tidy. If not specified, the build configuration from IntelliSense will be used.", - "c_cpp.configuration.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it's explicitly removed.", + "c_cpp.configuration.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly removed.", "c_cpp.configuration.clangTidy.config.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, clang-tidy will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", "c_cpp.configuration.clangTidy.fallbackConfig.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", "c_cpp.configuration.clangTidy.fix.description": "Determines when clang-tidy fixes should be automatically applied.", - "c_cpp.configuration.clangTidy.fix.disabled.description": "Don't automatically apply clang-tidy fixes.", + "c_cpp.configuration.clangTidy.fix.disabled.description": "Do not automatically apply clang-tidy fixes.", "c_cpp.configuration.clangTidy.fix.fixIfNoError.description": "Automatically apply clang-tidy fixes if no errors occur.", "c_cpp.configuration.clangTidy.fix.fixError.description": "Automatically apply clang-tidy fixes, even if errors occur.", "c_cpp.configuration.clangTidy.args.markdownDescription": "Additional command line arguments to pass to clang-tidy. These take precedence over the equivalent `C_Cpp.clangTidy.*` settings.", @@ -146,7 +146,7 @@ "c_cpp.configuration.intelliSenseEngine.default.description": "Provides context-aware results via a separate IntelliSense process.", "c_cpp.configuration.intelliSenseEngine.tagParser.description": "Provides \"fuzzy\" results that are not context-aware.", "c_cpp.configuration.intelliSenseEngine.disabled.description": "Turns off C/C++ language service features.", - "c_cpp.configuration.intelliSenseEngineFallback.description": "Controls whether the IntelliSense engine will automatically switch to the Tag Parser for translation units containing #include errors.", + "c_cpp.configuration.intelliSenseEngineFallback.markdownDescription": "Controls whether the IntelliSense engine will automatically switch to the Tag Parser for translation units containing `#include` errors.", "c_cpp.configuration.autocomplete.markdownDescription": "Controls the auto-completion provider. If `Disabled` and you want word-based completion, you will also need to set `\"[cpp]\": {\"editor.wordBasedSuggestions\": true}` (and similarly for `c` and `cuda-cpp` languages).", "c_cpp.configuration.autocomplete.default.description": "Uses the active IntelliSense engine.", "c_cpp.configuration.autocomplete.disabled.description": "Uses the word-based completion provided by Visual Studio Code.", @@ -164,14 +164,14 @@ "c_cpp.configuration.exclusionPolicy.checkFilesAndFolders.description": "The exclusion filters will be evaluated against every file and folder encountered.", "c_cpp.configuration.preferredPathSeparator.description": "The character used as a path separator for #include auto-completion results.", "c_cpp.configuration.simplifyStructuredComments.markdownDescription": "If `true`, tooltips of hover and auto-complete will only display certain labels of structured comments. Otherwise, all comments are displayed.", - "c_cpp.configuration.commentContinuationPatterns.items.anyof.string.description": "The pattern that begins a multiline or single line comment block. The continuation pattern defaults to ' * ' for multiline comment blocks or this string for single line comment blocks.", + "c_cpp.configuration.commentContinuationPatterns.items.anyof.string.markdownDescription": "The pattern that begins a multiline or single line comment block. The continuation pattern defaults to ` * ` for multiline comment blocks or this string for single line comment blocks.", "c_cpp.configuration.commentContinuationPatterns.items.anyof.object.begin.description": "The pattern that begins a multiline or single line comment block.", "c_cpp.configuration.commentContinuationPatterns.items.anyof.object.continue.description": "The text that will be inserted on the next line when Enter is pressed inside a multiline or single line comment block.", "c_cpp.configuration.commentContinuationPatterns.description": "Defines the editor behavior for when the Enter key is pressed inside a multiline or single line comment block.", "c_cpp.configuration.configurationWarnings.description": "Determines whether pop up notifications will be shown when a configuration provider extension is unable to provide a configuration for a source file.", "c_cpp.configuration.intelliSenseCachePath.markdownDescription": "Defines the folder path for cached precompiled headers used by IntelliSense. The default cache path is `%LocalAppData%/Microsoft/vscode-cpptools` on Windows, `$XDG_CACHE_HOME/vscode-cpptools/` on Linux (or `$HOME/.cache/vscode-cpptools/` if `XDG_CACHE_HOME` is not defined), and `$HOME/Library/Caches/vscode-cpptools/` on macOS. The default path will be used if no path is specified or if a specified path is invalid.", - "c_cpp.configuration.intelliSenseCacheSize.description": "Maximum size of the per-workspace hard drive space in megabytes (MB) for cached precompiled headers; the actual usage may fluctuate around this value. The default size is 5120 MB. Precompiled header caching is disabled when the size is 0.", - "c_cpp.configuration.intelliSenseMemoryLimit.description": "Memory usage limit in megabytes (MB) of an IntelliSense process. The default limit is 4096 MB and the maximum limit is 16 GB. The extension will shutdown and restart an IntelliSense process when it exceeds the limit.", + "c_cpp.configuration.intelliSenseCacheSize.markdownDescription": "Maximum size of the per-workspace hard drive space in megabytes (MB) for cached precompiled headers; the actual usage may fluctuate around this value. The default size is `5120` MB. Precompiled header caching is disabled when the size is `0`.", + "c_cpp.configuration.intelliSenseMemoryLimit.markdownDescription": "Memory usage limit in megabytes (MB) of an IntelliSense process. The default is `4096` and the maximum is `16384`. The extension will shutdown and restart an IntelliSense process when it exceeds the limit.", "c_cpp.configuration.intelliSenseUpdateDelay.description": "Controls the delay in milliseconds before IntelliSense starts updating after a modification.", "c_cpp.configuration.default.includePath.markdownDescription": "The value to use in a configuration if `includePath` is not specified in `c_cpp_properties.json`. If `includePath` is specified, add `${default}` to the array to insert the values from this setting.", "c_cpp.configuration.default.defines.markdownDescription": "The value to use in a configuration if `defines` is not specified, or the values to insert if `${default}` is present in `defines`.", @@ -197,13 +197,13 @@ "c_cpp.configuration.enhancedColorization.markdownDescription": "If enabled, code is colorized based on IntelliSense. This setting only applies if `#C_Cpp.intelliSenseEngine#` is set to `Default`.", "c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.", "c_cpp.configuration.vcpkg.enabled.markdownDescription": "Enable integration services for the [vcpkg dependency manager](https://aka.ms/vcpkg/).", - "c_cpp.configuration.addNodeAddonIncludePaths.markdownDescription": "Add include paths from `nan` and `node-addon-api` when they're dependencies.", + "c_cpp.configuration.addNodeAddonIncludePaths.markdownDescription": "Add include paths from `nan` and `node-addon-api` when they are dependencies.", "c_cpp.configuration.renameRequiresIdentifier.markdownDescription": "If `true`, 'Rename Symbol' will require a valid C/C++ identifier.", "c_cpp.configuration.autocompleteAddParentheses.markdownDescription": "If `true`, autocomplete will automatically add `(` after function calls, in which case `)` may also be added, depending on the value of the `#editor.autoClosingBrackets#` setting.", "c_cpp.configuration.filesExclude.markdownDescription": "Configure glob patterns for excluding folders (and files if `#C_Cpp.exclusionPolicy#` is changed). These are specific to the C/C++ extension and are in addition to `#files.exclude#`, but unlike `#files.exclude#` they are not removed from the Explorer view. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "c_cpp.configuration.filesExcludeBoolean.markdownDescription": "The glob pattern to match file paths against. Set to `true` or `false` to enable or disable the pattern.", "c_cpp.configuration.filesExcludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", - "c_cpp.configuration.debugger.useBacktickCommandSubstitution.markdownDescription": "If `true`, debugger shell command substitution will use obsolete backtick (\\`).", + "c_cpp.configuration.debugger.useBacktickCommandSubstitution.markdownDescription": "If `true`, debugger shell command substitution will use obsolete backtick (`).", "c_cpp.contributes.views.cppReferencesView.title": "C/C++: Other references results.", "c_cpp.contributes.viewsWelcome.contents": "To learn more about launch.json, see [Configuring C/C++ debugging](https://code.visualstudio.com/docs/cpp/launch-json-reference).", "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).", From 017c6d09bcd2ceecba6d3ef64f1399b4ee430712 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 30 Jul 2021 18:02:48 -0700 Subject: [PATCH 023/101] More settings changes. --- Extension/package.json | 22 ++++++------ Extension/package.nls.json | 36 +++++++++---------- Extension/src/LanguageServer/settings.ts | 12 ++++--- .../src/LanguageServer/settingsTracker.ts | 2 +- 4 files changed, 37 insertions(+), 35 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 7cfeebe577..057536acc0 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -329,17 +329,6 @@ "maximum": 65536, "scope": "machine" }, - "C_Cpp.clang_format_path": { - "type": "string", - "description": "%c_cpp.configuration.clang_format_path.description%", - "scope": "machine-overridable" - }, - "C_Cpp.clang_format_style": { - "type": "string", - "default": "file", - "markdownDescription": "%c_cpp.configuration.clang_format_style.markdownDescription%", - "scope": "resource" - }, "C_Cpp.clangTidy.path": { "type": "string", "description": "%c_cpp.configuration.clangTidy.path.description%", @@ -1510,6 +1499,17 @@ "markdownDescription": "%c_cpp.configuration.clangTidy.checks.markdownDescription%", "scope": "resource" }, + "C_Cpp.clang_format_path": { + "type": "string", + "description": "%c_cpp.configuration.clang_format_path.description%", + "scope": "machine-overridable" + }, + "C_Cpp.clang_format_style": { + "type": "string", + "default": "file", + "markdownDescription": "%c_cpp.configuration.clang_format_style.markdownDescription%", + "scope": "resource" + }, "C_Cpp.formatting": { "type": "string", "enum": [ diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 32891ef164..e2f4ad10d4 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -30,6 +30,24 @@ "c_cpp.configuration.intelliSense.maxMemory.markdownDescription": "Older IntelliSense processes will shutdown before new processes are created after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "c_cpp.configuration.references.maxThreads.markdownDescription": "The maximum number of concurrent threads to use for find all references and rename. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", "c_cpp.configuration.references.maxMemory.markdownDescription": "Fewer find all references and rename processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", + "c_cpp.configuration.clangTidy.maxThreads.markdownDescription": "The maximum number of concurrent theads to use for clang-tidy processing. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", + "c_cpp.configuration.clangTidy.maxMemory.markdownDescription": "Fewer clang-tidy processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", + "c_cpp.configuration.clangTidy.path.description": "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.", + "c_cpp.configuration.clangTidy.exclude.markdownDescription": "Configure glob patterns for excluding folders and files for clang-tidy. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", + "c_cpp.configuration.clangTidy.excludeBoolean.description": "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.", + "c_cpp.configuration.clangTidy.excludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", + "c_cpp.configuration.clangTidy.runInBackground.markdownDescription": "If `true`, clang-tidy will run automatically in the background.", + "c_cpp.configuration.clangTidy.runOnBuild.markdownDescription": "If `true`, clang-tidy will run automatically after a build is completed.", + "c_cpp.configuration.clangTidy.updateDelay.description": "Controls the delay in milliseconds before clang-tidy starts processing after a modification.", + "c_cpp.configuration.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for clang-tidy. If not specified, the build configuration from IntelliSense will be used.", + "c_cpp.configuration.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly removed.", + "c_cpp.configuration.clangTidy.config.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, clang-tidy will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", + "c_cpp.configuration.clangTidy.fallbackConfig.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", + "c_cpp.configuration.clangTidy.fix.description": "Determines when clang-tidy fixes should be automatically applied.", + "c_cpp.configuration.clangTidy.fix.disabled.description": "Do not automatically apply clang-tidy fixes.", + "c_cpp.configuration.clangTidy.fix.fixIfNoError.description": "Automatically apply clang-tidy fixes if no errors occur.", + "c_cpp.configuration.clangTidy.fix.fixError.description": "Automatically apply clang-tidy fixes, even if errors occur.", + "c_cpp.configuration.clangTidy.args.markdownDescription": "Additional command line arguments to pass to clang-tidy. These take precedence over the equivalent `C_Cpp.clangTidy.*` settings.", "c_cpp.configuration.formatting.description": "Configures the formatting engine", "c_cpp.configuration.formatting.clangFormat.description": "clang-format will be used to format code.", "c_cpp.configuration.formatting.vcFormat.description": "The Visual C++ formatting engine will be used to format code.", @@ -124,24 +142,6 @@ "c_cpp.configuration.clang_format_style.markdownDescription": "Coding style, currently supports: `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`. Use `file` to load the style from a `.clang-format` file in the current or parent directory. Use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", "c_cpp.configuration.clang_format_fallbackStyle.markdownDescription": "Name of the predefined style used as a fallback in case clang-format is invoked with style `file` but the `.clang-format` file is not found. Possible values are `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`, `none`, or use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", "c_cpp.configuration.clang_format_sortIncludes.markdownDescription": "If set, overrides the include sorting behavior determined by the `SortIncludes` parameter.", - "c_cpp.configuration.clangTidy.maxThreads.markdownDescription": "The maximum number of concurrent theads to use for clang-tidy processing. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", - "c_cpp.configuration.clangTidy.maxMemory.markdownDescription": "Fewer clang-tidy processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", - "c_cpp.configuration.clangTidy.path.description": "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.", - "c_cpp.configuration.clangTidy.exclude.markdownDescription": "Configure glob patterns for excluding folders and files for clang-tidy. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", - "c_cpp.configuration.clangTidy.excludeBoolean.description": "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.", - "c_cpp.configuration.clangTidy.excludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", - "c_cpp.configuration.clangTidy.runInBackground.markdownDescription": "If `true`, clang-tidy will run automatically in the background.", - "c_cpp.configuration.clangTidy.runOnBuild.markdownDescription": "If `true`, clang-tidy will run automatically after a build is completed.", - "c_cpp.configuration.clangTidy.updateDelay.description": "Controls the delay in milliseconds before clang-tidy starts processing after a modification.", - "c_cpp.configuration.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for clang-tidy. If not specified, the build configuration from IntelliSense will be used.", - "c_cpp.configuration.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly removed.", - "c_cpp.configuration.clangTidy.config.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, clang-tidy will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", - "c_cpp.configuration.clangTidy.fallbackConfig.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", - "c_cpp.configuration.clangTidy.fix.description": "Determines when clang-tidy fixes should be automatically applied.", - "c_cpp.configuration.clangTidy.fix.disabled.description": "Do not automatically apply clang-tidy fixes.", - "c_cpp.configuration.clangTidy.fix.fixIfNoError.description": "Automatically apply clang-tidy fixes if no errors occur.", - "c_cpp.configuration.clangTidy.fix.fixError.description": "Automatically apply clang-tidy fixes, even if errors occur.", - "c_cpp.configuration.clangTidy.args.markdownDescription": "Additional command line arguments to pass to clang-tidy. These take precedence over the equivalent `C_Cpp.clangTidy.*` settings.", "c_cpp.configuration.intelliSenseEngine.description": "Controls the IntelliSense provider.", "c_cpp.configuration.intelliSenseEngine.default.description": "Provides context-aware results via a separate IntelliSense process.", "c_cpp.configuration.intelliSenseEngine.tagParser.description": "Provides \"fuzzy\" results that are not context-aware.", diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 1cfcf116f0..0cebab705a 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -135,12 +135,14 @@ export class CppSettings extends Settings { return path; } - public get maxThreads(): number | undefined { return super.Section.get("maxThreads"); } - public get maxMemory(): number | undefined { return super.Section.get("maxMemory"); } - public get intelliSenseMaxThreads(): number | undefined { return super.Section.get("intelliSense.maxThreads"); } - public get intelliSenseMaxMemory(): number | undefined { return super.Section.get("intelliSense.maxMemory"); } - public get referencesMaxThreads(): number | undefined { return super.Section.get("references.maxThreads"); } + public get maxThreads(): number | undefined | null { return super.Section.get("maxThreads"); } + public get maxMemory(): number | undefined | null { return super.Section.get("maxMemory"); } + public get intelliSenseMaxThreads(): number | undefined | null { return super.Section.get("intelliSense.maxThreads"); } + public get intelliSenseMaxMemory(): number | undefined | null { return super.Section.get("intelliSense.maxMemory"); } + public get referencesMaxThreads(): number | undefined | null { return super.Section.get("references.maxThreads"); } + public get referencesMaxMemory(): number | undefined | null { return super.Section.get("references.maxMemory"); } public get clangTidyMaxThreads(): number | undefined { return super.Section.get("clangTidy.maxThreads"); } + public get clangTidyMaxMemory(): number | undefined { return super.Section.get("clangTidy.maxMemory"); } public get clangTidyExclude(): vscode.WorkspaceConfiguration | undefined { return super.Section.get("clangTidy.exclude"); } public get clangFormatStyle(): string | undefined { return super.Section.get("clang_format_style"); } public get clangFormatFallbackStyle(): string | undefined { return super.Section.get("clang_format_fallbackStyle"); } diff --git a/Extension/src/LanguageServer/settingsTracker.ts b/Extension/src/LanguageServer/settingsTracker.ts index 9c7fccc834..05d01677ee 100644 --- a/Extension/src/LanguageServer/settingsTracker.ts +++ b/Extension/src/LanguageServer/settingsTracker.ts @@ -177,7 +177,7 @@ export class SettingsTracker { break; } default: { - if (key === "clang_format_path" || key === "clangTidy.path" || key === "intelliSenseCachePath" || key.startsWith("default.")) { + if (key === "clang_format_path" || key === "clangTidy.path" || key === "clangTidy.buildPath" || key === "intelliSenseCachePath" || key.startsWith("default.")) { value = this.areEqual(val, settings.inspect(key)?.defaultValue) ? "" : "..."; // Track whether it's being used, but nothing specific about it. } else { value = String(this.previousCppSettings[key]); From c269c8bf31934c795975500258ce5a71415515cc Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 2 Aug 2021 19:16:58 -0700 Subject: [PATCH 024/101] More settings changes. --- Extension/package.json | 42 ++++++++++++++++++------ Extension/package.nls.json | 16 +++++---- Extension/src/LanguageServer/client.ts | 12 ++++--- Extension/src/LanguageServer/settings.ts | 10 +++--- 4 files changed, 54 insertions(+), 26 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 057536acc0..025dd2e72c 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -241,17 +241,28 @@ "type": "object", "title": "C/C++", "properties": { - "C_Cpp.maxThreads": { + "C_Cpp.maxConcurrentThreads": { "type": [ "integer", "null" ], - "markdownDescription": "%c_cpp.configuration.maxThreads.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.maxConcurrentThreads.markdownDescription%", "default": null, - "minimum": 2, + "minimum": 1, "maximum": 32, "scope": "machine" }, + "C_Cpp.maxCachedProcesses": { + "type": [ + "integer", + "null" + ], + "markdownDescription": "%c_cpp.configuration.maxCachedProcesses.markdownDescription%", + "default": null, + "minimum": 0, + "maximum": 64, + "scope": "machine" + }, "C_Cpp.maxMemory": { "type": [ "integer", @@ -263,14 +274,14 @@ "maximum": 65536, "scope": "machine" }, - "C_Cpp.intelliSense.maxThreads": { + "C_Cpp.intelliSense.maxCachedProcesses": { "type": [ "integer", "null" ], "markdownDescription": "%c_cpp.configuration.intelliSense.maxThreads.markdownDescription%", "default": null, - "minimum": 3, + "minimum": 2, "maximum": 32, "scope": "machine" }, @@ -285,17 +296,28 @@ "maximum": 65536, "scope": "machine" }, - "C_Cpp.references.maxThreads": { + "C_Cpp.references.maxConcurrentThreads": { "type": [ "integer", "null" ], - "markdownDescription": "%c_cpp.configuration.references.maxThreads.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.references.maxConcurrentThreads.markdownDescription%", "default": null, "minimum": 1, "maximum": 32, "scope": "machine" }, + "C_Cpp.references.maxCachedProcesses": { + "type": [ + "integer", + "null" + ], + "markdownDescription": "%c_cpp.configuration.references.maxCachedProcesses.markdownDescription%", + "default": null, + "minimum": 0, + "maximum": 32, + "scope": "machine" + }, "C_Cpp.references.maxMemory": { "type": [ "integer", @@ -307,14 +329,14 @@ "maximum": 65536, "scope": "machine" }, - "C_Cpp.clangTidy.maxThreads": { + "C_Cpp.clangTidy.maxConcurrentThreads": { "type": [ "integer", "null" ], - "markdownDescription": "%c_cpp.configuration.clangTidy.maxThreads.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.clangTidy.maxConcurrentThreads.markdownDescription%", "default": null, - "minimum": 2, + "minimum": 1, "maximum": 32, "scope": "machine" }, diff --git a/Extension/package.nls.json b/Extension/package.nls.json index e2f4ad10d4..00fc618036 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -24,13 +24,15 @@ "c_cpp.command.RunClangTidyOnActiveFile.title": "Run clang-tidy on the active file", "c_cpp.command.RunClangTidyOnOpenFiles.title": "Run clang-tidy on all open files", "c_cpp.command.RunClangTidyOnAllFiles.title": "Run clang-tidy on all source files", - "c_cpp.configuration.maxThreads.markdownDescription": "The maximum number of concurrent threads to use for language service processing. The default of `null` uses the number of logical processors available.", - "c_cpp.configuration.maxMemory.markdownDescription": "The maximum memory (in MB) available for language service processing. Fewer processes will run concurrently after this memory usage is exceeded. The default of `null` uses the system's free memory.", - "c_cpp.configuration.intelliSense.maxThreads.markdownDescription": "The maximum number of concurrent threads to use for IntelliSense processing. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", - "c_cpp.configuration.intelliSense.maxMemory.markdownDescription": "Older IntelliSense processes will shutdown before new processes are created after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", - "c_cpp.configuration.references.maxThreads.markdownDescription": "The maximum number of concurrent threads to use for find all references and rename. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", - "c_cpp.configuration.references.maxMemory.markdownDescription": "Fewer find all references and rename processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", - "c_cpp.configuration.clangTidy.maxThreads.markdownDescription": "The maximum number of concurrent theads to use for clang-tidy processing. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", + "c_cpp.configuration.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may not always be used. The default of `null` uses the number of logical processors available.", + "c_cpp.configuration.maxCachedProcesses.markdownDescription": "The maximum number of cached processes to use for language service processing. The default of `null` uses twice the number of logical processors available.", + "c_cpp.configuration.maxMemory.markdownDescription": "The maximum memory (in MB) available for language service processing. Fewer processes will be cached and run concurrently after this memory usage is exceeded. The default of `null` uses the system's free memory.", + "c_cpp.configuration.intelliSense.maxCachedProcesses.markdownDescription": "The maximum number of IntelliSense processes to cache. The default of `null` uses the value inherited from `#C_Cpp.maxCachedProcesses#`.", + "c_cpp.configuration.intelliSense.maxMemory.markdownDescription": "Older IntelliSense processes will shut down before new processes are created after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", + "c_cpp.configuration.references.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", + "c_cpp.configuration.references.maxCachedProcesses.markdownDescription": "The maximum number of processes to keep in memory for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxCachedProcesses#`.", + "c_cpp.configuration.references.maxMemory.markdownDescription": "Fewer 'Find All References' and 'Rename' processes will be cached and run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", + "c_cpp.configuration.clangTidy.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for clang-tidy processing. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", "c_cpp.configuration.clangTidy.maxMemory.markdownDescription": "Fewer clang-tidy processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "c_cpp.configuration.clangTidy.path.description": "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.", "c_cpp.configuration.clangTidy.exclude.markdownDescription": "Configure glob patterns for excluding folders and files for clang-tidy. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index c5566f3691..4a324248a4 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1205,15 +1205,17 @@ export class DefaultClient implements Client { { scheme: 'file', language: 'cuda-cpp' } ], initializationOptions: { - maxThreads: workspaceSettings.maxThreads, + maxConcurrentThreads: workspaceSettings.maxConcurrentThreads, + maxCachedProcesses: workspaceSettings.maxCachedProcesses, maxMemory: workspaceSettings.maxMemory ?? os.freemem() / 1048576, - intelliSenseMaxThreads: workspaceSettings.intelliSenseMaxThreads, + intelliSenseMaxCachedProcesses: workspaceSettings.intelliSenseMaxCachedProcesses, intelliSenseMaxMemory: workspaceSettings.intelliSenseMaxMemory, - referencesMaxThreads: workspaceSettings.referencesMaxThreads, + referencesMaxConcurrentThreads: workspaceSettings.maxConcurrentThreads, + referencesMaxCachedProcesses: workspaceSettings.referencesMaxCachedProcesses, + clangTidyMaxConcurrentThreads: workspaceSettings.clangTidyMaxConcurrentThreads, + clangTidyPath: settings_clangTidyPath, clang_format_path: settings_clangFormatPath, clang_format_style: settings_clangFormatStyle, - clangTidyPath: settings_clangTidyPath, - clangTidyMaxThreads: workspaceSettings.clangTidyMaxThreads, formatting: settings_formattingEngine, vcFormat: { indent: { diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 0cebab705a..1593f94214 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -135,13 +135,15 @@ export class CppSettings extends Settings { return path; } - public get maxThreads(): number | undefined | null { return super.Section.get("maxThreads"); } + public get maxConcurrentThreads(): number | undefined | null { return super.Section.get("maxConcurrentThreads"); } + public get maxCachedProcesses(): number | undefined | null { return super.Section.get("maxCachedProcesses"); } public get maxMemory(): number | undefined | null { return super.Section.get("maxMemory"); } - public get intelliSenseMaxThreads(): number | undefined | null { return super.Section.get("intelliSense.maxThreads"); } + public get intelliSenseMaxCachedProcesses(): number | undefined | null { return super.Section.get("intelliSense.maxCachedProcesses"); } public get intelliSenseMaxMemory(): number | undefined | null { return super.Section.get("intelliSense.maxMemory"); } - public get referencesMaxThreads(): number | undefined | null { return super.Section.get("references.maxThreads"); } + public get referencesMaxConcurrentThreads(): number | undefined | null { return super.Section.get("references.maxConcurrentThreads"); } + public get referencesMaxCachedProcesses(): number | undefined | null { return super.Section.get("references.maxCachedProcesses"); } public get referencesMaxMemory(): number | undefined | null { return super.Section.get("references.maxMemory"); } - public get clangTidyMaxThreads(): number | undefined { return super.Section.get("clangTidy.maxThreads"); } + public get clangTidyMaxConcurrentThreads(): number | undefined { return super.Section.get("clangTidy.maxConcurrentThreads"); } public get clangTidyMaxMemory(): number | undefined { return super.Section.get("clangTidy.maxMemory"); } public get clangTidyExclude(): vscode.WorkspaceConfiguration | undefined { return super.Section.get("clangTidy.exclude"); } public get clangFormatStyle(): string | undefined { return super.Section.get("clang_format_style"); } From 87b4c107d23182df6cef06530fcbea0a3c9bf585 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 3 Aug 2021 17:06:35 -0700 Subject: [PATCH 025/101] Switch more things to "code analysis". --- Extension/package.json | 81 ++++++++++--------- Extension/package.nls.json | 44 +++++----- Extension/src/LanguageServer/client.ts | 34 ++++---- Extension/src/LanguageServer/extension.ts | 18 ++--- Extension/src/LanguageServer/settings.ts | 9 ++- .../src/LanguageServer/settingsTracker.ts | 2 +- Extension/src/commands.ts | 6 +- Extension/src/main.ts | 6 +- 8 files changed, 103 insertions(+), 97 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 025dd2e72c..46208108a3 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -329,42 +329,47 @@ "maximum": 65536, "scope": "machine" }, - "C_Cpp.clangTidy.maxConcurrentThreads": { + "C_Cpp.codeAnalysis.maxConcurrentThreads": { "type": [ "integer", "null" ], - "markdownDescription": "%c_cpp.configuration.clangTidy.maxConcurrentThreads.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription%", "default": null, "minimum": 1, "maximum": 32, "scope": "machine" }, - "C_Cpp.clangTidy.maxMemory": { + "C_Cpp.codeAnalysis.maxMemory": { "type": [ "integer", "null" ], - "markdownDescription": "%c_cpp.configuration.clangTidy.maxMemory.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription%", "default": null, "minimum": 256, "maximum": 65536, "scope": "machine" }, - "C_Cpp.clangTidy.path": { + "C_Cpp.codeAnalysis.enableClangTidy": { + "type": "boolean", + "default": false, + "scope": "resource" + }, + "C_Cpp.codeAnalysis.clangTidy.path": { "type": "string", - "description": "%c_cpp.configuration.clangTidy.path.description%", + "description": "%c_cpp.configuration.codeAnalysis.clangTidy.path.description%", "scope": "machine-overridable" }, - "C_Cpp.clangTidy.exclude": { + "C_Cpp.codeAnalysis.exclude": { "type": "object", - "markdownDescription": "%c_cpp.configuration.clangTidy.exclude.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.exclude.markdownDescription%", "default": {}, "additionalProperties": { "anyOf": [ { "type": "boolean", - "description": "%c_cpp.configuration.clangTidy.excludeBoolean.description%" + "description": "%c_cpp.configuration.codeAnalysis.excludeBoolean.description%" }, { "type": "object", @@ -373,7 +378,7 @@ "type": "string", "pattern": "\\w*\\$\\(basename\\)\\w*", "default": "$(basename).ext", - "markdownDescription": "%c_cpp.configuration.clangTidy.excludeWhen.markdownDescription%" + "markdownDescription": "%c_cpp.configuration.codeAnalysis.excludeWhen.markdownDescription%" } } } @@ -381,42 +386,42 @@ }, "scope": "resource" }, - "C_Cpp.clangTidy.runInBackground": { + "C_Cpp.codeAnalysis.runInBackground": { "type": "boolean", - "markdownDescription": "%c_cpp.configuration.clangTidy.runInBackground.markdownDescription%", - "default": false, + "markdownDescription": "%c_cpp.configuration.codeAnalysis.runInBackground.markdownDescription%", + "default": true, "scope": "application" }, - "C_Cpp.clangTidy.updateDelay": { + "C_Cpp.codeAnalysis.updateDelay": { "type": "number", "default": 3000, - "description": "%c_cpp.configuration.clangTidy.updateDelay.description%", + "description": "%c_cpp.configuration.codeAnalysis.updateDelay.description%", "scope": "application", "minimum": 1000, "maximum": 5000 }, - "C_Cpp.clangTidy.runOnBuild": { + "C_Cpp.codeAnalysis.runOnBuild": { "type": "boolean", - "markdownDescription": "%c_cpp.configuration.clangTidy.runOnBuild.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription%", "default": false, "scope": "application" }, - "C_Cpp.clangTidy.buildPath": { + "C_Cpp.codeAnalysis.clangTidy.buildPath": { "type": "string", - "markdownDescription": "%c_cpp.configuration.clangTidy.buildPath.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription%", "scope": "machine-overridable" }, - "C_Cpp.clangTidy.config": { + "C_Cpp.codeAnalysis.clangTidy.config": { "type": "string", - "markdownDescription": "%c_cpp.configuration.clangTidy.config.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription%", "scope": "resource" }, - "C_Cpp.clangTidy.fallbackConfig": { + "C_Cpp.codeAnalysis.clangTidy.fallbackConfig": { "type": "string", - "markdownDescription": "%c_cpp.configuration.clangTidy.fallbackConfig.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription%", "scope": "resource" }, - "C_Cpp.clangTidy.fix": { + "C_Cpp.codeAnalysis.clangTidy.fix": { "type": "string", "enum": [ "Disabled", @@ -424,20 +429,20 @@ "FixErrors" ], "default": "Disabled", - "description": "%c_cpp.configuration.clangTidy.fix.description%", + "description": "%c_cpp.configuration.codeAnalysis.clangTidy.fix.description%", "enumDescriptions": [ - "%c_cpp.configuration.clangTidy.fix.disabled.description%", - "%c_cpp.configuration.clangTidy.fix.fixIfNoError.description%", - "%c_cpp.configuration.clangTidy.fix.fixError.description%" + "%c_cpp.configuration.codeAnalysis.clangTidy.fix.disabled.description%", + "%c_cpp.configuration.codeAnalysis.clangTidy.fix.fixIfNoError.description%", + "%c_cpp.configuration.codeAnalysis.clangTidy.fix.fixError.description%" ], "scope": "resource" }, - "C_Cpp.clangTidy.args": { + "C_Cpp.codeAnalysis.clangTidy.args": { "type": "string", - "markdownDescription": "%c_cpp.configuration.clangTidy.args.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription%", "scope": "resource" }, - "C_Cpp.clangTidy.checks": { + "C_Cpp.codeAnalysis.clangTidy.checks": { "type": "array", "items": { "type": "string", @@ -1518,7 +1523,7 @@ "-zircon-temporary-objects" ] }, - "markdownDescription": "%c_cpp.configuration.clangTidy.checks.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.checks.markdownDescription%", "scope": "resource" }, "C_Cpp.clang_format_path": { @@ -2692,18 +2697,18 @@ "category": "C/C++" }, { - "command": "C_Cpp.RunClangTidyOnActiveFile", - "title": "%c_cpp.command.RunClangTidyOnActiveFile.title%", + "command": "C_Cpp.RunCodeAnalysisOnActiveFile", + "title": "%c_cpp.command.RunCodeAnalysisOnActiveFile.title%", "category": "C/C++" }, { - "command": "C_Cpp.RunClangTidyOnOpenFiles", - "title": "%c_cpp.command.RunClangTidyOnOpenFiles.title%", + "command": "C_Cpp.RunCodeAnalysisOnOpenFiles", + "title": "%c_cpp.command.RunCodeAnalysisOnOpenFiles.title%", "category": "C/C++" }, { - "command": "C_Cpp.RunClangTidyOnAllFiles", - "title": "%c_cpp.command.RunClangTidyOnAllFiles.title%", + "command": "C_Cpp.RunCodeAnalysisOnAllFiles", + "title": "%c_cpp.command.RunCodeAnalysisOnAllFiles.title%", "category": "C/C++" } ], diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 00fc618036..12327f0cc7 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -1,5 +1,5 @@ { - "c_cpp.capabilities.untrustedWorkspaces.description": "Multiple settings can cause processes local to the workspace to be executed, e.g. C_Cpp.clang_format_path, C_Cpp.clangTidy.path, C_Cpp.addNodeAddonIncludePaths, C_Cpp.default.compilerPath, C_Cpp.default.configurationProvider, and C_Cpp.default.compileCommands, and the equivalent properties in c_cpp_properties.json.", + "c_cpp.capabilities.untrustedWorkspaces.description": "Multiple settings can cause processes local to the workspace to be executed, e.g. C_Cpp.clang_format_path, C_Cpp.codeAnalysis.clangTidy.path, C_Cpp.addNodeAddonIncludePaths, C_Cpp.default.compilerPath, C_Cpp.default.configurationProvider, and C_Cpp.default.compileCommands, and the equivalent properties in c_cpp_properties.json.", "c_cpp.command.configurationSelect.title": "Select a Configuration...", "c_cpp.command.configurationProviderSelect.title": "Change Configuration Provider...", "c_cpp.command.configurationEditJSON.title": "Edit Configurations (JSON)", @@ -21,9 +21,9 @@ "c_cpp.command.generateEditorConfig.title": "Generate EditorConfig contents from VC Format settings", "c_cpp.command.GoToNextDirectiveInGroup.title": "Go to next preprocessor directive in conditional group", "c_cpp.command.GoToPrevDirectiveInGroup.title": "Go to previous preprocessor directive in conditional group", - "c_cpp.command.RunClangTidyOnActiveFile.title": "Run clang-tidy on the active file", - "c_cpp.command.RunClangTidyOnOpenFiles.title": "Run clang-tidy on all open files", - "c_cpp.command.RunClangTidyOnAllFiles.title": "Run clang-tidy on all source files", + "c_cpp.command.RunCodeAnalysisOnActiveFile.title": "Run code analysis on the active file", + "c_cpp.command.RunCodeAnalysisOnOpenFiles.title": "Run code analysis on all open files", + "c_cpp.command.RunCodeAnalysisOnAllFiles.title": "Run code analysis on all source files", "c_cpp.configuration.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may not always be used. The default of `null` uses the number of logical processors available.", "c_cpp.configuration.maxCachedProcesses.markdownDescription": "The maximum number of cached processes to use for language service processing. The default of `null` uses twice the number of logical processors available.", "c_cpp.configuration.maxMemory.markdownDescription": "The maximum memory (in MB) available for language service processing. Fewer processes will be cached and run concurrently after this memory usage is exceeded. The default of `null` uses the system's free memory.", @@ -32,24 +32,24 @@ "c_cpp.configuration.references.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "c_cpp.configuration.references.maxCachedProcesses.markdownDescription": "The maximum number of processes to keep in memory for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxCachedProcesses#`.", "c_cpp.configuration.references.maxMemory.markdownDescription": "Fewer 'Find All References' and 'Rename' processes will be cached and run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", - "c_cpp.configuration.clangTidy.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for clang-tidy processing. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", - "c_cpp.configuration.clangTidy.maxMemory.markdownDescription": "Fewer clang-tidy processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", - "c_cpp.configuration.clangTidy.path.description": "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.", - "c_cpp.configuration.clangTidy.exclude.markdownDescription": "Configure glob patterns for excluding folders and files for clang-tidy. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", - "c_cpp.configuration.clangTidy.excludeBoolean.description": "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.", - "c_cpp.configuration.clangTidy.excludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", - "c_cpp.configuration.clangTidy.runInBackground.markdownDescription": "If `true`, clang-tidy will run automatically in the background.", - "c_cpp.configuration.clangTidy.runOnBuild.markdownDescription": "If `true`, clang-tidy will run automatically after a build is completed.", - "c_cpp.configuration.clangTidy.updateDelay.description": "Controls the delay in milliseconds before clang-tidy starts processing after a modification.", - "c_cpp.configuration.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for clang-tidy. If not specified, the build configuration from IntelliSense will be used.", - "c_cpp.configuration.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly removed.", - "c_cpp.configuration.clangTidy.config.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, clang-tidy will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", - "c_cpp.configuration.clangTidy.fallbackConfig.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", - "c_cpp.configuration.clangTidy.fix.description": "Determines when clang-tidy fixes should be automatically applied.", - "c_cpp.configuration.clangTidy.fix.disabled.description": "Do not automatically apply clang-tidy fixes.", - "c_cpp.configuration.clangTidy.fix.fixIfNoError.description": "Automatically apply clang-tidy fixes if no errors occur.", - "c_cpp.configuration.clangTidy.fix.fixError.description": "Automatically apply clang-tidy fixes, even if errors occur.", - "c_cpp.configuration.clangTidy.args.markdownDescription": "Additional command line arguments to pass to clang-tidy. These take precedence over the equivalent `C_Cpp.clangTidy.*` settings.", + "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for code analysis. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", + "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", + "c_cpp.configuration.codeAnalysis.exclude.markdownDescription": "Configure glob patterns for excluding folders and files for code analysis. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", + "c_cpp.configuration.codeAnalysis.excludeBoolean.description": "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.", + "c_cpp.configuration.codeAnalysis.excludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", + "c_cpp.configuration.codeAnalysis.runInBackground.markdownDescription": "If `true`, code analysis will run automatically in the background.", + "c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription": "If `true`, code analysis will run automatically after a build is completed.", + "c_cpp.configuration.codeAnalysis.updateDelay.description": "Controls the delay in milliseconds before code analysis starts processing after a modification.", + "c_cpp.configuration.codeAnalysis.clangTidy.path.description": "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.", + "c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for clang-tidy. If not specified, the build configuration from IntelliSense will be used.", + "c_cpp.configuration.codeAnalysis.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly removed.", + "c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, clang-tidy will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", + "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", + "c_cpp.configuration.codeAnalysis.clangTidy.fix.description": "Determines when clang-tidy fixes should be automatically applied.", + "c_cpp.configuration.codeAnalysis.clangTidy.fix.disabled.description": "Do not automatically apply clang-tidy fixes.", + "c_cpp.configuration.codeAnalysis.clangTidy.fix.fixIfNoError.description": "Automatically apply clang-tidy fixes if no errors occur.", + "c_cpp.configuration.codeAnalysis.clangTidy.fix.fixError.description": "Automatically apply clang-tidy fixes, even if errors occur.", + "c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription": "Additional command line arguments to pass to clang-tidy. These take precedence over the equivalent `C_Cpp.codeAnalysis.clangTidy.*` settings.", "c_cpp.configuration.formatting.description": "Configures the formatting engine", "c_cpp.configuration.formatting.clangFormat.description": "clang-format will be used to format code.", "c_cpp.configuration.formatting.vcFormat.description": "The Visual C++ formatting engine will be used to format code.", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 4a324248a4..7172fd4291 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -505,7 +505,7 @@ const FindAllReferencesNotification: NotificationType = new NotificationType('cpptools/rename'); const DidChangeSettingsNotification: NotificationType = new NotificationType('cpptools/didChangeSettings'); const AbortRequestNotification: NotificationType = new NotificationType('cpptools/abortRequest'); -const ClangTidyNotification: NotificationType = new NotificationType('cpptools/runClangTidy'); +const CodeAnalysisNotification: NotificationType = new NotificationType('cpptools/runCodeAnalysis'); // Notifications from the server const ReloadWindowNotification: NotificationType = new NotificationType('cpptools/reloadWindow'); @@ -655,9 +655,9 @@ export interface Client { handleAddToIncludePathCommand(path: string): void; handleGoToDirectiveInGroup(next: boolean): Promise; handleCheckForCompiler(): Promise; - handleRunClangTidyOnActiveFile(): Promise; - handleRunClangTidyOnOpenFiles(): Promise; - handleRunClangTidyOnAllFiles(): Promise; + handleRunCodeAnalysisOnActiveFile(): Promise; + handleRunCodeAnalysisOnOpenFiles(): Promise; + handleRunCodeAnalysisOnAllFiles(): Promise; onInterval(): void; dispose(): void; addFileAssociations(fileAssociations: string, languageId: string): void; @@ -997,7 +997,7 @@ export class DefaultClient implements Client { const settings_clangFormatFallbackStyle: (string | undefined)[] = []; const settings_clangFormatSortIncludes: (string | undefined)[] = []; const settings_clangTidyPath: (string | undefined)[] = []; - const settings_clangTidyExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; + const settings_codeAnalysisExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; const settings_filesEncoding: (string | undefined)[] = []; const settings_cppFilesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; const settings_filesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; @@ -1096,7 +1096,7 @@ export class DefaultClient implements Client { for (const setting of settings) { settings_clangFormatPath.push(util.resolveVariables(setting.clangFormatPath, this.AdditionalEnvironment)); settings_clangTidyPath.push(util.resolveVariables(setting.clangTidyPath, this.AdditionalEnvironment)); - settings_clangTidyExclude.push(setting.clangTidyExclude); + settings_codeAnalysisExclude.push(setting.codeAnalysisExclude); settings_formattingEngine.push(setting.formattingEngine); settings_indentBraces.push(setting.vcFormatIndentBraces); settings_indentWithinParentheses.push(setting.vcFormatIndentWithinParentheses); @@ -1212,8 +1212,9 @@ export class DefaultClient implements Client { intelliSenseMaxMemory: workspaceSettings.intelliSenseMaxMemory, referencesMaxConcurrentThreads: workspaceSettings.maxConcurrentThreads, referencesMaxCachedProcesses: workspaceSettings.referencesMaxCachedProcesses, - clangTidyMaxConcurrentThreads: workspaceSettings.clangTidyMaxConcurrentThreads, + codeAnalysisMaxConcurrentThreads: workspaceSettings.codeAnalysisMaxConcurrentThreads, clangTidyPath: settings_clangTidyPath, + codeAnalysisExclude: settings_codeAnalysisExclude, clang_format_path: settings_clangFormatPath, clang_format_style: settings_clangFormatStyle, formatting: settings_formattingEngine, @@ -1300,7 +1301,6 @@ export class DefaultClient implements Client { autoClosingBrackets: settings_editorAutoClosingBrackets }, workspace_fallback_encoding: workspaceOtherSettings.filesEncoding, - clang_tidy_exclude_files: settings_clangTidyExclude, cpp_exclude_files: settings_cppFilesExclude, exclude_files: settings_filesExclude, exclude_search: settings_searchExclude, @@ -2830,19 +2830,19 @@ export class DefaultClient implements Client { } } - public async handleRunClangTidyOnActiveFile(): Promise { + public async handleRunCodeAnalysisOnActiveFile(): Promise { await this.awaitUntilLanguageClientReady(); - this.languageClient.sendNotification(ClangTidyNotification, CodeAnalysisScope.ActiveFile); + this.languageClient.sendNotification(CodeAnalysisNotification, CodeAnalysisScope.ActiveFile); } - public async handleRunClangTidyOnOpenFiles(): Promise { + public async handleRunCodeAnalysisOnOpenFiles(): Promise { await this.awaitUntilLanguageClientReady(); - this.languageClient.sendNotification(ClangTidyNotification, CodeAnalysisScope.OpenFiles); + this.languageClient.sendNotification(CodeAnalysisNotification, CodeAnalysisScope.OpenFiles); } - public async handleRunClangTidyOnAllFiles(): Promise { + public async handleRunCodeAnalysisOnAllFiles(): Promise { await this.awaitUntilLanguageClientReady(); - this.languageClient.sendNotification(ClangTidyNotification, CodeAnalysisScope.AllFiles); + this.languageClient.sendNotification(CodeAnalysisNotification, CodeAnalysisScope.AllFiles); } public onInterval(): void { @@ -3022,9 +3022,9 @@ class NullClient implements Client { handleAddToIncludePathCommand(path: string): void { } handleGoToDirectiveInGroup(next: boolean): Promise { return Promise.resolve(); } handleCheckForCompiler(): Promise { return Promise.resolve(); } - handleRunClangTidyOnActiveFile(): Promise { return Promise.resolve(); } - handleRunClangTidyOnOpenFiles(): Promise { return Promise.resolve(); } - handleRunClangTidyOnAllFiles(): Promise { return Promise.resolve(); } + handleRunCodeAnalysisOnActiveFile(): Promise { return Promise.resolve(); } + handleRunCodeAnalysisOnOpenFiles(): Promise { return Promise.resolve(); } + handleRunCodeAnalysisOnAllFiles(): Promise { return Promise.resolve(); } onInterval(): void { } dispose(): void { this.booleanEvent.dispose(); diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index c84c4680a5..d08bb8d6f4 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -793,9 +793,9 @@ export function registerCommands(): void { disposables.push(vscode.commands.registerCommand('C_Cpp.GoToNextDirectiveInGroup', onGoToNextDirectiveInGroup)); disposables.push(vscode.commands.registerCommand('C_Cpp.GoToPrevDirectiveInGroup', onGoToPrevDirectiveInGroup)); disposables.push(vscode.commands.registerCommand('C_Cpp.CheckForCompiler', onCheckForCompiler)); - disposables.push(vscode.commands.registerCommand('C_Cpp.RunClangTidyOnActiveFile', onRunClangTidyOnActiveFile)); - disposables.push(vscode.commands.registerCommand('C_Cpp.RunClangTidyOnOpenFiles', onRunClangTidyOnOpenFiles)); - disposables.push(vscode.commands.registerCommand('C_Cpp.RunClangTidyOnAllFiles', onRunClangTidyOnAllFiles)); + disposables.push(vscode.commands.registerCommand('C_Cpp.RunCodeAnalysisOnActiveFile', onRunCodeAnalysisOnActiveFile)); + disposables.push(vscode.commands.registerCommand('C_Cpp.RunCodeAnalysisOnOpenFiles', onRunCodeAnalysisOnOpenFiles)); + disposables.push(vscode.commands.registerCommand('C_Cpp.RunCodeAnalysisOnAllFiles', onRunCodeAnalysisOnAllFiles)); disposables.push(vscode.commands.registerCommand('cpptools.activeConfigName', onGetActiveConfigName)); disposables.push(vscode.commands.registerCommand('cpptools.activeConfigCustomVariable', onGetActiveConfigCustomVariable)); disposables.push(vscode.commands.registerCommand('cpptools.setActiveConfigName', onSetActiveConfigName)); @@ -947,23 +947,23 @@ function onCheckForCompiler(): void { client.handleCheckForCompiler(); } -function onRunClangTidyOnActiveFile(): void { +function onRunCodeAnalysisOnActiveFile(): void { onActivationEvent(); if (activeDocument !== "") { - getActiveClient().handleRunClangTidyOnActiveFile(); + getActiveClient().handleRunCodeAnalysisOnActiveFile(); } } -function onRunClangTidyOnOpenFiles(): void { +function onRunCodeAnalysisOnOpenFiles(): void { onActivationEvent(); if (openFileVersions.size > 0) { - getActiveClient().handleRunClangTidyOnOpenFiles(); + getActiveClient().handleRunCodeAnalysisOnOpenFiles(); } } -function onRunClangTidyOnAllFiles(): void { +function onRunCodeAnalysisOnAllFiles(): void { onActivationEvent(); - getActiveClient().handleRunClangTidyOnAllFiles(); + getActiveClient().handleRunCodeAnalysisOnAllFiles(); } function onAddToIncludePath(path: string): void { diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 1593f94214..29d04d1863 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -88,7 +88,7 @@ export class CppSettings extends Settings { } private getClangPath(isFormat: boolean): string | undefined { - let path: string | undefined | null = super.Section.get(isFormat ? "clang_format_path" : "clangTidy.path"); + let path: string | undefined | null = super.Section.get(isFormat ? "clang_format_path" : "codeAnalysis.clangTidy.path"); if (!path) { const cachedClangPath: string | null | undefined = isFormat ? getCachedClangFormatPath() : getCachedClangTidyPath(); if (cachedClangPath !== undefined) { @@ -143,9 +143,10 @@ export class CppSettings extends Settings { public get referencesMaxConcurrentThreads(): number | undefined | null { return super.Section.get("references.maxConcurrentThreads"); } public get referencesMaxCachedProcesses(): number | undefined | null { return super.Section.get("references.maxCachedProcesses"); } public get referencesMaxMemory(): number | undefined | null { return super.Section.get("references.maxMemory"); } - public get clangTidyMaxConcurrentThreads(): number | undefined { return super.Section.get("clangTidy.maxConcurrentThreads"); } - public get clangTidyMaxMemory(): number | undefined { return super.Section.get("clangTidy.maxMemory"); } - public get clangTidyExclude(): vscode.WorkspaceConfiguration | undefined { return super.Section.get("clangTidy.exclude"); } + public get codeAnalysisMaxConcurrentThreads(): number | undefined | null { return super.Section.get("codeAnalysis.maxConcurrentThreads"); } + public get codeAnalysisMaxMemory(): number | undefined | null { return super.Section.get("codeAnalysis.maxMemory"); } + public get codeAnlysisEnableClangTidy(): boolean | undefined { return super.Section.get("codeAnalysis.enableClangTidy"); } + public get codeAnalysisExclude(): vscode.WorkspaceConfiguration | undefined { return super.Section.get("codeAnalysis.exclude"); } public get clangFormatStyle(): string | undefined { return super.Section.get("clang_format_style"); } public get clangFormatFallbackStyle(): string | undefined { return super.Section.get("clang_format_fallbackStyle"); } public get clangFormatSortIncludes(): string | undefined { return super.Section.get("clang_format_sortIncludes"); } diff --git a/Extension/src/LanguageServer/settingsTracker.ts b/Extension/src/LanguageServer/settingsTracker.ts index 05d01677ee..bb8b9c6b4e 100644 --- a/Extension/src/LanguageServer/settingsTracker.ts +++ b/Extension/src/LanguageServer/settingsTracker.ts @@ -177,7 +177,7 @@ export class SettingsTracker { break; } default: { - if (key === "clang_format_path" || key === "clangTidy.path" || key === "clangTidy.buildPath" || key === "intelliSenseCachePath" || key.startsWith("default.")) { + if (key === "clang_format_path" || key === "codeAnalysis.clangTidy.path" || key === "codeAnalysis.clangTidy.buildPath" || key === "intelliSenseCachePath" || key.startsWith("default.")) { value = this.areEqual(val, settings.inspect(key)?.defaultValue) ? "" : "..."; // Track whether it's being used, but nothing specific about it. } else { value = String(this.previousCppSettings[key]); diff --git a/Extension/src/commands.ts b/Extension/src/commands.ts index d0f0e81f5f..09ddd01da9 100644 --- a/Extension/src/commands.ts +++ b/Extension/src/commands.ts @@ -37,9 +37,9 @@ class TemporaryCommandRegistrar { "C_Cpp.VcpkgClipboardInstallSuggested", "C_Cpp.VcpkgOnlineHelpSuggested", "C_Cpp.CheckForCompiler", - "C_Cpp.RunClangTidyOnActiveFile", - "C_Cpp.RunClangTidyOnOpenFiles", - "C_Cpp.RunClangTidyOnAllFiles" + "C_Cpp.RunCodeAnalysisOnActiveFile", + "C_Cpp.RunCodeAnalysisOnOpenFiles", + "C_Cpp.RunCodeAnalysisOnAllFiles" ]; constructor() { diff --git a/Extension/src/main.ts b/Extension/src/main.ts index a5e4edec8b..dc8f53ddfe 100644 --- a/Extension/src/main.ts +++ b/Extension/src/main.ts @@ -467,9 +467,9 @@ function rewriteManifest(): Promise { "onCommand:C_Cpp.GoToNextDirectiveInGroup", "onCommand:C_Cpp.GoToPrevDirectiveInGroup", "onCommand:C_Cpp.CheckForCompiler", - "onCommand:C_Cpp.RunClangTidyOnActiveFile", - "onCommand:C_Cpp.RunClangTidyOnOpenFiles", - "onCommand:C_Cpp.RunClangTidyOnAllFiles", + "onCommand:C_Cpp.RunCodeAnalysisOnActiveFile", + "onCommand:C_Cpp.RunCodeAnalysisOnOpenFiles", + "onCommand:C_Cpp.RunCodeAnalysisOnAllFiles", "onDebugInitialConfigurations", "onDebugResolve:cppdbg", "onDebugResolve:cppvsdbg", From be94dfd2e16c2a6efe36353dbf77090880cdfd70 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 3 Aug 2021 17:58:03 -0700 Subject: [PATCH 026/101] More settings fixes. --- Extension/package.json | 41 ++++++++++++------------ Extension/package.nls.json | 5 +-- Extension/src/LanguageServer/client.ts | 2 ++ Extension/src/LanguageServer/settings.ts | 11 ++++++- 4 files changed, 36 insertions(+), 23 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 46208108a3..9b2a1b9175 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -279,7 +279,7 @@ "integer", "null" ], - "markdownDescription": "%c_cpp.configuration.intelliSense.maxThreads.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.intelliSense.maxConcurrentThreads.markdownDescription%", "default": null, "minimum": 2, "maximum": 32, @@ -351,15 +351,13 @@ "maximum": 65536, "scope": "machine" }, - "C_Cpp.codeAnalysis.enableClangTidy": { - "type": "boolean", - "default": false, - "scope": "resource" - }, - "C_Cpp.codeAnalysis.clangTidy.path": { - "type": "string", - "description": "%c_cpp.configuration.codeAnalysis.clangTidy.path.description%", - "scope": "machine-overridable" + "C_Cpp.codeAnalysis.updateDelay": { + "type": "number", + "default": 3000, + "description": "%c_cpp.configuration.codeAnalysis.updateDelay.description%", + "scope": "application", + "minimum": 1000, + "maximum": 5000 }, "C_Cpp.codeAnalysis.exclude": { "type": "object", @@ -390,21 +388,24 @@ "type": "boolean", "markdownDescription": "%c_cpp.configuration.codeAnalysis.runInBackground.markdownDescription%", "default": true, - "scope": "application" - }, - "C_Cpp.codeAnalysis.updateDelay": { - "type": "number", - "default": 3000, - "description": "%c_cpp.configuration.codeAnalysis.updateDelay.description%", - "scope": "application", - "minimum": 1000, - "maximum": 5000 + "scope": "window" }, "C_Cpp.codeAnalysis.runOnBuild": { "type": "boolean", "markdownDescription": "%c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription%", "default": false, - "scope": "application" + "scope": "window" + }, + "C_Cpp.codeAnalysis.clangTidy.enabled": { + "type": "boolean", + "default": false, + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.enabled.markdownDescription%", + "scope": "resource" + }, + "C_Cpp.codeAnalysis.clangTidy.path": { + "type": "string", + "description": "%c_cpp.configuration.codeAnalysis.clangTidy.path.description%", + "scope": "machine-overridable" }, "C_Cpp.codeAnalysis.clangTidy.buildPath": { "type": "string", diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 12327f0cc7..12861e2c0a 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -27,12 +27,12 @@ "c_cpp.configuration.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may not always be used. The default of `null` uses the number of logical processors available.", "c_cpp.configuration.maxCachedProcesses.markdownDescription": "The maximum number of cached processes to use for language service processing. The default of `null` uses twice the number of logical processors available.", "c_cpp.configuration.maxMemory.markdownDescription": "The maximum memory (in MB) available for language service processing. Fewer processes will be cached and run concurrently after this memory usage is exceeded. The default of `null` uses the system's free memory.", - "c_cpp.configuration.intelliSense.maxCachedProcesses.markdownDescription": "The maximum number of IntelliSense processes to cache. The default of `null` uses the value inherited from `#C_Cpp.maxCachedProcesses#`.", + "c_cpp.configuration.intelliSense.maxCachedProcesses.markdownDescription": "The maximum number of IntelliSense processes to keep running. The default of `null` uses the value inherited from `#C_Cpp.maxCachedProcesses#`.", "c_cpp.configuration.intelliSense.maxMemory.markdownDescription": "Older IntelliSense processes will shut down before new processes are created after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "c_cpp.configuration.references.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "c_cpp.configuration.references.maxCachedProcesses.markdownDescription": "The maximum number of processes to keep in memory for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxCachedProcesses#`.", "c_cpp.configuration.references.maxMemory.markdownDescription": "Fewer 'Find All References' and 'Rename' processes will be cached and run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", - "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for code analysis. The default of `null` uses the value inherited from `#C_Cpp.maxThreads#`.", + "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for code analysis. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "c_cpp.configuration.codeAnalysis.exclude.markdownDescription": "Configure glob patterns for excluding folders and files for code analysis. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "c_cpp.configuration.codeAnalysis.excludeBoolean.description": "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.", @@ -40,6 +40,7 @@ "c_cpp.configuration.codeAnalysis.runInBackground.markdownDescription": "If `true`, code analysis will run automatically in the background.", "c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription": "If `true`, code analysis will run automatically after a build is completed.", "c_cpp.configuration.codeAnalysis.updateDelay.description": "Controls the delay in milliseconds before code analysis starts processing after a modification.", + "c_cpp.configuration.codeAnalysis.clangTidy.enabled.markdownDescription": "If `true`, code analysis using clang-tidy will be enabled.", "c_cpp.configuration.codeAnalysis.clangTidy.path.description": "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.", "c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for clang-tidy. If not specified, the build configuration from IntelliSense will be used.", "c_cpp.configuration.codeAnalysis.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly removed.", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 7172fd4291..ace72fd93f 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -997,6 +997,7 @@ export class DefaultClient implements Client { const settings_clangFormatFallbackStyle: (string | undefined)[] = []; const settings_clangFormatSortIncludes: (string | undefined)[] = []; const settings_clangTidyPath: (string | undefined)[] = []; + const settings_clangTidyEnabled: (boolean | undefined)[] = []; const settings_codeAnalysisExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; const settings_filesEncoding: (string | undefined)[] = []; const settings_cppFilesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; @@ -1096,6 +1097,7 @@ export class DefaultClient implements Client { for (const setting of settings) { settings_clangFormatPath.push(util.resolveVariables(setting.clangFormatPath, this.AdditionalEnvironment)); settings_clangTidyPath.push(util.resolveVariables(setting.clangTidyPath, this.AdditionalEnvironment)); + settings_clangTidyEnabled.push(setting.clangTidyEnabled); settings_codeAnalysisExclude.push(setting.codeAnalysisExclude); settings_formattingEngine.push(setting.formattingEngine); settings_indentBraces.push(setting.vcFormatIndentBraces); diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 29d04d1863..f6140b1dce 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -145,8 +145,17 @@ export class CppSettings extends Settings { public get referencesMaxMemory(): number | undefined | null { return super.Section.get("references.maxMemory"); } public get codeAnalysisMaxConcurrentThreads(): number | undefined | null { return super.Section.get("codeAnalysis.maxConcurrentThreads"); } public get codeAnalysisMaxMemory(): number | undefined | null { return super.Section.get("codeAnalysis.maxMemory"); } - public get codeAnlysisEnableClangTidy(): boolean | undefined { return super.Section.get("codeAnalysis.enableClangTidy"); } + public get codeAnalysisUpdateDelay(): number | undefined | null { return super.Section.get("codeAnalysis.updateDelay"); } public get codeAnalysisExclude(): vscode.WorkspaceConfiguration | undefined { return super.Section.get("codeAnalysis.exclude"); } + public get codeAnalysisRunInBackground(): boolean | undefined { return super.Section.get("codeAnalysis.runInBackground"); } + public get codeAnalysisRunOnBuild(): boolean | undefined { return super.Section.get("codeAnalysis.runOnBuild"); } + public get clangTidyEnabled(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.enabled"); } + public get clangTidyBuildPath(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.buildPath"); } + public get clangTidyConfig(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.config"); } + public get clangTidyFallbackConfig(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.fallbackConfig"); } + public get clangTidyFix(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.fix"); } + public get clangTidyArgs(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.args"); } + public get clangTidyChecks(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.checks"); } public get clangFormatStyle(): string | undefined { return super.Section.get("clang_format_style"); } public get clangFormatFallbackStyle(): string | undefined { return super.Section.get("clang_format_fallbackStyle"); } public get clangFormatSortIncludes(): string | undefined { return super.Section.get("clang_format_sortIncludes"); } From a876e9bc3690c537d930924dd4055887fce3907f Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 5 Aug 2021 12:56:50 -0700 Subject: [PATCH 027/101] Fix wrong string. --- Extension/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/package.json b/Extension/package.json index 9b2a1b9175..e930ffe0ed 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -279,7 +279,7 @@ "integer", "null" ], - "markdownDescription": "%c_cpp.configuration.intelliSense.maxConcurrentThreads.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.intelliSense.maxCachedProcesses.markdownDescription%", "default": null, "minimum": 2, "maximum": 32, From 50c7011319a422a9ac7f045262f7fc68cd1a6aa5 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 5 Aug 2021 18:21:43 -0700 Subject: [PATCH 028/101] Finish settings. --- Extension/package.json | 4 +- Extension/package.nls.json | 4 +- Extension/src/LanguageServer/client.ts | 58 ++++++++++++++++++----- Extension/src/LanguageServer/extension.ts | 17 ++++++- 4 files changed, 67 insertions(+), 16 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index e930ffe0ed..b665c4e9dd 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -388,13 +388,13 @@ "type": "boolean", "markdownDescription": "%c_cpp.configuration.codeAnalysis.runInBackground.markdownDescription%", "default": true, - "scope": "window" + "scope": "resource" }, "C_Cpp.codeAnalysis.runOnBuild": { "type": "boolean", "markdownDescription": "%c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription%", "default": false, - "scope": "window" + "scope": "resource" }, "C_Cpp.codeAnalysis.clangTidy.enabled": { "type": "boolean", diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 12861e2c0a..d90d8d2c9c 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -34,16 +34,15 @@ "c_cpp.configuration.references.maxMemory.markdownDescription": "Fewer 'Find All References' and 'Rename' processes will be cached and run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for code analysis. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", + "c_cpp.configuration.codeAnalysis.updateDelay.description": "Controls the delay in milliseconds before code analysis starts processing after a modification.", "c_cpp.configuration.codeAnalysis.exclude.markdownDescription": "Configure glob patterns for excluding folders and files for code analysis. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "c_cpp.configuration.codeAnalysis.excludeBoolean.description": "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.", "c_cpp.configuration.codeAnalysis.excludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", "c_cpp.configuration.codeAnalysis.runInBackground.markdownDescription": "If `true`, code analysis will run automatically in the background.", "c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription": "If `true`, code analysis will run automatically after a build is completed.", - "c_cpp.configuration.codeAnalysis.updateDelay.description": "Controls the delay in milliseconds before code analysis starts processing after a modification.", "c_cpp.configuration.codeAnalysis.clangTidy.enabled.markdownDescription": "If `true`, code analysis using clang-tidy will be enabled.", "c_cpp.configuration.codeAnalysis.clangTidy.path.description": "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.", "c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for clang-tidy. If not specified, the build configuration from IntelliSense will be used.", - "c_cpp.configuration.codeAnalysis.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly removed.", "c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, clang-tidy will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", "c_cpp.configuration.codeAnalysis.clangTidy.fix.description": "Determines when clang-tidy fixes should be automatically applied.", @@ -51,6 +50,7 @@ "c_cpp.configuration.codeAnalysis.clangTidy.fix.fixIfNoError.description": "Automatically apply clang-tidy fixes if no errors occur.", "c_cpp.configuration.codeAnalysis.clangTidy.fix.fixError.description": "Automatically apply clang-tidy fixes, even if errors occur.", "c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription": "Additional command line arguments to pass to clang-tidy. These take precedence over the equivalent `C_Cpp.codeAnalysis.clangTidy.*` settings.", + "c_cpp.configuration.codeAnalysis.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly removed.", "c_cpp.configuration.formatting.description": "Configures the formatting engine", "c_cpp.configuration.formatting.clangFormat.description": "clang-format will be used to format code.", "c_cpp.configuration.formatting.vcFormat.description": "The Visual C++ formatting engine will be used to format code.", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index ace72fd93f..59734d5c0c 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -996,9 +996,17 @@ export class DefaultClient implements Client { const settings_clangFormatStyle: (string | undefined)[] = []; const settings_clangFormatFallbackStyle: (string | undefined)[] = []; const settings_clangFormatSortIncludes: (string | undefined)[] = []; - const settings_clangTidyPath: (string | undefined)[] = []; - const settings_clangTidyEnabled: (boolean | undefined)[] = []; const settings_codeAnalysisExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; + const settings_codeAnalysisRunInBackground: (boolean | undefined)[] = []; + const settings_codeAnalysisRunOnBuild: (boolean | undefined)[] = []; + const settings_clangTidyEnabled: (boolean | undefined)[] = []; + const settings_clangTidyPath: (string | undefined)[] = []; + const settings_clangTidyBuildPath: (string | undefined)[] = []; + const settings_clangTidyConfig: (string | undefined)[] = []; + const settings_clangTidyFallbackConfig: (string | undefined)[] = []; + const settings_clangTidyFix: (string | undefined)[] = []; + const settings_clangTidyArgs: (string | undefined)[] = []; + const settings_clangTidyChecks: (string | undefined)[] = []; const settings_filesEncoding: (string | undefined)[] = []; const settings_cppFilesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; const settings_filesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; @@ -1096,9 +1104,17 @@ export class DefaultClient implements Client { for (const setting of settings) { settings_clangFormatPath.push(util.resolveVariables(setting.clangFormatPath, this.AdditionalEnvironment)); - settings_clangTidyPath.push(util.resolveVariables(setting.clangTidyPath, this.AdditionalEnvironment)); - settings_clangTidyEnabled.push(setting.clangTidyEnabled); + settings_codeAnalysisRunInBackground.push(setting.codeAnalysisRunInBackground); + settings_codeAnalysisRunOnBuild.push(setting.codeAnalysisRunOnBuild); settings_codeAnalysisExclude.push(setting.codeAnalysisExclude); + settings_clangTidyEnabled.push(setting.clangTidyEnabled); + settings_clangTidyPath.push(util.resolveVariables(setting.clangTidyPath, this.AdditionalEnvironment)); + settings_clangTidyBuildPath.push(setting.clangTidyBuildPath); + settings_clangTidyConfig.push(setting.clangTidyConfig); + settings_clangTidyFallbackConfig.push(setting.clangTidyFallbackConfig); + settings_clangTidyFix.push(setting.clangTidyFix); + settings_clangTidyArgs.push(setting.clangTidyArgs); + settings_clangTidyChecks.push(setting.clangTidyChecks); settings_formattingEngine.push(setting.formattingEngine); settings_indentBraces.push(setting.vcFormatIndentBraces); settings_indentWithinParentheses.push(setting.vcFormatIndentWithinParentheses); @@ -1210,13 +1226,33 @@ export class DefaultClient implements Client { maxConcurrentThreads: workspaceSettings.maxConcurrentThreads, maxCachedProcesses: workspaceSettings.maxCachedProcesses, maxMemory: workspaceSettings.maxMemory ?? os.freemem() / 1048576, - intelliSenseMaxCachedProcesses: workspaceSettings.intelliSenseMaxCachedProcesses, - intelliSenseMaxMemory: workspaceSettings.intelliSenseMaxMemory, - referencesMaxConcurrentThreads: workspaceSettings.maxConcurrentThreads, - referencesMaxCachedProcesses: workspaceSettings.referencesMaxCachedProcesses, - codeAnalysisMaxConcurrentThreads: workspaceSettings.codeAnalysisMaxConcurrentThreads, - clangTidyPath: settings_clangTidyPath, - codeAnalysisExclude: settings_codeAnalysisExclude, + intelliSense: { + maxCachedProcesses: workspaceSettings.intelliSenseMaxCachedProcesses, + maxMemory: workspaceSettings.intelliSenseMaxMemory, + }, + references: { + maxConcurrentThreads: workspaceSettings.maxConcurrentThreads, + maxCachedProcesses: workspaceSettings.referencesMaxCachedProcesses, + maxMemory: workspaceSettings.referencesMaxMemory, + }, + codeAnalysis: { + maxConcurrentThreads: workspaceSettings.codeAnalysisMaxConcurrentThreads, + maxMemory: workspaceSettings.codeAnalysisMaxMemory, + updateDelay: workspaceSettings.codeAnalysisUpdateDelay, + exclude: settings_codeAnalysisExclude, + runInBackground: settings_codeAnalysisRunInBackground, + runOnBuild: settings_codeAnalysisRunOnBuild, + clangTidy: { + enabled: settings_clangTidyEnabled, + path: settings_clangTidyPath, + buildPath: settings_clangTidyBuildPath, + config: settings_clangTidyConfig, + fallbackConfig: settings_clangTidyFallbackConfig, + fix: settings_clangTidyFix, + args: settings_clangTidyArgs, + checks: settings_clangTidyChecks + } + }, clang_format_path: settings_clangFormatPath, clang_format_style: settings_clangFormatStyle, formatting: settings_formattingEngine, diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index d08bb8d6f4..937853f789 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -947,9 +947,17 @@ function onCheckForCompiler(): void { client.handleCheckForCompiler(); } +function showCodeAnalysisDisabledMessage(): void { + vscode.window.showInformationMessage(localize('no.code.analysis.enabled', 'Set a C_Cpp.codeAnalysis..enabled setting to true to enable code analysis.')); +} + function onRunCodeAnalysisOnActiveFile(): void { onActivationEvent(); if (activeDocument !== "") { + const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri); + if (!settings.clangTidyEnabled) { + showCodeAnalysisDisabledMessage(); + } getActiveClient().handleRunCodeAnalysisOnActiveFile(); } } @@ -957,13 +965,20 @@ function onRunCodeAnalysisOnActiveFile(): void { function onRunCodeAnalysisOnOpenFiles(): void { onActivationEvent(); if (openFileVersions.size > 0) { + const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri); + if (!settings.clangTidyEnabled) { + showCodeAnalysisDisabledMessage(); + } getActiveClient().handleRunCodeAnalysisOnOpenFiles(); } } function onRunCodeAnalysisOnAllFiles(): void { onActivationEvent(); - getActiveClient().handleRunCodeAnalysisOnAllFiles(); + const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri); + if (!settings.clangTidyEnabled) { + getActiveClient().handleRunCodeAnalysisOnAllFiles(); + } } function onAddToIncludePath(path: string): void { From 5e23070c1dc20483c01c0d6bd3dcde400978d08e Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 6 Aug 2021 11:30:31 -0700 Subject: [PATCH 029/101] Fix linter errors. --- Extension/src/LanguageServer/client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 59734d5c0c..1eefad33d9 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1228,12 +1228,12 @@ export class DefaultClient implements Client { maxMemory: workspaceSettings.maxMemory ?? os.freemem() / 1048576, intelliSense: { maxCachedProcesses: workspaceSettings.intelliSenseMaxCachedProcesses, - maxMemory: workspaceSettings.intelliSenseMaxMemory, + maxMemory: workspaceSettings.intelliSenseMaxMemory }, references: { maxConcurrentThreads: workspaceSettings.maxConcurrentThreads, maxCachedProcesses: workspaceSettings.referencesMaxCachedProcesses, - maxMemory: workspaceSettings.referencesMaxMemory, + maxMemory: workspaceSettings.referencesMaxMemory }, codeAnalysis: { maxConcurrentThreads: workspaceSettings.codeAnalysisMaxConcurrentThreads, From 96b3fbd4bacb357666f5ab7c93434bdb1b827890 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 6 Aug 2021 12:10:42 -0700 Subject: [PATCH 030/101] Send freeMemory. --- Extension/src/LanguageServer/client.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 1eefad33d9..e977e58855 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -461,6 +461,10 @@ enum CodeAnalysisScope { AllFiles }; +interface IntervalTimerParams { + freeMemory: number; +}; + // Requests const QueryCompilerDefaultsRequest: RequestType = new RequestType('cpptools/queryCompilerDefaults'); const QueryTranslationUnitSourceRequest: RequestType = new RequestType('cpptools/queryTranslationUnitSource'); @@ -492,7 +496,7 @@ const TextEditorSelectionChangeNotification: NotificationType = new const ChangeCppPropertiesNotification: NotificationType = new NotificationType('cpptools/didChangeCppProperties'); const ChangeCompileCommandsNotification: NotificationType = new NotificationType('cpptools/didChangeCompileCommands'); const ChangeSelectedSettingNotification: NotificationType = new NotificationType('cpptools/didChangeSelectedSetting'); -const IntervalTimerNotification: NotificationType = new NotificationType('cpptools/onIntervalTimer'); +const IntervalTimerNotification: NotificationType = new NotificationType('cpptools/onIntervalTimer'); const CustomConfigurationNotification: NotificationType = new NotificationType('cpptools/didChangeCustomConfiguration'); const CustomBrowseConfigurationNotification: NotificationType = new NotificationType('cpptools/didChangeCustomBrowseConfiguration'); const ClearCustomConfigurationsNotification: NotificationType = new NotificationType('cpptools/clearCustomConfigurations'); @@ -1223,9 +1227,10 @@ export class DefaultClient implements Client { { scheme: 'file', language: 'cuda-cpp' } ], initializationOptions: { + freeMemory: os.freemem() / 1048576, maxConcurrentThreads: workspaceSettings.maxConcurrentThreads, maxCachedProcesses: workspaceSettings.maxCachedProcesses, - maxMemory: workspaceSettings.maxMemory ?? os.freemem() / 1048576, + maxMemory: workspaceSettings.maxMemory, intelliSense: { maxCachedProcesses: workspaceSettings.intelliSenseMaxCachedProcesses, maxMemory: workspaceSettings.intelliSenseMaxMemory @@ -2887,7 +2892,10 @@ export class DefaultClient implements Client { // These events can be discarded until the language client is ready. // Don't queue them up with this.notifyWhenLanguageClientReady calls. if (this.innerLanguageClient !== undefined && this.configuration !== undefined) { - this.languageClient.sendNotification(IntervalTimerNotification); + const params: IntervalTimerParams = { + freeMemory: os.freemem() / 1048576 + }; + this.languageClient.sendNotification(IntervalTimerNotification, params); this.configuration.checkCppProperties(); this.configuration.checkCompileCommands(); } From ebf9c42c133912f76045e5247d73d73a63d00997 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 6 Aug 2021 18:23:13 -0700 Subject: [PATCH 031/101] More settings changes. onBuild changes. --- Extension/package.json | 4 ++-- Extension/package.nls.json | 4 ++-- Extension/src/LanguageServer/client.ts | 17 ++++++++++------- Extension/src/LanguageServer/extension.ts | 16 ++++++++++++++++ Extension/src/LanguageServer/settings.ts | 2 +- 5 files changed, 31 insertions(+), 12 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index b665c4e9dd..d152d0c5a1 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -433,8 +433,8 @@ "description": "%c_cpp.configuration.codeAnalysis.clangTidy.fix.description%", "enumDescriptions": [ "%c_cpp.configuration.codeAnalysis.clangTidy.fix.disabled.description%", - "%c_cpp.configuration.codeAnalysis.clangTidy.fix.fixIfNoError.description%", - "%c_cpp.configuration.codeAnalysis.clangTidy.fix.fixError.description%" + "%c_cpp.configuration.codeAnalysis.clangTidy.fix.fixIfNoErrors.description%", + "%c_cpp.configuration.codeAnalysis.clangTidy.fix.fixErrors.description%" ], "scope": "resource" }, diff --git a/Extension/package.nls.json b/Extension/package.nls.json index d90d8d2c9c..a67877fd24 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -47,8 +47,8 @@ "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", "c_cpp.configuration.codeAnalysis.clangTidy.fix.description": "Determines when clang-tidy fixes should be automatically applied.", "c_cpp.configuration.codeAnalysis.clangTidy.fix.disabled.description": "Do not automatically apply clang-tidy fixes.", - "c_cpp.configuration.codeAnalysis.clangTidy.fix.fixIfNoError.description": "Automatically apply clang-tidy fixes if no errors occur.", - "c_cpp.configuration.codeAnalysis.clangTidy.fix.fixError.description": "Automatically apply clang-tidy fixes, even if errors occur.", + "c_cpp.configuration.codeAnalysis.clangTidy.fix.fixIfNoErrors.description": "Automatically apply clang-tidy fixes if no errors occur.", + "c_cpp.configuration.codeAnalysis.clangTidy.fix.fixErrors.description": "Automatically apply clang-tidy fixes, even if errors occur.", "c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription": "Additional command line arguments to pass to clang-tidy. These take precedence over the equivalent `C_Cpp.codeAnalysis.clangTidy.*` settings.", "c_cpp.configuration.codeAnalysis.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly removed.", "c_cpp.configuration.formatting.description": "Configures the formatting engine", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index e977e58855..33f2056579 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1001,8 +1001,6 @@ export class DefaultClient implements Client { const settings_clangFormatFallbackStyle: (string | undefined)[] = []; const settings_clangFormatSortIncludes: (string | undefined)[] = []; const settings_codeAnalysisExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; - const settings_codeAnalysisRunInBackground: (boolean | undefined)[] = []; - const settings_codeAnalysisRunOnBuild: (boolean | undefined)[] = []; const settings_clangTidyEnabled: (boolean | undefined)[] = []; const settings_clangTidyPath: (string | undefined)[] = []; const settings_clangTidyBuildPath: (string | undefined)[] = []; @@ -1010,7 +1008,7 @@ export class DefaultClient implements Client { const settings_clangTidyFallbackConfig: (string | undefined)[] = []; const settings_clangTidyFix: (string | undefined)[] = []; const settings_clangTidyArgs: (string | undefined)[] = []; - const settings_clangTidyChecks: (string | undefined)[] = []; + const settings_clangTidyChecks: (string[] | undefined)[] = []; const settings_filesEncoding: (string | undefined)[] = []; const settings_cppFilesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; const settings_filesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; @@ -1108,8 +1106,6 @@ export class DefaultClient implements Client { for (const setting of settings) { settings_clangFormatPath.push(util.resolveVariables(setting.clangFormatPath, this.AdditionalEnvironment)); - settings_codeAnalysisRunInBackground.push(setting.codeAnalysisRunInBackground); - settings_codeAnalysisRunOnBuild.push(setting.codeAnalysisRunOnBuild); settings_codeAnalysisExclude.push(setting.codeAnalysisExclude); settings_clangTidyEnabled.push(setting.clangTidyEnabled); settings_clangTidyPath.push(util.resolveVariables(setting.clangTidyPath, this.AdditionalEnvironment)); @@ -1245,8 +1241,6 @@ export class DefaultClient implements Client { maxMemory: workspaceSettings.codeAnalysisMaxMemory, updateDelay: workspaceSettings.codeAnalysisUpdateDelay, exclude: settings_codeAnalysisExclude, - runInBackground: settings_codeAnalysisRunInBackground, - runOnBuild: settings_codeAnalysisRunOnBuild, clangTidy: { enabled: settings_clangTidyEnabled, path: settings_clangTidyPath, @@ -1587,9 +1581,11 @@ export class DefaultClient implements Client { } } + private activeDocumentChangedPending: boolean = false; public onDidOpenTextDocument(document: vscode.TextDocument): void { if (document.uri.scheme === "file") { openFileVersions.set(document.uri.toString(), document.version); + this.activeDocumentChangedPending = true; } } @@ -2460,6 +2456,13 @@ export class DefaultClient implements Client { public activeDocumentChanged(document: vscode.TextDocument): void { this.notifyWhenLanguageClientReady(() => { this.languageClient.sendNotification(ActiveDocumentChangeNotification, this.languageClient.code2ProtocolConverter.asTextDocumentIdentifier(document)); + if (this.activeDocumentChangedPending) { + this.activeDocumentChangedPending = false; + const settings: CppSettings = new CppSettings(this.RootUri); + if (settings.codeAnalysisRunInBackground) { + this.handleRunCodeAnalysisOnActiveFile(); + } + } }); } diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 937853f789..cd3a1cff1b 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -193,6 +193,22 @@ export async function activate(activationEventOccurred: boolean): Promise if (event.execution.task.source === CppBuildTaskProvider.CppBuildSourceStr) { telemetry.logLanguageServerEvent('buildTaskStarted'); } + if (event.execution.task.group === vscode.TaskGroup.Build || event.execution.task.group === vscode.TaskGroup.Rebuild) { + if (event.execution.task.scope !== vscode.TaskScope.Global && event.execution.task.scope !== vscode.TaskScope.Workspace) { + const folder: vscode.WorkspaceFolder | undefined = event.execution.task.scope; + if (folder) { + const settings: CppSettings = new CppSettings(folder.uri); + if (settings.codeAnalysisRunOnBuild) { + clients.getClientFor(folder.uri).handleRunCodeAnalysisOnAllFiles(); + } + return; + } + } + const settings: CppSettings = new CppSettings(); + if (settings.codeAnalysisRunOnBuild) { + clients.ActiveClient.handleRunCodeAnalysisOnAllFiles(); + } + } }); const selector: vscode.DocumentSelector = [ diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index f6140b1dce..0ac42cc4f9 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -155,7 +155,7 @@ export class CppSettings extends Settings { public get clangTidyFallbackConfig(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.fallbackConfig"); } public get clangTidyFix(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.fix"); } public get clangTidyArgs(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.args"); } - public get clangTidyChecks(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.checks"); } + public get clangTidyChecks(): string[] | undefined { return super.Section.get("codeAnalysis.clangTidy.checks"); } public get clangFormatStyle(): string | undefined { return super.Section.get("clang_format_style"); } public get clangFormatFallbackStyle(): string | undefined { return super.Section.get("clang_format_fallbackStyle"); } public get clangFormatSortIncludes(): string | undefined { return super.Section.get("clang_format_sortIncludes"); } From df721874b1b5a916226274ec4b80c7a9b51d623e Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 9 Aug 2021 18:50:09 -0700 Subject: [PATCH 032/101] Fix empty compiler bug. Remove references.maxCachedProcesses. --- Extension/package.json | 30 +++++------------------ Extension/package.nls.json | 6 ++--- Extension/src/LanguageServer/client.ts | 10 +++----- Extension/src/LanguageServer/extension.ts | 6 ++--- Extension/src/LanguageServer/settings.ts | 5 +--- Extension/src/LanguageServer/ui.ts | 2 +- 6 files changed, 17 insertions(+), 42 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index d152d0c5a1..6682303666 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -252,17 +252,6 @@ "maximum": 32, "scope": "machine" }, - "C_Cpp.maxCachedProcesses": { - "type": [ - "integer", - "null" - ], - "markdownDescription": "%c_cpp.configuration.maxCachedProcesses.markdownDescription%", - "default": null, - "minimum": 0, - "maximum": 64, - "scope": "machine" - }, "C_Cpp.maxMemory": { "type": [ "integer", @@ -282,7 +271,7 @@ "markdownDescription": "%c_cpp.configuration.intelliSense.maxCachedProcesses.markdownDescription%", "default": null, "minimum": 2, - "maximum": 32, + "maximum": 128, "scope": "machine" }, "C_Cpp.intelliSense.maxMemory": { @@ -307,17 +296,6 @@ "maximum": 32, "scope": "machine" }, - "C_Cpp.references.maxCachedProcesses": { - "type": [ - "integer", - "null" - ], - "markdownDescription": "%c_cpp.configuration.references.maxCachedProcesses.markdownDescription%", - "default": null, - "minimum": 0, - "maximum": 32, - "scope": "machine" - }, "C_Cpp.references.maxMemory": { "type": [ "integer", @@ -2378,7 +2356,11 @@ "scope": "machine-overridable" }, "C_Cpp.default.compilerPath": { - "type": "string", + "type": [ + "string", + "null" + ], + "default": null, "markdownDescription": "%c_cpp.configuration.default.compilerPath.markdownDescription%", "scope": "machine-overridable" }, diff --git a/Extension/package.nls.json b/Extension/package.nls.json index a67877fd24..ceb371bd16 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -25,12 +25,10 @@ "c_cpp.command.RunCodeAnalysisOnOpenFiles.title": "Run code analysis on all open files", "c_cpp.command.RunCodeAnalysisOnAllFiles.title": "Run code analysis on all source files", "c_cpp.configuration.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may not always be used. The default of `null` uses the number of logical processors available.", - "c_cpp.configuration.maxCachedProcesses.markdownDescription": "The maximum number of cached processes to use for language service processing. The default of `null` uses twice the number of logical processors available.", "c_cpp.configuration.maxMemory.markdownDescription": "The maximum memory (in MB) available for language service processing. Fewer processes will be cached and run concurrently after this memory usage is exceeded. The default of `null` uses the system's free memory.", - "c_cpp.configuration.intelliSense.maxCachedProcesses.markdownDescription": "The maximum number of IntelliSense processes to keep running. The default of `null` uses the value inherited from `#C_Cpp.maxCachedProcesses#`.", + "c_cpp.configuration.intelliSense.maxCachedProcesses.markdownDescription": "The maximum number of IntelliSense processes to keep running. The default of `null` uses twice the number of logical processors available.", "c_cpp.configuration.intelliSense.maxMemory.markdownDescription": "Older IntelliSense processes will shut down before new processes are created after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", - "c_cpp.configuration.references.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", - "c_cpp.configuration.references.maxCachedProcesses.markdownDescription": "The maximum number of processes to keep in memory for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxCachedProcesses#`.", + "c_cpp.configuration.references.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "c_cpp.configuration.references.maxMemory.markdownDescription": "Fewer 'Find All References' and 'Rename' processes will be cached and run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for code analysis. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 7ef407c1b9..8e561d5874 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -652,7 +652,7 @@ export interface Client { handleConfigurationSelectCommand(): Promise; handleConfigurationProviderSelectCommand(): Promise; handleShowParsingCommands(): Promise; - handleShowAnalysisCommands(): Promise; + handleShowCodeAnalysisCommands(): Promise; handleReferencesIcon(): void; handleConfigurationEditCommand(viewColumn?: vscode.ViewColumn): void; handleConfigurationEditJSONCommand(viewColumn?: vscode.ViewColumn): void; @@ -1226,7 +1226,6 @@ export class DefaultClient implements Client { initializationOptions: { freeMemory: os.freemem() / 1048576, maxConcurrentThreads: workspaceSettings.maxConcurrentThreads, - maxCachedProcesses: workspaceSettings.maxCachedProcesses, maxMemory: workspaceSettings.maxMemory, intelliSense: { maxCachedProcesses: workspaceSettings.intelliSenseMaxCachedProcesses, @@ -1234,7 +1233,6 @@ export class DefaultClient implements Client { }, references: { maxConcurrentThreads: workspaceSettings.maxConcurrentThreads, - maxCachedProcesses: workspaceSettings.referencesMaxCachedProcesses, maxMemory: workspaceSettings.referencesMaxMemory }, codeAnalysis: { @@ -2836,9 +2834,9 @@ export class DefaultClient implements Client { } } - public async handleShowAnalysisCommands(): Promise { + public async handleShowCodeAnalysisCommands(): Promise { await this.awaitUntilLanguageClientReady(); - const index: number = await ui.showAnalysisCommands(); + const index: number = await ui.showCodeAnalysisCommands(); switch (index) { case 0: this.cancelAnalysis(); break; case 1: this.pauseAnalysis(); break; @@ -3101,7 +3099,7 @@ class NullClient implements Client { handleConfigurationSelectCommand(): Promise { return Promise.resolve(); } handleConfigurationProviderSelectCommand(): Promise { return Promise.resolve(); } handleShowParsingCommands(): Promise { return Promise.resolve(); } - handleShowAnalysisCommands(): Promise { return Promise.resolve(); } + handleShowCodeAnalysisCommands(): Promise { return Promise.resolve(); } handleReferencesIcon(): void { } handleConfigurationEditCommand(viewColumn?: vscode.ViewColumn): void { } handleConfigurationEditJSONCommand(viewColumn?: vscode.ViewColumn): void { } diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index cd3a1cff1b..4e1b3d7346 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -795,7 +795,7 @@ export function registerCommands(): void { disposables.push(vscode.commands.registerCommand('C_Cpp.ResumeAnalysis', onResumeAnalysis)); disposables.push(vscode.commands.registerCommand('C_Cpp.CancelAnalysis', onCancelAnalysis)); disposables.push(vscode.commands.registerCommand('C_Cpp.ShowParsingCommands', onShowParsingCommands)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ShowAnalysisCommands', onShowAnalysisCommands)); + disposables.push(vscode.commands.registerCommand('C_Cpp.ShowCodeAnalysisCommands', onShowCodeAnalysisCommands)); disposables.push(vscode.commands.registerCommand('C_Cpp.ShowReferencesProgress', onShowReferencesProgress)); disposables.push(vscode.commands.registerCommand('C_Cpp.TakeSurvey', onTakeSurvey)); disposables.push(vscode.commands.registerCommand('C_Cpp.LogDiagnostics', onLogDiagnostics)); @@ -1065,9 +1065,9 @@ function onShowParsingCommands(): void { clients.ActiveClient.handleShowParsingCommands(); } -function onShowAnalysisCommands(): void { +function onShowCodeAnalysisCommands(): void { onActivationEvent(); - clients.ActiveClient.handleShowAnalysisCommands(); + clients.ActiveClient.handleShowCodeAnalysisCommands(); } function onShowReferencesProgress(): void { diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 0ac42cc4f9..ea3bb86662 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -135,13 +135,10 @@ export class CppSettings extends Settings { return path; } - public get maxConcurrentThreads(): number | undefined | null { return super.Section.get("maxConcurrentThreads"); } - public get maxCachedProcesses(): number | undefined | null { return super.Section.get("maxCachedProcesses"); } - public get maxMemory(): number | undefined | null { return super.Section.get("maxMemory"); } + public get maxConcurrentThreads(): number | undefined | null { return super.Section.get("maxConcurrentThreads"); } public get maxMemory(): number | undefined | null { return super.Section.get("maxMemory"); } public get intelliSenseMaxCachedProcesses(): number | undefined | null { return super.Section.get("intelliSense.maxCachedProcesses"); } public get intelliSenseMaxMemory(): number | undefined | null { return super.Section.get("intelliSense.maxMemory"); } public get referencesMaxConcurrentThreads(): number | undefined | null { return super.Section.get("references.maxConcurrentThreads"); } - public get referencesMaxCachedProcesses(): number | undefined | null { return super.Section.get("references.maxCachedProcesses"); } public get referencesMaxMemory(): number | undefined | null { return super.Section.get("references.maxMemory"); } public get codeAnalysisMaxConcurrentThreads(): number | undefined | null { return super.Section.get("codeAnalysis.maxConcurrentThreads"); } public get codeAnalysisMaxMemory(): number | undefined | null { return super.Section.get("codeAnalysis.maxMemory"); } diff --git a/Extension/src/LanguageServer/ui.ts b/Extension/src/LanguageServer/ui.ts index 6499d1d5da..3e227ad760 100644 --- a/Extension/src/LanguageServer/ui.ts +++ b/Extension/src/LanguageServer/ui.ts @@ -326,7 +326,7 @@ export class UI { return (selection) ? selection.index : -1; } - public async showAnalysisCommands(): Promise { + public async showCodeAnalysisCommands(): Promise { const options: vscode.QuickPickOptions = {}; options.placeHolder = this.selectACommandString; From bc16ba0e2c644c0ddae665a793bd1e64d2dfad23 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 10 Aug 2021 15:04:18 -0700 Subject: [PATCH 033/101] Fixes --- Extension/src/LanguageServer/client.ts | 59 +++++++++++++---------- Extension/src/LanguageServer/extension.ts | 42 ++++++++++------ Extension/src/LanguageServer/ui.ts | 2 +- 3 files changed, 61 insertions(+), 42 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 8e561d5874..4e4449869c 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -67,6 +67,7 @@ let diagnosticsCollection: vscode.DiagnosticCollection; let workspaceDisposables: vscode.Disposable[] = []; export let workspaceReferences: refs.ReferencesManager; export const openFileVersions: Map = new Map(); +export const openNeverActiveFiles: Set = new Set(); export const cachedEditorConfigSettings: Map = new Map(); export function disposeWorkspaceData(): void { @@ -489,9 +490,9 @@ const FileDeletedNotification: NotificationType = new N const ResetDatabaseNotification: NotificationType = new NotificationType('cpptools/resetDatabase'); const PauseParsingNotification: NotificationType = new NotificationType('cpptools/pauseParsing'); const ResumeParsingNotification: NotificationType = new NotificationType('cpptools/resumeParsing'); -const PauseAnalysisNotification: NotificationType = new NotificationType('cpptools/pauseAnalysis'); -const ResumeAnalysisNotification: NotificationType = new NotificationType('cpptools/resumeAnalysis'); -const CancelAnalysisNotification: NotificationType = new NotificationType('cpptools/cancelAnalysis'); +const PauseCodeAnalysisNotification: NotificationType = new NotificationType('cpptools/PauseCodeAnalysis'); +const ResumeCodeAnalysisNotification: NotificationType = new NotificationType('cpptools/ResumeCodeAnalysis'); +const CancelCodeAnalysisNotification: NotificationType = new NotificationType('cpptools/CancelCodeAnalysis'); const ActiveDocumentChangeNotification: NotificationType = new NotificationType('cpptools/activeDocumentChange'); const TextEditorSelectionChangeNotification: NotificationType = new NotificationType('cpptools/textEditorSelectionChange'); const ChangeCppPropertiesNotification: NotificationType = new NotificationType('cpptools/didChangeCppProperties'); @@ -646,9 +647,9 @@ export interface Client { deactivate(): void; pauseParsing(): void; resumeParsing(): void; - pauseAnalysis(): void; - resumeAnalysis(): void; - cancelAnalysis(): void; + PauseCodeAnalysis(): void; + ResumeCodeAnalysis(): void; + CancelCodeAnalysis(): void; handleConfigurationSelectCommand(): Promise; handleConfigurationProviderSelectCommand(): Promise; handleShowParsingCommands(): Promise; @@ -1580,19 +1581,24 @@ export class DefaultClient implements Client { } } - private activeDocumentChangedPending: boolean = false; public onDidOpenTextDocument(document: vscode.TextDocument): void { if (document.uri.scheme === "file") { - openFileVersions.set(document.uri.toString(), document.version); - this.activeDocumentChangedPending = true; + const uri: string = document.uri.toString(); + openFileVersions.set(uri, document.version); + openNeverActiveFiles.add(uri); } } public onDidCloseTextDocument(document: vscode.TextDocument): void { + const uri: string = document.uri.toString(); if (this.semanticTokensProvider) { - this.semanticTokensProvider.invalidateFile(document.uri.toString()); + this.semanticTokensProvider.invalidateFile(uri); + } + + openFileVersions.delete(uri); + if (openNeverActiveFiles.has(uri)) { + openNeverActiveFiles.delete(uri); } - openFileVersions.delete(document.uri.toString()); } private registeredProviders: CustomConfigurationProvider1[] = []; @@ -2492,10 +2498,11 @@ export class DefaultClient implements Client { await this.updateActiveDocumentTextOptions(); this.notifyWhenLanguageClientReady(() => { this.languageClient.sendNotification(ActiveDocumentChangeNotification, this.languageClient.code2ProtocolConverter.asTextDocumentIdentifier(document)); - if (this.activeDocumentChangedPending) { - this.activeDocumentChangedPending = false; + const uri: string = document.uri.toString(); + if (openNeverActiveFiles.has(uri)) { + openNeverActiveFiles.delete(uri); const settings: CppSettings = new CppSettings(this.RootUri); - if (settings.codeAnalysisRunInBackground) { + if (settings.clangTidyEnabled && settings.codeAnalysisRunInBackground) { this.handleRunCodeAnalysisOnActiveFile(); } } @@ -2535,16 +2542,16 @@ export class DefaultClient implements Client { this.notifyWhenLanguageClientReady(() => this.languageClient.sendNotification(ResumeParsingNotification)); } - public pauseAnalysis(): void { - this.notifyWhenLanguageClientReady(() => this.languageClient.sendNotification(PauseAnalysisNotification)); + public PauseCodeAnalysis(): void { + this.notifyWhenLanguageClientReady(() => this.languageClient.sendNotification(PauseCodeAnalysisNotification)); } - public resumeAnalysis(): void { - this.notifyWhenLanguageClientReady(() => this.languageClient.sendNotification(ResumeAnalysisNotification)); + public ResumeCodeAnalysis(): void { + this.notifyWhenLanguageClientReady(() => this.languageClient.sendNotification(ResumeCodeAnalysisNotification)); } - public cancelAnalysis(): void { - this.notifyWhenLanguageClientReady(() => this.languageClient.sendNotification(CancelAnalysisNotification)); + public CancelCodeAnalysis(): void { + this.notifyWhenLanguageClientReady(() => this.languageClient.sendNotification(CancelCodeAnalysisNotification)); } private doneInitialCustomBrowseConfigurationCheck: Boolean = false; @@ -2838,9 +2845,9 @@ export class DefaultClient implements Client { await this.awaitUntilLanguageClientReady(); const index: number = await ui.showCodeAnalysisCommands(); switch (index) { - case 0: this.cancelAnalysis(); break; - case 1: this.pauseAnalysis(); break; - case 2: this.resumeAnalysis(); break; + case 0: this.CancelCodeAnalysis(); break; + case 1: this.PauseCodeAnalysis(); break; + case 2: this.ResumeCodeAnalysis(); break; } } @@ -3093,9 +3100,9 @@ class NullClient implements Client { deactivate(): void { } pauseParsing(): void { } resumeParsing(): void { } - pauseAnalysis(): void { } - resumeAnalysis(): void { } - cancelAnalysis(): void { } + PauseCodeAnalysis(): void { } + ResumeCodeAnalysis(): void { } + CancelCodeAnalysis(): void { } handleConfigurationSelectCommand(): Promise { return Promise.resolve(); } handleConfigurationProviderSelectCommand(): Promise { return Promise.resolve(); } handleShowParsingCommands(): Promise { return Promise.resolve(); } diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 4e1b3d7346..85a466785a 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -190,22 +190,30 @@ export async function activate(activationEventOccurred: boolean): Promise taskProvider = vscode.tasks.registerTaskProvider(CppBuildTaskProvider.CppBuildScriptType, cppBuildTaskProvider); vscode.tasks.onDidStartTask(event => { - if (event.execution.task.source === CppBuildTaskProvider.CppBuildSourceStr) { + getActiveClient().PauseCodeAnalysis(); + if (event.execution.task.definition.type === CppBuildTaskProvider.CppBuildScriptType + || event.execution.task.name.startsWith(CppBuildTaskProvider.CppBuildSourceStr)) { telemetry.logLanguageServerEvent('buildTaskStarted'); } - if (event.execution.task.group === vscode.TaskGroup.Build || event.execution.task.group === vscode.TaskGroup.Rebuild) { + }); + + vscode.tasks.onDidEndTask(event => { + getActiveClient().ResumeCodeAnalysis(); + if (event.execution.task.definition.type === CppBuildTaskProvider.CppBuildScriptType + || event.execution.task.name.startsWith(CppBuildTaskProvider.CppBuildSourceStr)) { + telemetry.logLanguageServerEvent('buildTaskFinished'); if (event.execution.task.scope !== vscode.TaskScope.Global && event.execution.task.scope !== vscode.TaskScope.Workspace) { const folder: vscode.WorkspaceFolder | undefined = event.execution.task.scope; if (folder) { const settings: CppSettings = new CppSettings(folder.uri); - if (settings.codeAnalysisRunOnBuild) { + if (settings.codeAnalysisRunOnBuild && settings.clangTidyEnabled) { clients.getClientFor(folder.uri).handleRunCodeAnalysisOnAllFiles(); } return; } } const settings: CppSettings = new CppSettings(); - if (settings.codeAnalysisRunOnBuild) { + if (settings.codeAnalysisRunOnBuild && settings.clangTidyEnabled) { clients.ActiveClient.handleRunCodeAnalysisOnAllFiles(); } } @@ -791,9 +799,9 @@ export function registerCommands(): void { disposables.push(vscode.commands.registerCommand('C_Cpp.ToggleDimInactiveRegions', onToggleDimInactiveRegions)); disposables.push(vscode.commands.registerCommand('C_Cpp.PauseParsing', onPauseParsing)); disposables.push(vscode.commands.registerCommand('C_Cpp.ResumeParsing', onResumeParsing)); - disposables.push(vscode.commands.registerCommand('C_Cpp.PauseAnalysis', onPauseAnalysis)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ResumeAnalysis', onResumeAnalysis)); - disposables.push(vscode.commands.registerCommand('C_Cpp.CancelAnalysis', onCancelAnalysis)); + disposables.push(vscode.commands.registerCommand('C_Cpp.PauseCodeAnalysis', onPauseCodeAnalysis)); + disposables.push(vscode.commands.registerCommand('C_Cpp.ResumeCodeAnalysis', onResumeCodeAnalysis)); + disposables.push(vscode.commands.registerCommand('C_Cpp.CancelCodeAnalysis', onCancelCodeAnalysis)); disposables.push(vscode.commands.registerCommand('C_Cpp.ShowParsingCommands', onShowParsingCommands)); disposables.push(vscode.commands.registerCommand('C_Cpp.ShowCodeAnalysisCommands', onShowCodeAnalysisCommands)); disposables.push(vscode.commands.registerCommand('C_Cpp.ShowReferencesProgress', onShowReferencesProgress)); @@ -973,8 +981,9 @@ function onRunCodeAnalysisOnActiveFile(): void { const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri); if (!settings.clangTidyEnabled) { showCodeAnalysisDisabledMessage(); + } else { + getActiveClient().handleRunCodeAnalysisOnActiveFile(); } - getActiveClient().handleRunCodeAnalysisOnActiveFile(); } } @@ -984,8 +993,9 @@ function onRunCodeAnalysisOnOpenFiles(): void { const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri); if (!settings.clangTidyEnabled) { showCodeAnalysisDisabledMessage(); + } else { + getActiveClient().handleRunCodeAnalysisOnOpenFiles(); } - getActiveClient().handleRunCodeAnalysisOnOpenFiles(); } } @@ -993,6 +1003,8 @@ function onRunCodeAnalysisOnAllFiles(): void { onActivationEvent(); const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri); if (!settings.clangTidyEnabled) { + showCodeAnalysisDisabledMessage(); + } else { getActiveClient().handleRunCodeAnalysisOnAllFiles(); } } @@ -1045,19 +1057,19 @@ function onResumeParsing(): void { clients.ActiveClient.resumeParsing(); } -function onPauseAnalysis(): void { +function onPauseCodeAnalysis(): void { onActivationEvent(); - clients.ActiveClient.pauseAnalysis(); + clients.ActiveClient.PauseCodeAnalysis(); } -function onResumeAnalysis(): void { +function onResumeCodeAnalysis(): void { onActivationEvent(); - clients.ActiveClient.resumeAnalysis(); + clients.ActiveClient.ResumeCodeAnalysis(); } -function onCancelAnalysis(): void { +function onCancelCodeAnalysis(): void { onActivationEvent(); - clients.ActiveClient.cancelAnalysis(); + clients.ActiveClient.CancelCodeAnalysis(); } function onShowParsingCommands(): void { diff --git a/Extension/src/LanguageServer/ui.ts b/Extension/src/LanguageServer/ui.ts index 3e227ad760..7523cb3068 100644 --- a/Extension/src/LanguageServer/ui.ts +++ b/Extension/src/LanguageServer/ui.ts @@ -150,7 +150,7 @@ export class UI { this.intelliSenseStatusBarItem.tooltip = (this.isUpdatingIntelliSense ? this.updatingIntelliSenseTooltip : "") + (twoStatus ? " | " : "") + (val ? this.runningCodeAnalysisTooltip : ""); - this.intelliSenseStatusBarItem.command = val ? "C_Cpp.ShowCodeAnalysisCommands" : ""; + this.intelliSenseStatusBarItem.command = val ? "C_Cpp.ShowCodeAnalysisCommands" : undefined; } private get ReferencesCommand(): ReferencesCommandMode { From e43e2d931ce7f9c56142cab9ed618210f786df24 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 11 Aug 2021 18:25:19 -0700 Subject: [PATCH 034/101] More fixes. --- Extension/package.json | 6 ++---- Extension/src/LanguageServer/settings.ts | 10 ++-------- Extension/tools/GenerateOptionsSchema.ts | 6 +++--- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 6682303666..6c84537c55 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -2356,10 +2356,7 @@ "scope": "machine-overridable" }, "C_Cpp.default.compilerPath": { - "type": [ - "string", - "null" - ], + "type": "string", "default": null, "markdownDescription": "%c_cpp.configuration.default.compilerPath.markdownDescription%", "scope": "machine-overridable" @@ -2418,6 +2415,7 @@ "items": { "type": "string" }, + "default": null, "markdownDescription": "%c_cpp.configuration.default.browse.path.markdownDescription%", "scope": "machine-overridable" }, diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index ea3bb86662..ede9686e48 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -191,18 +191,12 @@ export class CppSettings extends Settings { public get defaultCompileCommands(): string | undefined { return super.Section.get("default.compileCommands"); } public get defaultForcedInclude(): string[] | undefined { return super.Section.get("default.forcedInclude"); } public get defaultIntelliSenseMode(): string | undefined { return super.Section.get("default.intelliSenseMode"); } - public get defaultCompilerPath(): string | undefined { - const result: string | undefined | null = super.Section.get("default.compilerPath"); - if (result === null) { - return undefined; - } - return result; - } + public get defaultCompilerPath(): string | undefined { return super.Section.get("default.compilerPath") ?? undefined; } public get defaultCompilerArgs(): string[] | undefined { return super.Section.get("default.compilerArgs"); } public get defaultCStandard(): string | undefined { return super.Section.get("default.cStandard"); } public get defaultCppStandard(): string | undefined { return super.Section.get("default.cppStandard"); } public get defaultConfigurationProvider(): string | undefined { return super.Section.get("default.configurationProvider"); } - public get defaultBrowsePath(): string[] | undefined { return super.Section.get("default.browse.path"); } + public get defaultBrowsePath(): string[] | undefined { return super.Section.get("default.browse.path") ?? undefined; } public get defaultDatabaseFilename(): string | undefined { return super.Section.get("default.browse.databaseFilename"); } public get defaultLimitSymbolsToIncludedHeaders(): boolean | undefined { return super.Section.get("default.browse.limitSymbolsToIncludedHeaders"); } public get defaultSystemIncludePath(): string[] | undefined { return super.Section.get("default.systemIncludePath"); } diff --git a/Extension/tools/GenerateOptionsSchema.ts b/Extension/tools/GenerateOptionsSchema.ts index bc8c0e8bbf..e96779f64c 100644 --- a/Extension/tools/GenerateOptionsSchema.ts +++ b/Extension/tools/GenerateOptionsSchema.ts @@ -39,7 +39,7 @@ function mergeDefaults(parentDefault: any, childDefault: any): any { } function updateDefaults(object: any, defaults: any): any { - if (defaults != null) { + if (defaults !== null) { for (const key in object) { if (object[key].hasOwnProperty('type') && object[key].type === 'object' && object[key].properties !== null) { object[key].properties = updateDefaults(object[key].properties, mergeDefaults(defaults, object[key].default)); @@ -105,7 +105,7 @@ function replaceReferences(definitions: any, objects: any): any { } function mergeReferences(baseDefinitions: any, additionalDefinitions: any): void { - for (let key in additionalDefinitions) { + for (const key in additionalDefinitions) { if (baseDefinitions[key]) { throw `Error: '${key}' defined in multiple schema files.`; } @@ -116,7 +116,7 @@ function mergeReferences(baseDefinitions: any, additionalDefinitions: any): void function generateOptionsSchema(): void { const packageJSON: any = JSON.parse(fs.readFileSync('package.json').toString()); const schemaJSON: any = JSON.parse(fs.readFileSync('tools/OptionsSchema.json').toString()); - let symbolSettingsJSON: any = JSON.parse(fs.readFileSync('tools/VSSymbolSettings.json').toString()); + const symbolSettingsJSON: any = JSON.parse(fs.readFileSync('tools/VSSymbolSettings.json').toString()); mergeReferences(schemaJSON.definitions, symbolSettingsJSON.definitions); From 31ef7c045d28226f0be1eb03d271d33768a48f69 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 13 Aug 2021 20:25:22 -0700 Subject: [PATCH 035/101] Work in progress. --- Extension/package.json | 22 ++++++++++++++++++++++ Extension/package.nls.json | 4 +++- Extension/src/LanguageServer/client.ts | 2 ++ Extension/src/LanguageServer/settings.ts | 2 ++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Extension/package.json b/Extension/package.json index 659fd13416..291f443d82 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -252,6 +252,17 @@ "maximum": 32, "scope": "machine" }, + "C_Cpp.maxCachedProcesses": { + "type": [ + "integer", + "null" + ], + "markdownDescription": "%c_cpp.configuration.maxCachedProcesses.markdownDescription%", + "default": null, + "minimum": 0, + "maximum": 256, + "scope": "machine" + }, "C_Cpp.maxMemory": { "type": [ "integer", @@ -296,6 +307,17 @@ "maximum": 32, "scope": "machine" }, + "C_Cpp.references.maxCachedProcesses": { + "type": [ + "integer", + "null" + ], + "markdownDescription": "%c_cpp.configuration.references.maxCachedProcesses.markdownDescription%", + "default": null, + "minimum": 0, + "maximum": 32, + "scope": "machine" + }, "C_Cpp.references.maxMemory": { "type": [ "integer", diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 193774d2b4..aeb644a9cd 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -25,10 +25,12 @@ "c_cpp.command.RunCodeAnalysisOnOpenFiles.title": "Run code analysis on all open files", "c_cpp.command.RunCodeAnalysisOnAllFiles.title": "Run code analysis on all source files", "c_cpp.configuration.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may not always be used. The default of `null` uses the number of logical processors available.", + "c_cpp.configuration.maxCachedProcesses.markdownDescription": "The maximum number of cached processes to use for language service processing. The default of `null` uses twice the number of logical processors available.", "c_cpp.configuration.maxMemory.markdownDescription": "The maximum memory (in MB) available for language service processing. Fewer processes will be cached and run concurrently after this memory usage is exceeded. The default of `null` uses the system's free memory.", - "c_cpp.configuration.intelliSense.maxCachedProcesses.markdownDescription": "The maximum number of IntelliSense processes to keep running. The default of `null` uses twice the number of logical processors available.", + "c_cpp.configuration.intelliSense.maxCachedProcesses.markdownDescription": "The maximum number of IntelliSense processes to keep running. The default of `null` uses value inherited from `#C_Cpp.maxCachedProcesses#`", "c_cpp.configuration.intelliSense.maxMemory.markdownDescription": "Older IntelliSense processes will shut down before new processes are created after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "c_cpp.configuration.references.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", + "c_cpp.configuration.references.maxCachedProcesses.markdownDescription": "The maximum number of processes to keep in memory for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxCachedProcesses#`.", "c_cpp.configuration.references.maxMemory.markdownDescription": "Fewer 'Find All References' and 'Rename' processes will be cached and run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for code analysis. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 636773b720..a0848184fc 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1226,6 +1226,7 @@ export class DefaultClient implements Client { initializationOptions: { freeMemory: os.freemem() / 1048576, maxConcurrentThreads: workspaceSettings.maxConcurrentThreads, + maxCachedProcesses: workspaceSettings.maxCachedProcesses, maxMemory: workspaceSettings.maxMemory, intelliSense: { maxCachedProcesses: workspaceSettings.intelliSenseMaxCachedProcesses, @@ -1233,6 +1234,7 @@ export class DefaultClient implements Client { }, references: { maxConcurrentThreads: workspaceSettings.maxConcurrentThreads, + maxCachedProcesses: workspaceSettings.referencesMaxCachedProcesses, maxMemory: workspaceSettings.referencesMaxMemory }, codeAnalysis: { diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 82e2e9a20f..e2d8101d6f 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -145,9 +145,11 @@ export class CppSettings extends Settings { } public get maxConcurrentThreads(): number | undefined | null { return super.Section.get("maxConcurrentThreads"); } public get maxMemory(): number | undefined | null { return super.Section.get("maxMemory"); } + public get maxCachedProcesses(): number | undefined | null { return super.Section.get("maxCachedProcesses"); } public get intelliSenseMaxCachedProcesses(): number | undefined | null { return super.Section.get("intelliSense.maxCachedProcesses"); } public get intelliSenseMaxMemory(): number | undefined | null { return super.Section.get("intelliSense.maxMemory"); } public get referencesMaxConcurrentThreads(): number | undefined | null { return super.Section.get("references.maxConcurrentThreads"); } + public get referencesMaxCachedProcesses(): number | undefined | null { return super.Section.get("references.maxCachedProcesses"); } public get referencesMaxMemory(): number | undefined | null { return super.Section.get("references.maxMemory"); } public get codeAnalysisMaxConcurrentThreads(): number | undefined | null { return super.Section.get("codeAnalysis.maxConcurrentThreads"); } public get codeAnalysisMaxMemory(): number | undefined | null { return super.Section.get("codeAnalysis.maxMemory"); } From cb0e9d0764145240e80d98b1e66e44cdd4519d56 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 16 Aug 2021 17:29:42 -0700 Subject: [PATCH 036/101] Process code analysis status. --- Extension/src/LanguageServer/client.ts | 29 ++++++++++++++++++++++++++ Extension/src/LanguageServer/ui.ts | 26 +++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index a0848184fc..c2ce77f4bb 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -533,6 +533,8 @@ const ReportTextDocumentLanguage: NotificationType = new Notificat const SemanticTokensChanged: NotificationType = new NotificationType('cpptools/semanticTokensChanged'); const IntelliSenseSetupNotification: NotificationType = new NotificationType('cpptools/IntelliSenseSetup'); const SetTemporaryTextDocumentLanguageNotification: NotificationType = new NotificationType('cpptools/setTemporaryTextDocumentLanguage'); +const ReportCodeAnalysisProcessedNotification: NotificationType = new NotificationType('cpptools/reportCodeAnalysisProcessed'); +const ReportCodeAnalysisTotalNotification: NotificationType = new NotificationType('cpptools/reportCodeAnalysisTotal'); let failureMessageShown: boolean = false; @@ -548,6 +550,8 @@ class ClientModel { public isParsingFiles: DataBinding; public isUpdatingIntelliSense: DataBinding; public isRunningCodeAnalysis: DataBinding; + public codeAnalysisProcessed: DataBinding; + public codeAnalysisTotal: DataBinding; public referencesCommandMode: DataBinding; public parsingWorkspaceStatus: DataBinding; public activeConfigName: DataBinding; @@ -559,6 +563,8 @@ class ClientModel { this.isParsingFiles = new DataBinding(false); this.isUpdatingIntelliSense = new DataBinding(false); this.isRunningCodeAnalysis = new DataBinding(false); + this.codeAnalysisProcessed = new DataBinding(0); + this.codeAnalysisTotal = new DataBinding(0); this.referencesCommandMode = new DataBinding(refs.ReferencesCommandMode.None); this.parsingWorkspaceStatus = new DataBinding(""); this.activeConfigName = new DataBinding(""); @@ -571,6 +577,8 @@ class ClientModel { this.isParsingFiles.activate(); this.isUpdatingIntelliSense.activate(); this.isRunningCodeAnalysis.activate(); + this.codeAnalysisProcessed.activate(); + this.codeAnalysisTotal.activate(); this.referencesCommandMode.activate(); this.parsingWorkspaceStatus.activate(); this.activeConfigName.activate(); @@ -583,6 +591,8 @@ class ClientModel { this.isParsingFiles.deactivate(); this.isUpdatingIntelliSense.deactivate(); this.isRunningCodeAnalysis.deactivate(); + this.codeAnalysisProcessed.deactivate(); + this.codeAnalysisTotal.deactivate(); this.referencesCommandMode.deactivate(); this.parsingWorkspaceStatus.deactivate(); this.activeConfigName.deactivate(); @@ -595,6 +605,8 @@ class ClientModel { this.isParsingFiles.dispose(); this.isUpdatingIntelliSense.dispose(); this.isRunningCodeAnalysis.dispose(); + this.codeAnalysisProcessed.dispose(); + this.codeAnalysisTotal.dispose(); this.referencesCommandMode.dispose(); this.parsingWorkspaceStatus.dispose(); this.activeConfigName.dispose(); @@ -608,6 +620,8 @@ export interface Client { ParsingFilesChanged: vscode.Event; IntelliSenseParsingChanged: vscode.Event; RunningCodeAnalysisChanged: vscode.Event; + CodeAnalysisProcessedChanged: vscode.Event; + CodeAnalysisTotalChanged: vscode.Event; ReferencesCommandModeChanged: vscode.Event; TagParserStatusChanged: vscode.Event; ActiveConfigChanged: vscode.Event; @@ -725,6 +739,8 @@ export class DefaultClient implements Client { public get ParsingFilesChanged(): vscode.Event { return this.model.isParsingFiles.ValueChanged; } public get IntelliSenseParsingChanged(): vscode.Event { return this.model.isUpdatingIntelliSense.ValueChanged; } public get RunningCodeAnalysisChanged(): vscode.Event { return this.model.isRunningCodeAnalysis.ValueChanged; } + public get CodeAnalysisProcessedChanged(): vscode.Event { return this.model.codeAnalysisProcessed.ValueChanged; } + public get CodeAnalysisTotalChanged(): vscode.Event { return this.model.codeAnalysisTotal.ValueChanged; } public get ReferencesCommandModeChanged(): vscode.Event { return this.model.referencesCommandMode.ValueChanged; } public get TagParserStatusChanged(): vscode.Event { return this.model.parsingWorkspaceStatus.ValueChanged; } public get ActiveConfigChanged(): vscode.Event { return this.model.activeConfigName.ValueChanged; } @@ -2095,6 +2111,8 @@ export class DefaultClient implements Client { this.languageClient.onNotification(SemanticTokensChanged, (e) => this.semanticTokensProvider?.invalidateFile(e)); this.languageClient.onNotification(IntelliSenseSetupNotification, (e) => this.logIntellisenseSetupTime(e)); this.languageClient.onNotification(SetTemporaryTextDocumentLanguageNotification, (e) => this.setTemporaryTextDocumentLanguage(e)); + this.languageClient.onNotification(ReportCodeAnalysisProcessedNotification, (e) => this.updateCodeAnalysisProcessed(e)); + this.languageClient.onNotification(ReportCodeAnalysisTotalNotification, (e) => this.updateCodeAnalysisTotal(e)); setupOutputHandlers(); } @@ -2559,6 +2577,14 @@ export class DefaultClient implements Client { this.notifyWhenLanguageClientReady(() => this.languageClient.sendNotification(CancelCodeAnalysisNotification)); } + private updateCodeAnalysisProcessed(processed: number): void { + this.model.codeAnalysisProcessed.Value = processed; + } + + private updateCodeAnalysisTotal(total: number): void { + this.model.codeAnalysisTotal.Value = total; + } + private doneInitialCustomBrowseConfigurationCheck: Boolean = false; private onConfigurationsChanged(cppProperties: configs.CppProperties): void { @@ -3056,6 +3082,7 @@ function getLanguageServerFileName(): string { class NullClient implements Client { private booleanEvent = new vscode.EventEmitter(); + private numberEvent = new vscode.EventEmitter(); private stringEvent = new vscode.EventEmitter(); private referencesCommandModeEvent = new vscode.EventEmitter(); @@ -3065,6 +3092,8 @@ class NullClient implements Client { public get ParsingFilesChanged(): vscode.Event { return this.booleanEvent.event; } public get IntelliSenseParsingChanged(): vscode.Event { return this.booleanEvent.event; } public get RunningCodeAnalysisChanged(): vscode.Event { return this.booleanEvent.event; } + public get CodeAnalysisProcessedChanged(): vscode.Event { return this.numberEvent.event; } + public get CodeAnalysisTotalChanged(): vscode.Event { return this.numberEvent.event; } public get ReferencesCommandModeChanged(): vscode.Event { return this.referencesCommandModeEvent.event; } public get TagParserStatusChanged(): vscode.Event { return this.stringEvent.event; } public get ActiveConfigChanged(): vscode.Event { return this.stringEvent.event; } diff --git a/Extension/src/LanguageServer/ui.ts b/Extension/src/LanguageServer/ui.ts index 7523cb3068..21b77ec5a1 100644 --- a/Extension/src/LanguageServer/ui.ts +++ b/Extension/src/LanguageServer/ui.ts @@ -46,6 +46,8 @@ export class UI { private isParsingFiles: boolean = false; private isUpdatingIntelliSense: boolean = false; private isRunningCodeAnalysis: boolean = false; + private codeAnalysisProcessed: number = 0; + private codeAnalysisTotal: number = 0; private workspaceParsingStatus: string = ""; private codeAnalysisProgram: string = ""; private readonly parsingFilesTooltip: string = localize("c.cpp.parsing.open.files.tooltip", "Parsing open files"); @@ -142,6 +144,10 @@ export class UI { } private setIsRunningCodeAnalysis(val: boolean): void { + if (this.isRunningCodeAnalysis && !val) { + this.codeAnalysisTotal = 0; + this.codeAnalysisProcessed = 0; + } this.isRunningCodeAnalysis = val; const showIcon: boolean = val || this.isUpdatingIntelliSense; const twoStatus: boolean = val && this.isUpdatingIntelliSense; @@ -153,6 +159,24 @@ export class UI { this.intelliSenseStatusBarItem.command = val ? "C_Cpp.ShowCodeAnalysisCommands" : undefined; } + private updateCodeAnalysisTooltip(): void { + this.runningCodeAnalysisTooltip = localize({ key: "running.analysis.processed.tooltip", comment: [this.codeAnalysisTranslationHint] }, "Running {0}: {1} / {2} ({3}%)", this.codeAnalysisProgram, + this.codeAnalysisProcessed, this.codeAnalysisTotal, Math.floor(this.codeAnalysisProcessed / this.codeAnalysisTotal)); + } + + private setCodeAnalysisProcessed(processed: number): void { + this.codeAnalysisProcessed = processed; + if (this.codeAnalysisProcessed >= this.codeAnalysisTotal) { + this.codeAnalysisTotal = this.codeAnalysisProcessed + 1; + } + this.updateCodeAnalysisTooltip(); + } + + private setCodeAnalysisTotal(total: number): void { + this.codeAnalysisTotal = total; + this.updateCodeAnalysisTooltip(); + } + private get ReferencesCommand(): ReferencesCommandMode { return this.referencesStatusBarItem.tooltip === "" ? ReferencesCommandMode.None : (this.referencesStatusBarItem.tooltip === referencesCommandModeToString(ReferencesCommandMode.Find) ? ReferencesCommandMode.Find : @@ -247,6 +271,8 @@ export class UI { client.ParsingFilesChanged(value => { this.setIsParsingFiles(value); }); client.IntelliSenseParsingChanged(value => { this.setIsUpdatingIntelliSense(value); }); client.RunningCodeAnalysisChanged(value => { this.setIsRunningCodeAnalysis(value); }); + client.CodeAnalysisProcessedChanged(value => { this.setCodeAnalysisProcessed(value); }); + client.CodeAnalysisTotalChanged(value => { this.setCodeAnalysisTotal(value); }); client.ReferencesCommandModeChanged(value => { this.ReferencesCommand = value; }); client.TagParserStatusChanged(value => { this.TagParseStatus = value; }); client.ActiveConfigChanged(value => { this.ActiveConfig = value; }); From 01ae4b3165d2fd93475a31427b25f12d3b77239f Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 19 Aug 2021 15:34:22 -0700 Subject: [PATCH 037/101] String fixes. --- Extension/c_cpp_properties.schema.json | 26 ++++++++-------- Extension/i18n/chs/package.i18n.json | 4 +-- .../c_cpp_properties.schema.json.i18n.json | 2 +- Extension/i18n/cht/package.i18n.json | 2 +- .../c_cpp_properties.schema.json.i18n.json | 2 +- .../c_cpp_properties.schema.json.i18n.json | 2 +- .../c_cpp_properties.schema.json.i18n.json | 2 +- Extension/package.json | 14 ++++----- Extension/package.nls.json | 30 +++++++++---------- 9 files changed, 42 insertions(+), 42 deletions(-) diff --git a/Extension/c_cpp_properties.schema.json b/Extension/c_cpp_properties.schema.json index bc0b31fdfa..07f4178688 100644 --- a/Extension/c_cpp_properties.schema.json +++ b/Extension/c_cpp_properties.schema.json @@ -11,15 +11,15 @@ ], "properties": { "name": { - "description": "Configuration identifier. Mac, Linux, and Win32 are special identifiers for configurations that will be auto-selected on those platforms, but the identifier can be anything.", + "markdownDescription": "Configuration identifier. `Mac`, `Linux`, and `Win32` are special identifiers for configurations that will be auto-selected on those platforms, but the identifier can be anything.", "type": "string" }, "compilerPath": { - "description": "Full path of the compiler being used, e.g. /usr/bin/gcc, to enable more accurate IntelliSense.", + "markdownDescription": "Full path of the compiler being used, e.g. `/usr/bin/gcc`, to enable more accurate IntelliSense.", "type": "string" }, "compilerArgs": { - "description": "Compiler arguments to modify the includes or defines used, e.g. -nostdinc++, -m32, etc.", + "markdownDescription": "Compiler arguments to modify the includes or defines used, e.g. `-nostdinc++`, `-m32`, etc.", "type": "array", "items": { "type": "string" @@ -60,11 +60,11 @@ ] }, "compileCommands": { - "description": "Full path to compile_commands.json file for the workspace.", + "markdownDescription": "Full path to `compile_commands.json` file for the workspace.", "type": "string" }, "includePath": { - "description": "A list of paths for the IntelliSense engine to use while searching for included headers. Searching on these paths is not recursive. Specify '**' to indicate recursive search. For example, '${workspaceFolder}/**' will search through all subdirectories while '${workspaceFolder}' will not.", + "markdownDescription": "A list of paths for the IntelliSense engine to use while searching for included headers. Searching on these paths is not recursive. Specify `**` to indicate recursive search. For example, `${workspaceFolder}/**` will search through all subdirectories while `${workspaceFolder}` will not.", "type": "array", "items": { "type": "string" @@ -78,19 +78,19 @@ } }, "windowsSdkVersion": { - "description": "Version of the Windows SDK include path to use on Windows, e.g. '10.0.17134.0'.", + "markdownDescription": "Version of the Windows SDK include path to use on Windows, e.g. `10.0.17134.0`.", "type": "string", "pattern": "^\\d{2}\\.\\d{1}\\.\\d{5}\\.\\d{1}$|^8\\.1$" }, "defines": { - "description": "A list of preprocessor definitions for the IntelliSense engine to use while parsing files. Optionally, use = to set a value, e.g. VERSION=1.", + "markdownDescription": "A list of preprocessor definitions for the IntelliSense engine to use while parsing files. Optionally, use `=` to set a value, e.g. `VERSION=1`.", "type": "array", "items": { "type": "string" } }, "intelliSenseMode": { - "description": "The IntelliSense mode to use that maps to a platform and architecture variant of MSVC, gcc, or Clang. If not set or if set to ${default}, the extension will choose the default for that platform. Windows defaults to windows-msvc-x64, Linux defaults to linux-gcc-x64, and macOS defaults to macos-clang-x64. IntelliSense modes that only specify - variants (e.g. gcc-x64) are legacy modes and are converted automatically to the -- variants based on the host platform.", + "markdownDescription": "The IntelliSense mode to use that maps to a platform and architecture variant of MSVC, gcc, or Clang. If not set or if set to `${default}`, the extension will choose the default for that platform. Windows defaults to `windows-msvc-x64`, Linux defaults to `linux-gcc-x64`, and macOS defaults to `macos-clang-x64`. IntelliSense modes that only specify - variants (e.g. `gcc-x64`) are legacy modes and are converted automatically to the -- variants based on the host platform.", "type": "string", "enum": [ "macos-clang-x86", @@ -151,7 +151,7 @@ "type": "object", "properties": { "limitSymbolsToIncludedHeaders": { - "description": "true to process only those files directly or indirectly included as headers, false to process all files under the specified include paths.", + "markdownDescription": "`true` to process only those files directly or indirectly included as headers, `false` to process all files under the specified include paths.", "type": [ "boolean", "string" @@ -162,7 +162,7 @@ "type": "string" }, "path": { - "description": "A list of paths to use for indexing and parsing of workspace symbols (for use by Go to Definition, Find All References, etc.). Searching on these paths is recursive by default. Specify '*' to indicate non-recursive search. For example, '${workspaceFolder}' will search through all subdirectories while '${workspaceFolder}/*' will not.", + "markdownDescription": "A list of paths to use for indexing and parsing of workspace symbols (for use by Go to Definition, Find All References, etc.). Searching on these paths is recursive by default. Specify `*` to indicate non-recursive search. For example, `${workspaceFolder}` will search through all subdirectories while `${workspaceFolder}/*` will not.", "type": "array", "items": { "type": "string" @@ -173,7 +173,7 @@ }, "customConfigurationVariables": { "type": "object", - "description": "Custom variables that can be queried through the command ${cpptools:activeConfigCustomVariable} to use for the input variables in launch.json or tasks.json.", + "markdownDescription": "Custom variables that can be queried through the command `${cpptools:activeConfigCustomVariable}` to use for the input variables in `launch.json` or `tasks.json`.", "patternProperties": { "(^.+$)": { "type": "string" @@ -187,7 +187,7 @@ }, "env": { "type": "object", - "description": "Custom variables that can be reused anywhere in this file using the ${variable} or ${env:variable} syntax.", + "markdownDescription": "Custom variables that can be reused anywhere in this file using the `${variable}` or `${env:variable}` syntax.", "patternProperties": { "(?!^workspaceFolder$)(?!^workspaceRoot$)(?!^workspaceFolderBasename$)(?!^default$)(^.+$)": { "oneOf": [ @@ -212,7 +212,7 @@ "enableConfigurationSquiggles": { "type": "boolean", "default": true, - "description": "Controls whether the extension will report errors detected in c_cpp_properties.json." + "markdownDescription": "Controls whether the extension will report errors detected in `c_cpp_properties.json`." } }, "properties": { diff --git a/Extension/i18n/chs/package.i18n.json b/Extension/i18n/chs/package.i18n.json index c287f5fa07..c4b41e51fc 100644 --- a/Extension/i18n/chs/package.i18n.json +++ b/Extension/i18n/chs/package.i18n.json @@ -117,8 +117,8 @@ "c_cpp.configuration.vcFormat.wrap.preserveBlocks.allOneLineScopes.description": "无论任何“VC 格式: 新行”设置的值如何,在同一行输入左大括号和右大括号的任何代码都保留在同一行上", "c_cpp.configuration.vcFormat.wrap.preserveBlocks.never.description": "始终根据“VC 格式: 新行”设置来设定代码块的格式", "c_cpp.configuration.clang_format_path.description": "clang 格式可执行文件的完整路径。如果未指定,并且 clang 格式在环境路径中可用,则使用该格式。如果在环境路径中找不到 clang 格式,则将使用与该扩展绑定的 clang 格式的副本。", - "c_cpp.configuration.clang_format_style.description": "编码样式,当前支持: Visual Studio、LLVM、Google、Chromium、Mozilla、WebKit。使用 \"file\" 从当前目录或父目录中的 .clang 格式文件中加载样式。使用 {键: 值, ...} 设置特定参数。例如,\"Visual Studio\" 样式类似于: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }", - "c_cpp.configuration.clang_format_fallbackStyle.description": "如果使用样式 \"file\" 调用 clang 格式但是找不到 .clang 格式文件,则使用预定义的样式的名称作为回退。可能的值为 Visual Studio、LLVM、Google、Chromium、Mozilla、WebKit、none,或使用 {key: value, ...} 设置特定参数。例如,\"Visual Studio\" 样式类似于: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }", + "c_cpp.configuration.clang_format_style.description": "编码样式,当前支持: Visual Studio、LLVM、Google、Chromium、Mozilla、WebKit。使用 \"file\" 从当前目录或父目录中的 .clang-format 格式文件中加载样式。使用 {键: 值, ...} 设置特定参数。例如,\"Visual Studio\" 样式类似于: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }", + "c_cpp.configuration.clang_format_fallbackStyle.description": "如果使用样式 \"file\" 调用 clang 格式但是找不到 .clang-format 格式文件,则使用预定义的样式的名称作为回退。可能的值为 Visual Studio、LLVM、Google、Chromium、Mozilla、WebKit、none,或使用 {key: value, ...} 设置特定参数。例如,\"Visual Studio\" 样式类似于: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }", "c_cpp.configuration.clang_format_sortIncludes.description": "如果已设置,则重写由 SortIncludes 参数确定的包含排序行为。", "c_cpp.configuration.intelliSenseEngine.description": "控制 IntelliSense 提供程序。“标记分析器”提供非上下文感知的“模糊”结果。“默认”提供上下文感知结果。“已禁用”将关闭 C/C++ 语言服务功能。", "c_cpp.configuration.intelliSenseEngineFallback.description": "控制 IntelliSense 引擎是否自动切换到包含 #include 错误的翻译单元的标记分析器。", diff --git a/Extension/i18n/cht/c_cpp_properties.schema.json.i18n.json b/Extension/i18n/cht/c_cpp_properties.schema.json.i18n.json index e2cd701306..b053e18aba 100644 --- a/Extension/i18n/cht/c_cpp_properties.schema.json.i18n.json +++ b/Extension/i18n/cht/c_cpp_properties.schema.json.i18n.json @@ -20,7 +20,7 @@ "c_cpp_properties.schema.json.definitions.configurations.items.properties.browse.properties.limitSymbolsToIncludedHeaders": "設為 true,就會只處理直接或間接以標頭形式包含的檔案; 設為 false,則會處理位於指定 include 路徑下的所有檔案。", "c_cpp_properties.schema.json.definitions.configurations.items.properties.browse.properties.databaseFilename": "產生的符號資料庫路徑。如果指定了相對路徑,就會是相對於工作區預設儲存位置的路徑。", "c_cpp_properties.schema.json.definitions.configurations.items.properties.browse.properties.path": "用來為工作區符號進行索引編製與剖析的路徑清單 (供 [移至定義]、[尋找所有參考] 等使用)。根據預設,會以遞迴方式搜尋這些路徑。指定 '*' 表示非遞迴搜尋。例如,'${workspaceFolder}' 將在所有子目錄中搜尋,'${workspaceFolder}/*' 則不會。", - "c_cpp_properties.schema.json.definitions.configurations.items.properties.customConfigurationVariables": "可透過命令 ${cpptools:activeConfigCustomVariable} 查詢的自訂變數,用於 launch.json 或 tasks.js 的輸入變數。", + "c_cpp_properties.schema.json.definitions.configurations.items.properties.customConfigurationVariables": "可透過命令 ${cpptools:activeConfigCustomVariable} 查詢的自訂變數,用於 launch.json 或 tasks.json 的輸入變數。", "c_cpp_properties.schema.json.definitions.env": "可以透過使用 ${變數} 或 ${環境:變數} 語法,在此檔案中任何地方重複使用的自訂變數。", "c_cpp_properties.schema.json.definitions.version": "組態檔版本。此屬性受延伸模組管理,請勿變更。", "c_cpp_properties.schema.json.definitions.enableConfigurationSquiggles": "控制延伸模組是否會回報 c_cpp_properties.json 中偵測到的錯誤。" diff --git a/Extension/i18n/cht/package.i18n.json b/Extension/i18n/cht/package.i18n.json index faaf64396a..726ccbfe41 100644 --- a/Extension/i18n/cht/package.i18n.json +++ b/Extension/i18n/cht/package.i18n.json @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "c_cpp.capabilities.untrustedWorkspaces.description": "多個設定可能會導致工作區的本機進程得以執行,例如 C_Cpp. clang_format_path、C_Cpp addNodeAddonIncludePaths、C_Cpp. compilerPath、C_Cpp.default.configurationProvider 以及 C_Cpp. compileCommands 以及 c_cpp_properties.js 上的對等屬性。", + "c_cpp.capabilities.untrustedWorkspaces.description": "多個設定可能會導致工作區的本機進程得以執行,例如 C_Cpp.clang_format_path、C_Cpp.addNodeAddonIncludePaths、C_Cpp.compilerPath、C_Cpp.default.configurationProvider 以及 C_Cpp.compileCommands 以及 c_cpp_properties.json 上的對等屬性。", "c_cpp.command.configurationSelect.title": "選取組態...", "c_cpp.command.configurationProviderSelect.title": "變更組態提供者...", "c_cpp.command.configurationEditJSON.title": "編輯組態 (JSON)", diff --git a/Extension/i18n/ita/c_cpp_properties.schema.json.i18n.json b/Extension/i18n/ita/c_cpp_properties.schema.json.i18n.json index 3479d916e1..bdda53dd15 100644 --- a/Extension/i18n/ita/c_cpp_properties.schema.json.i18n.json +++ b/Extension/i18n/ita/c_cpp_properties.schema.json.i18n.json @@ -20,7 +20,7 @@ "c_cpp_properties.schema.json.definitions.configurations.items.properties.browse.properties.limitSymbolsToIncludedHeaders": "true per elaborare solo i file inclusi direttamente o indirettamente come intestazioni; false per elaborare tutti i file nei percorsi di inclusione specificati.", "c_cpp_properties.schema.json.definitions.configurations.items.properties.browse.properties.databaseFilename": "Percorso del database dei simboli generato. Se viene specificato un percorso relativo, sarà relativo al percorso di archiviazione predefinito dell'area di lavoro.", "c_cpp_properties.schema.json.definitions.configurations.items.properties.browse.properties.path": "Elenco di percorsi da usare per l'indicizzazione e l'analisi dei simboli dell'area di lavoro (usati da Vai alla definizione, Trova tutti i riferimenti e così via). Per impostazione predefinita, la ricerca in questi percorsi è ricorsiva. Specificare '**' per indicare la ricerca non ricorsiva. Ad esempio, con '${workspaceFolder}' la ricerca verrà estesa a tutte le sottodirectory, mentre con '${workspaceFolder}/*' sarà limitata a quella corrente.", - "c_cpp_properties.schema.json.definitions.configurations.items.properties.customConfigurationVariables": "Variabili personalizzate su cui è possibile eseguire query tramite il comando ${cpptools:activeConfigCustomVariable} da usare per le variabili di input in launch.jso o tasks.js.", + "c_cpp_properties.schema.json.definitions.configurations.items.properties.customConfigurationVariables": "Variabili personalizzate su cui è possibile eseguire query tramite il comando ${cpptools:activeConfigCustomVariable} da usare per le variabili di input in launch.json o tasks.json.", "c_cpp_properties.schema.json.definitions.env": "Variabili personalizzate che è possibile riutilizzare in qualsiasi punto del file usando la sintassi ${variabile} o ${env:variabile}.", "c_cpp_properties.schema.json.definitions.version": "Versione del file di configurazione. Questa proprietà è gestita dall'estensione. Non modificarla.", "c_cpp_properties.schema.json.definitions.enableConfigurationSquiggles": "Controlla se l'estensione segnalerà errori rilevati in c_cpp_properties.json." diff --git a/Extension/i18n/plk/c_cpp_properties.schema.json.i18n.json b/Extension/i18n/plk/c_cpp_properties.schema.json.i18n.json index 57dc6589dc..9175fcae21 100644 --- a/Extension/i18n/plk/c_cpp_properties.schema.json.i18n.json +++ b/Extension/i18n/plk/c_cpp_properties.schema.json.i18n.json @@ -20,7 +20,7 @@ "c_cpp_properties.schema.json.definitions.configurations.items.properties.browse.properties.limitSymbolsToIncludedHeaders": "Wartość true, aby przetwarzać tylko pliki bezpośrednio lub pośrednio dołączone jako nagłówki. Wartość false, aby przetwarzać wszystkie pliki w określonych ścieżkach dołączania.", "c_cpp_properties.schema.json.definitions.configurations.items.properties.browse.properties.databaseFilename": "Ścieżka do generowanej bazy danych symboli. Jeśli zostanie określona ścieżka względna, będzie to ścieżka względem domyślnej lokalizacji magazynowania obszaru roboczego.", "c_cpp_properties.schema.json.definitions.configurations.items.properties.browse.properties.path": "Lista ścieżek używanych do indeksowania i analizowania symboli obszaru roboczego (używana m.in. przez funkcje Przejście do definicji, Znajdowanie wszystkich odwołań). Wyszukiwanie na tych ścieżkach jest domyślnie rekursywne. Za pomocą znaku „*” możesz oznaczyć wyszukiwanie jako nierekursywne. Na przykład „${workspaceFolder}” przeszukuje wszystkie podkatalogi, a „${workspaceFolder}/*” już nie.", - "c_cpp_properties.schema.json.definitions.configurations.items.properties.customConfigurationVariables": "Zmienne niestandardowe, względem których można wykonywać zapytania za pomocą polecenia ${cpptools:activeConfigCustomVariable}, aby użyć ich na potrzeby zmiennych wejściowych w plikach launch.js lub tasks.js.", + "c_cpp_properties.schema.json.definitions.configurations.items.properties.customConfigurationVariables": "Zmienne niestandardowe, względem których można wykonywać zapytania za pomocą polecenia ${cpptools:activeConfigCustomVariable}, aby użyć ich na potrzeby zmiennych wejściowych w plikach launch.json lub tasks.json.", "c_cpp_properties.schema.json.definitions.env": "Zmienne niestandardowe, których można używać ponownie w dowolnym miejscu tego pliku przy użyciu składni ${zmienna} lub ${env:zmienna}.", "c_cpp_properties.schema.json.definitions.version": "Wersja pliku konfiguracji. Tą właściwością zarządza rozszerzenie. Nie zmieniaj jej.", "c_cpp_properties.schema.json.definitions.enableConfigurationSquiggles": "Określa, czy rozszerzenie będzie raportować błędy wykryte w pliku c_cpp_properties.json." diff --git a/Extension/i18n/rus/c_cpp_properties.schema.json.i18n.json b/Extension/i18n/rus/c_cpp_properties.schema.json.i18n.json index e9e5325592..6ecb31d8a7 100644 --- a/Extension/i18n/rus/c_cpp_properties.schema.json.i18n.json +++ b/Extension/i18n/rus/c_cpp_properties.schema.json.i18n.json @@ -20,7 +20,7 @@ "c_cpp_properties.schema.json.definitions.configurations.items.properties.browse.properties.limitSymbolsToIncludedHeaders": "При значении true (истина) будут обрабатываться только файлы, прямо или косвенно включенные как файлы заголовков, а при значении false (ложь) — все файлы по указанным путям для включений.", "c_cpp_properties.schema.json.definitions.configurations.items.properties.browse.properties.databaseFilename": "Путь к создаваемой базе данных символов. При указании относительного пути он будет отсчитываться от используемого в рабочей области места хранения по умолчанию.", "c_cpp_properties.schema.json.definitions.configurations.items.properties.browse.properties.path": "Список путей, используемых для индексирования и анализа символов рабочей области (для использования командами \"Перейти к определению\", \"Найти все ссылки\" и т. д.). Поиск по этим путям по умолчанию является рекурсивным. Укажите \"*\", чтобы использовать нерекурсивный поиск. Например, \"${workspaceFolder}\" будет означать поиск во всех подкаталогах, тогда как \"${workspaceFolder}/*\" — не будет.", - "c_cpp_properties.schema.json.definitions.configurations.items.properties.customConfigurationVariables": "Пользовательские переменные, которые можно запросить с помощью команды ${cpptools:activeConfigCustomVariable}, чтобы использовать в качестве входных переменных в файле launch.js или tasks.js.", + "c_cpp_properties.schema.json.definitions.configurations.items.properties.customConfigurationVariables": "Пользовательские переменные, которые можно запросить с помощью команды ${cpptools:activeConfigCustomVariable}, чтобы использовать в качестве входных переменных в файле launch.json или tasks.json.", "c_cpp_properties.schema.json.definitions.env": "Пользовательские переменные, которые могут многократно применяться в любом месте этого файла с помощью синтаксиса ${переменная} или ${env:переменная}.", "c_cpp_properties.schema.json.definitions.version": "Версия файла конфигурации. Этим свойством управляет расширение. Не изменяйте его.", "c_cpp_properties.schema.json.definitions.enableConfigurationSquiggles": "Определяет, будет ли расширение сообщать об ошибках, обнаруженных в c_cpp_properties.json." diff --git a/Extension/package.json b/Extension/package.json index 8f3761da90..5455455551 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -404,7 +404,7 @@ }, "C_Cpp.codeAnalysis.clangTidy.path": { "type": "string", - "description": "%c_cpp.configuration.codeAnalysis.clangTidy.path.description%", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.codeAnalysis.clangTidy.buildPath": { @@ -430,11 +430,11 @@ "FixErrors" ], "default": "Disabled", - "description": "%c_cpp.configuration.codeAnalysis.clangTidy.fix.description%", - "enumDescriptions": [ - "%c_cpp.configuration.codeAnalysis.clangTidy.fix.disabled.description%", - "%c_cpp.configuration.codeAnalysis.clangTidy.fix.fixIfNoErrors.description%", - "%c_cpp.configuration.codeAnalysis.clangTidy.fix.fixErrors.description%" + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.fix.markdownDescription%", + "markdownEnumDescriptions": [ + "%c_cpp.configuration.codeAnalysis.clangTidy.fix.disabled.markdownDescription%", + "%c_cpp.configuration.codeAnalysis.clangTidy.fix.fixIfNoErrors.markdownDescription%", + "%c_cpp.configuration.codeAnalysis.clangTidy.fix.fixErrors.markdownDescription%" ], "scope": "resource" }, @@ -1529,7 +1529,7 @@ }, "C_Cpp.clang_format_path": { "type": "string", - "description": "%c_cpp.configuration.clang_format_path.description%", + "markdownDescription": "%c_cpp.configuration.clang_format_path.markdownDescription%", "scope": "machine-overridable" }, "C_Cpp.clang_format_style": { diff --git a/Extension/package.nls.json b/Extension/package.nls.json index aeb644a9cd..eacb2fdbd1 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -40,21 +40,21 @@ "c_cpp.configuration.codeAnalysis.excludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", "c_cpp.configuration.codeAnalysis.runInBackground.markdownDescription": "If `true`, code analysis will run automatically in the background.", "c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription": "If `true`, code analysis will run automatically after a build is completed.", - "c_cpp.configuration.codeAnalysis.clangTidy.enabled.markdownDescription": "If `true`, code analysis using clang-tidy will be enabled.", - "c_cpp.configuration.codeAnalysis.clangTidy.path.description": "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.", - "c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for clang-tidy. If not specified, the build configuration from IntelliSense will be used.", - "c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, clang-tidy will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", - "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": "Specifies a clang-tidy configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", - "c_cpp.configuration.codeAnalysis.clangTidy.fix.description": "Determines when clang-tidy fixes should be automatically applied.", - "c_cpp.configuration.codeAnalysis.clangTidy.fix.disabled.description": "Do not automatically apply clang-tidy fixes.", - "c_cpp.configuration.codeAnalysis.clangTidy.fix.fixIfNoErrors.description": "Automatically apply clang-tidy fixes if no errors occur.", - "c_cpp.configuration.codeAnalysis.clangTidy.fix.fixErrors.description": "Automatically apply clang-tidy fixes, even if errors occur.", - "c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription": "Additional command line arguments to pass to clang-tidy. These take precedence over the equivalent `C_Cpp.codeAnalysis.clangTidy.*` settings.", - "c_cpp.configuration.codeAnalysis.clangTidy.checks.markdownDescription": "Values without a `-` prefix add clang-tidy checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly removed.", + "c_cpp.configuration.codeAnalysis.clangTidy.enabled.markdownDescription": "If `true`, code analysis using `clang-tidy` will be enabled.", + "c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription": "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.", + "c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for `clang-tidy`. If not specified, the build configuration from IntelliSense will be used.", + "c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription": "Specifies a `clang-tidy` configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, `clang-tidy` will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", + "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": "Specifies a `clang-tidy` configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", + "c_cpp.configuration.codeAnalysis.clangTidy.fix.markdownDescription": "Determines when `clang-tidy` fixes should be automatically applied.", + "c_cpp.configuration.codeAnalysis.clangTidy.fix.disabled.markdownDescription": "Do not automatically apply `clang-tidy` fixes.", + "c_cpp.configuration.codeAnalysis.clangTidy.fix.fixIfNoErrors.markdownDescription": "Automatically apply `clang-tidy` fixes if no errors occur.", + "c_cpp.configuration.codeAnalysis.clangTidy.fix.fixErrors.markdownDescription": "Automatically apply `clang-tidy` fixes, even if errors occur.", + "c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription": "Additional command line arguments to pass to `clang-tidy`. These take precedence over the equivalent `C_Cpp.codeAnalysis.clangTidy.*` settings.", + "c_cpp.configuration.codeAnalysis.clangTidy.checks.markdownDescription": "Values without a `-` prefix add `clang-tidy` checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly removed.", "c_cpp.configuration.formatting.description": "Configures the formatting engine", - "c_cpp.configuration.formatting.clangFormat.markdownDescription": "clang-format will be used to format code.", + "c_cpp.configuration.formatting.clangFormat.markdownDescription": "`clang-format` will be used to format code.", "c_cpp.configuration.formatting.vcFormat.markdownDescription": "The Visual C++ formatting engine will be used to format code.", - "c_cpp.configuration.formatting.Default.markdownDescription": "By default, clang-format will be used to format the code. However, the Visual C++ formatting engine will be used if an `.editorconfig` file with relevant settings is found nearer to the code being formatted and `#C_Cpp.clang_format_style#` is the default value: `file`.", + "c_cpp.configuration.formatting.Default.markdownDescription": "By default, `clang-format` will be used to format the code. However, the Visual C++ formatting engine will be used if an `.editorconfig` file with relevant settings is found nearer to the code being formatted and `#C_Cpp.clang_format_style#` is the default value: `file`.", "c_cpp.configuration.formatting.Disabled.markdownDescription": "Code formatting will be disabled.", "c_cpp.configuration.vcFormat.indent.braces.markdownDescription": "Braces are indented by the amount specified in the `#editor.tabSize#` setting.", "c_cpp.configuration.vcFormat.indent.multiLineRelativeTo.description": "Determines what new line indentation is relative to.", @@ -141,9 +141,9 @@ "c_cpp.configuration.vcFormat.wrap.preserveBlocks.oneLiners.markdownDescription": "A complete code block that is entered on one line is kept on one line, regardless of the values of any of the `C_Cpp.vcFormat.newLine.*` settings.", "c_cpp.configuration.vcFormat.wrap.preserveBlocks.allOneLineScopes.markdownDescription": "Any code where the opening and closing brace is entered on one line is kept on one line, regardless of the values of any of the `C_Cpp.vcFormat.newLine.*` settings.", "c_cpp.configuration.vcFormat.wrap.preserveBlocks.never.markdownDescription": "Code blocks are always formatted based on the values of the `C_Cpp.vcFormat.newLine.*` settings.", - "c_cpp.configuration.clang_format_path.description": "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.", + "c_cpp.configuration.clang_format_path.markdownDescription": "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.", "c_cpp.configuration.clang_format_style.markdownDescription": "Coding style, currently supports: `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`. Use `file` to load the style from a `.clang-format` file in the current or parent directory. Use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", - "c_cpp.configuration.clang_format_fallbackStyle.markdownDescription": "Name of the predefined style used as a fallback in case clang-format is invoked with style `file` but the `.clang-format` file is not found. Possible values are `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`, `none`, or use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", + "c_cpp.configuration.clang_format_fallbackStyle.markdownDescription": "Name of the predefined style used as a fallback in case `clang-format` is invoked with style `file` but the `.clang-format` file is not found. Possible values are `Visual Studio`, `LLVM`, `Google`, `Chromium`, `Mozilla`, `WebKit`, `Microsoft`, `GNU`, `none`, or use `{key: value, ...}` to set specific parameters. For example, the `Visual Studio` style is similar to: `{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }`", "c_cpp.configuration.clang_format_sortIncludes.markdownDescription": "If set, overrides the include sorting behavior determined by the `SortIncludes` parameter.", "c_cpp.configuration.intelliSenseEngine.description": "Controls the IntelliSense provider.", "c_cpp.configuration.intelliSenseEngine.default.description": "Provides context-aware results via a separate IntelliSense process.", From 3e65a5f3cf2124e4ab395f0502e9852c583dff20 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 19 Aug 2021 15:40:50 -0700 Subject: [PATCH 038/101] Another fix. --- Extension/i18n/csy/package.i18n.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/i18n/csy/package.i18n.json b/Extension/i18n/csy/package.i18n.json index 4ed61a342e..78397aa344 100644 --- a/Extension/i18n/csy/package.i18n.json +++ b/Extension/i18n/csy/package.i18n.json @@ -118,7 +118,7 @@ "c_cpp.configuration.vcFormat.wrap.preserveBlocks.never.description": "Bloky kódu se budou vždy formátovat podle hodnot nastavení Formát VC: Nový řádek.", "c_cpp.configuration.clang_format_path.description": "Úplná cesta ke spustitelnému souboru clang-format. Pokud se nespecifikuje a clang-format je k dispozici na cestě prostředí, použije se. Pokud se na cestě prostředí nenajde, použije se kopie clang-format, která se dodává spolu s rozšířením.", "c_cpp.configuration.clang_format_style.description": "Styl kódování, v současné době se podporuje: Visual Studio, LLVM, Google, Chromium, Mozilla, WebKit. Pokud chcete načíst styl ze souboru .clang-format v aktuálním nebo nadřazeném adresáři, použijte možnost file. Pokud chcete zadat konkrétní parametry, použijte {klíč: hodnota, ...}. Například styl Visual Studio je podobný tomuto: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }", - "c_cpp.configuration.clang_format_fallbackStyle.description": "Název předdefinovaného stylu, který se použije jako záloha v případě, že se vyvolá formát Clang se stylem file, ale nenajde se soubor .clang-format. Možné hodnoty jsou Visual Studio, LLVM, Google, Chromium, Mozilla, WebKit, none, případně můžete použít {klíč: hodnota, ...} a nastavit konkrétní parametry. Například styl Visual Studio je podobný tomuto: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }", + "c_cpp.configuration.clang_format_fallbackStyle.description": "Název předdefinovaného stylu, který se použije jako záloha v případě, že se vyvolá clang-format se stylem file, ale nenajde se soubor .clang-format. Možné hodnoty jsou Visual Studio, LLVM, Google, Chromium, Mozilla, WebKit, none, případně můžete použít {klíč: hodnota, ...} a nastavit konkrétní parametry. Například styl Visual Studio je podobný tomuto: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Allman, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All, FixNamespaceComments: false }", "c_cpp.configuration.clang_format_sortIncludes.description": "Pokud se nastaví, přepíše chování řazení vložených souborů určené parametrem SortIncludes.", "c_cpp.configuration.intelliSenseEngine.description": "Určuje poskytovatele IntelliSense. Analyzátor značek nabízí přibližné výsledky, které neberou v potaz kontext. Možnost Výchozí nabízí výsledky, které kontext v potaz berou. Možnost Zakázáno vypne funkce služby jazyka C/C++.", "c_cpp.configuration.intelliSenseEngineFallback.description": "Určuje, jestli se modul IntelliSense automaticky přepne na analyzátor značek pro jednotky překladu, které obsahují chyby direktiv #include.", From 2c94a9681ae583b92558c0bbc781be5234a3891d Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 20 Aug 2021 17:47:58 -0700 Subject: [PATCH 039/101] Ignore clangTidy.enabled during manual invocation. --- Extension/package.json | 5 +++++ Extension/package.nls.json | 6 +++--- Extension/src/LanguageServer/client.ts | 3 --- Extension/src/LanguageServer/extension.ts | 25 +++-------------------- 4 files changed, 11 insertions(+), 28 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index b0e718d3ec..74a79d500f 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -3818,6 +3818,11 @@ "when": "editorLangId == 'c' || editorLangId == 'cpp' || editorLangId == 'cuda-cpp'", "command": "C_Cpp.BuildAndDebugActiveFile", "group": "other2_debug@1" + }, + { + "when": "editorLangId == 'c' || editorLangId == 'cpp' || editorLangId == 'cuda-cpp'", + "command": "C_Cpp.RunCodeAnalysisOnActiveFile", + "group": "other2_debug@2" } ], "commandPalette": [ diff --git a/Extension/package.nls.json b/Extension/package.nls.json index eacb2fdbd1..0292810b9a 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -21,9 +21,9 @@ "c_cpp.command.generateEditorConfig.title": "Generate EditorConfig contents from VC Format settings", "c_cpp.command.GoToNextDirectiveInGroup.title": "Go to next preprocessor directive in conditional group", "c_cpp.command.GoToPrevDirectiveInGroup.title": "Go to previous preprocessor directive in conditional group", - "c_cpp.command.RunCodeAnalysisOnActiveFile.title": "Run code analysis on the active file", - "c_cpp.command.RunCodeAnalysisOnOpenFiles.title": "Run code analysis on all open files", - "c_cpp.command.RunCodeAnalysisOnAllFiles.title": "Run code analysis on all source files", + "c_cpp.command.RunCodeAnalysisOnActiveFile.title": "Run Code Analysis (active file)", + "c_cpp.command.RunCodeAnalysisOnOpenFiles.title": "Run Code Analysis (open files)", + "c_cpp.command.RunCodeAnalysisOnAllFiles.title": "Run Code Analysis (source files)", "c_cpp.configuration.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may not always be used. The default of `null` uses the number of logical processors available.", "c_cpp.configuration.maxCachedProcesses.markdownDescription": "The maximum number of cached processes to use for language service processing. The default of `null` uses twice the number of logical processors available.", "c_cpp.configuration.maxMemory.markdownDescription": "The maximum memory (in MB) available for language service processing. Fewer processes will be cached and run concurrently after this memory usage is exceeded. The default of `null` uses the system's free memory.", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index c2ce77f4bb..f8a33759cb 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1020,7 +1020,6 @@ export class DefaultClient implements Client { const settings_clangFormatFallbackStyle: (string | undefined)[] = []; const settings_clangFormatSortIncludes: (string | undefined)[] = []; const settings_codeAnalysisExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; - const settings_clangTidyEnabled: (boolean | undefined)[] = []; const settings_clangTidyPath: (string | undefined)[] = []; const settings_clangTidyBuildPath: (string | undefined)[] = []; const settings_clangTidyConfig: (string | undefined)[] = []; @@ -1125,7 +1124,6 @@ export class DefaultClient implements Client { for (const setting of settings) { settings_clangFormatPath.push(util.resolveVariables(setting.clangFormatPath, this.AdditionalEnvironment)); settings_codeAnalysisExclude.push(setting.codeAnalysisExclude); - settings_clangTidyEnabled.push(setting.clangTidyEnabled); settings_clangTidyPath.push(util.resolveVariables(setting.clangTidyPath, this.AdditionalEnvironment)); settings_clangTidyBuildPath.push(setting.clangTidyBuildPath); settings_clangTidyConfig.push(setting.clangTidyConfig); @@ -1259,7 +1257,6 @@ export class DefaultClient implements Client { updateDelay: workspaceSettings.codeAnalysisUpdateDelay, exclude: settings_codeAnalysisExclude, clangTidy: { - enabled: settings_clangTidyEnabled, path: settings_clangTidyPath, buildPath: settings_clangTidyBuildPath, config: settings_clangTidyConfig, diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 83bfe7ced8..c06a34e89f 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -975,42 +975,23 @@ function onCheckForCompiler(): void { client.handleCheckForCompiler(); } -function showCodeAnalysisDisabledMessage(): void { - vscode.window.showInformationMessage(localize('no.code.analysis.enabled', 'Set a C_Cpp.codeAnalysis..enabled setting to true to enable code analysis.')); -} - function onRunCodeAnalysisOnActiveFile(): void { onActivationEvent(); if (activeDocument !== "") { - const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri); - if (!settings.clangTidyEnabled) { - showCodeAnalysisDisabledMessage(); - } else { - getActiveClient().handleRunCodeAnalysisOnActiveFile(); - } + getActiveClient().handleRunCodeAnalysisOnActiveFile(); } } function onRunCodeAnalysisOnOpenFiles(): void { onActivationEvent(); if (openFileVersions.size > 0) { - const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri); - if (!settings.clangTidyEnabled) { - showCodeAnalysisDisabledMessage(); - } else { - getActiveClient().handleRunCodeAnalysisOnOpenFiles(); - } + getActiveClient().handleRunCodeAnalysisOnOpenFiles(); } } function onRunCodeAnalysisOnAllFiles(): void { onActivationEvent(); - const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri); - if (!settings.clangTidyEnabled) { - showCodeAnalysisDisabledMessage(); - } else { - getActiveClient().handleRunCodeAnalysisOnAllFiles(); - } + getActiveClient().handleRunCodeAnalysisOnAllFiles(); } function onAddToIncludePath(path: string): void { From 0d40de17e000239abf3f62fa728982365a0d24b3 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 20 Aug 2021 17:51:35 -0700 Subject: [PATCH 040/101] Change string. --- Extension/package.nls.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 0292810b9a..91bfa58a5c 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -21,9 +21,9 @@ "c_cpp.command.generateEditorConfig.title": "Generate EditorConfig contents from VC Format settings", "c_cpp.command.GoToNextDirectiveInGroup.title": "Go to next preprocessor directive in conditional group", "c_cpp.command.GoToPrevDirectiveInGroup.title": "Go to previous preprocessor directive in conditional group", - "c_cpp.command.RunCodeAnalysisOnActiveFile.title": "Run Code Analysis (active file)", - "c_cpp.command.RunCodeAnalysisOnOpenFiles.title": "Run Code Analysis (open files)", - "c_cpp.command.RunCodeAnalysisOnAllFiles.title": "Run Code Analysis (source files)", + "c_cpp.command.RunCodeAnalysisOnActiveFile.title": "Run Code Analysis on Active File", + "c_cpp.command.RunCodeAnalysisOnOpenFiles.title": "Run Code Analysis on Open Files", + "c_cpp.command.RunCodeAnalysisOnAllFiles.title": "Run Code Analysis on All Files", "c_cpp.configuration.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may not always be used. The default of `null` uses the number of logical processors available.", "c_cpp.configuration.maxCachedProcesses.markdownDescription": "The maximum number of cached processes to use for language service processing. The default of `null` uses twice the number of logical processors available.", "c_cpp.configuration.maxMemory.markdownDescription": "The maximum memory (in MB) available for language service processing. Fewer processes will be cached and run concurrently after this memory usage is exceeded. The default of `null` uses the system's free memory.", From 8b8bed5aa2943b4c3463b865769411c1675e5369 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 24 Aug 2021 18:18:36 -0700 Subject: [PATCH 041/101] More fixes. --- Extension/c_cpp_properties.schema.json | 2 +- Extension/gulpfile.js | 2 +- Extension/package.json | 30 +++++++++++++----------- Extension/package.nls.json | 9 ++++--- Extension/src/LanguageServer/client.ts | 14 ++++++++--- Extension/src/LanguageServer/settings.ts | 4 +++- 6 files changed, 36 insertions(+), 25 deletions(-) diff --git a/Extension/c_cpp_properties.schema.json b/Extension/c_cpp_properties.schema.json index 223e1836c4..1dcd516fb8 100644 --- a/Extension/c_cpp_properties.schema.json +++ b/Extension/c_cpp_properties.schema.json @@ -64,7 +64,7 @@ "type": "string" }, "includePath": { - "markdownDescription": "A list of paths for the IntelliSense engine to use while searching for included headers. Searching on these paths is not recursive. Specify `**` to indicate recursive search. For example, `${workspaceFolder}/**` will search through all subdirectories while `${workspaceFolder}` will not.", + "markdownDescription": "A list of paths for the IntelliSense engine to use while searching for included headers. Searching on these paths is not recursive. Specify `**` to indicate recursive search. For example, `${workspaceFolder}/**` will search through all subdirectories while `${workspaceFolder}` will not. Usually, this should not include system includes; instead, set `#C_Cpp.default.compilerPath#`.", "type": "array", "items": { "type": "string" diff --git a/Extension/gulpfile.js b/Extension/gulpfile.js index 803eba83cf..9d63b22340 100644 --- a/Extension/gulpfile.js +++ b/Extension/gulpfile.js @@ -192,7 +192,7 @@ const processHtmlFiles = () => { const traverseJson = (jsonTree, descriptionCallback, prefixPath) => { for (let fieldName in jsonTree) { if (jsonTree[fieldName] !== null) { - if (typeof (jsonTree[fieldName]) == "string" && fieldName === "description") { + if (typeof (jsonTree[fieldName]) == "string" && (fieldName === "description" || fieldName === "markdownDescription")) { descriptionCallback(prefixPath, jsonTree[fieldName], jsonTree); } else if (typeof (jsonTree[fieldName]) == "object") { let path = prefixPath; diff --git a/Extension/package.json b/Extension/package.json index e00fb6a71d..a2bd86230c 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -422,20 +422,22 @@ "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription%", "scope": "resource" }, - "C_Cpp.codeAnalysis.clangTidy.fix": { - "type": "string", - "enum": [ - "Disabled", - "FixIfNoErrors", - "FixErrors" - ], - "default": "Disabled", - "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.fix.markdownDescription%", - "markdownEnumDescriptions": [ - "%c_cpp.configuration.codeAnalysis.clangTidy.fix.disabled.markdownDescription%", - "%c_cpp.configuration.codeAnalysis.clangTidy.fix.fixIfNoErrors.markdownDescription%", - "%c_cpp.configuration.codeAnalysis.clangTidy.fix.fixErrors.markdownDescription%" - ], + "C_Cpp.codeAnalysis.clangTidy.fix.warnings": { + "type": "boolean", + "default": "false", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.fix.warnings.markdownDescription%", + "scope": "resource" + }, + "C_Cpp.codeAnalysis.clangTidy.fix.errors": { + "type": "boolean", + "default": "false", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.fix.errors.markdownDescription%", + "scope": "resource" + }, + "C_Cpp.codeAnalysis.clangTidy.fix.notes": { + "type": "boolean", + "default": "false", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.fix.notes.markdownDescription%", "scope": "resource" }, "C_Cpp.codeAnalysis.clangTidy.args": { diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 91bfa58a5c..a82d8f14e1 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -45,10 +45,9 @@ "c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for `clang-tidy`. If not specified, the build configuration from IntelliSense will be used.", "c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription": "Specifies a `clang-tidy` configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, `clang-tidy` will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": "Specifies a `clang-tidy` configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", - "c_cpp.configuration.codeAnalysis.clangTidy.fix.markdownDescription": "Determines when `clang-tidy` fixes should be automatically applied.", - "c_cpp.configuration.codeAnalysis.clangTidy.fix.disabled.markdownDescription": "Do not automatically apply `clang-tidy` fixes.", - "c_cpp.configuration.codeAnalysis.clangTidy.fix.fixIfNoErrors.markdownDescription": "Automatically apply `clang-tidy` fixes if no errors occur.", - "c_cpp.configuration.codeAnalysis.clangTidy.fix.fixErrors.markdownDescription": "Automatically apply `clang-tidy` fixes, even if errors occur.", + "c_cpp.configuration.codeAnalysis.clangTidy.fix.warnings.markdownDescription": "If `true`, `clang-tidy` fixes for warnings are automatically applied. No fixes are applied if errors occur unless `#C_Cpp.codeAnalysis.clangTidy.fix.errors#` is also set.", + "c_cpp.configuration.codeAnalysis.clangTidy.fix.errors.markdownDescription": "If `true`, `clang-tidy` fixes for warnings and errors are automatically applied.", + "c_cpp.configuration.codeAnalysis.clangTidy.fix.notes.markdownDescription": "If `true`, `clang-tidy` fixes for warnings are automatically applied, along with fixes found through an associated diagnostic note.", "c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription": "Additional command line arguments to pass to `clang-tidy`. These take precedence over the equivalent `C_Cpp.codeAnalysis.clangTidy.*` settings.", "c_cpp.configuration.codeAnalysis.clangTidy.checks.markdownDescription": "Values without a `-` prefix add `clang-tidy` checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly removed.", "c_cpp.configuration.formatting.description": "Configures the formatting engine", @@ -176,7 +175,7 @@ "c_cpp.configuration.intelliSenseCacheSize.markdownDescription": "Maximum size of the per-workspace hard drive space in megabytes (MB) for cached precompiled headers; the actual usage may fluctuate around this value. The default size is `5120` MB. Precompiled header caching is disabled when the size is `0`.", "c_cpp.configuration.intelliSenseMemoryLimit.markdownDescription": "Memory usage limit in megabytes (MB) of an IntelliSense process. The default is `4096` and the maximum is `16384`. The extension will shutdown and restart an IntelliSense process when it exceeds the limit.", "c_cpp.configuration.intelliSenseUpdateDelay.description": "Controls the delay in milliseconds before IntelliSense starts updating after a modification.", - "c_cpp.configuration.default.includePath.markdownDescription": "The value to use in a configuration if `includePath` is not specified in `c_cpp_properties.json`. If `includePath` is specified, add `${default}` to the array to insert the values from this setting.", + "c_cpp.configuration.default.includePath.markdownDescription": "The value to use in a configuration if `includePath` is not specified in `c_cpp_properties.json`. If `includePath` is specified, add `${default}` to the array to insert the values from this setting. Usually, this should not include system includes; instead, set `#C_Cpp.default.compilerPath#`.", "c_cpp.configuration.default.defines.markdownDescription": "The value to use in a configuration if `defines` is not specified, or the values to insert if `${default}` is present in `defines`.", "c_cpp.configuration.default.macFrameworkPath.markdownDescription": "The value to use in a configuration if `macFrameworkPath` is not specified, or the values to insert if `${default}` is present in `macFrameworkPath`.", "c_cpp.configuration.default.windowsSdkVersion.markdownDescription": "Version of the Windows SDK include path to use on Windows, e.g. `10.0.17134.0`.", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index f8a33759cb..42d7c1f973 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1024,7 +1024,9 @@ export class DefaultClient implements Client { const settings_clangTidyBuildPath: (string | undefined)[] = []; const settings_clangTidyConfig: (string | undefined)[] = []; const settings_clangTidyFallbackConfig: (string | undefined)[] = []; - const settings_clangTidyFix: (string | undefined)[] = []; + const settings_clangTidyFixWarnings: (boolean | undefined)[] = []; + const settings_clangTidyFixErrors: (boolean | undefined)[] = []; + const settings_clangTidyFixNotes: (boolean | undefined)[] = []; const settings_clangTidyArgs: (string | undefined)[] = []; const settings_clangTidyChecks: (string[] | undefined)[] = []; const settings_filesEncoding: (string | undefined)[] = []; @@ -1128,7 +1130,9 @@ export class DefaultClient implements Client { settings_clangTidyBuildPath.push(setting.clangTidyBuildPath); settings_clangTidyConfig.push(setting.clangTidyConfig); settings_clangTidyFallbackConfig.push(setting.clangTidyFallbackConfig); - settings_clangTidyFix.push(setting.clangTidyFix); + settings_clangTidyFixWarnings.push(setting.clangTidyFixWarnings); + settings_clangTidyFixErrors.push(setting.clangTidyFixErrors); + settings_clangTidyFixNotes.push(setting.clangTidyFixNotes); settings_clangTidyArgs.push(setting.clangTidyArgs); settings_clangTidyChecks.push(setting.clangTidyChecks); settings_indentBraces.push(setting.vcFormatIndentBraces); @@ -1261,7 +1265,11 @@ export class DefaultClient implements Client { buildPath: settings_clangTidyBuildPath, config: settings_clangTidyConfig, fallbackConfig: settings_clangTidyFallbackConfig, - fix: settings_clangTidyFix, + fix: { + settings_clangTidyFixWarnings, + settings_clangTidyFixErrors, + settings_clangTidyFixNotes + }, args: settings_clangTidyArgs, checks: settings_clangTidyChecks } diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index e2d8101d6f..9a9304effd 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -161,7 +161,9 @@ export class CppSettings extends Settings { public get clangTidyBuildPath(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.buildPath"); } public get clangTidyConfig(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.config"); } public get clangTidyFallbackConfig(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.fallbackConfig"); } - public get clangTidyFix(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.fix"); } + public get clangTidyFixWarnings(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.warnings"); } + public get clangTidyFixErrors(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.errors"); } + public get clangTidyFixNotes(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.notes"); } public get clangTidyArgs(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.args"); } public get clangTidyChecks(): string[] | undefined { return super.Section.get("codeAnalysis.clangTidy.checks"); } public get clangFormatStyle(): string | undefined { return super.Section.get("clang_format_style"); } From c77256b75a7c1e98341a13b3044a3eb24be1c644 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 31 Aug 2021 16:15:18 -0700 Subject: [PATCH 042/101] Work in progress. --- Extension/package.nls.json | 2 +- Extension/src/LanguageServer/client.ts | 20 +++++++++++++++----- Extension/src/LanguageServer/extension.ts | 3 +++ Extension/src/LanguageServer/settings.ts | 1 + 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Extension/package.nls.json b/Extension/package.nls.json index a82d8f14e1..5fd15407fa 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -34,7 +34,7 @@ "c_cpp.configuration.references.maxMemory.markdownDescription": "Fewer 'Find All References' and 'Rename' processes will be cached and run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for code analysis. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", - "c_cpp.configuration.codeAnalysis.updateDelay.description": "Controls the delay in milliseconds before code analysis starts processing after a modification.", + "c_cpp.configuration.codeAnalysis.updateDelay.description": "Controls the delay in milliseconds before code analysis starts processing after a save is triggered from an edit when `#files.autoSave#` is `afterDelay` and `#C_Cpp.runInBackground#` is `true`.", "c_cpp.configuration.codeAnalysis.exclude.markdownDescription": "Configure glob patterns for excluding folders and files for code analysis. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "c_cpp.configuration.codeAnalysis.excludeBoolean.description": "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.", "c_cpp.configuration.codeAnalysis.excludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 42d7c1f973..d1b4a5dd6f 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1020,6 +1020,8 @@ export class DefaultClient implements Client { const settings_clangFormatFallbackStyle: (string | undefined)[] = []; const settings_clangFormatSortIncludes: (string | undefined)[] = []; const settings_codeAnalysisExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; + const settings_codeAnalysisRunInBackground: (boolean | undefined)[] = []; + const settings_clangTidyEnabled: (boolean | undefined)[] = []; const settings_clangTidyPath: (string | undefined)[] = []; const settings_clangTidyBuildPath: (string | undefined)[] = []; const settings_clangTidyConfig: (string | undefined)[] = []; @@ -1032,6 +1034,7 @@ export class DefaultClient implements Client { const settings_filesEncoding: (string | undefined)[] = []; const settings_cppFilesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; const settings_filesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; + const settings_filesAutoSaveAfterDelay: boolean[] = []; const settings_searchExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; const settings_editorAutoClosingBrackets: (string | undefined)[] = []; const settings_intelliSenseEngine: (string | undefined)[] = []; @@ -1126,6 +1129,8 @@ export class DefaultClient implements Client { for (const setting of settings) { settings_clangFormatPath.push(util.resolveVariables(setting.clangFormatPath, this.AdditionalEnvironment)); settings_codeAnalysisExclude.push(setting.codeAnalysisExclude); + settings_codeAnalysisRunInBackground.push(setting.codeAnalysisRunInBackground); + settings_clangTidyEnabled.push(setting.clangTidyEnabled); settings_clangTidyPath.push(util.resolveVariables(setting.clangTidyPath, this.AdditionalEnvironment)); settings_clangTidyBuildPath.push(setting.clangTidyBuildPath); settings_clangTidyConfig.push(setting.clangTidyConfig); @@ -1216,6 +1221,7 @@ export class DefaultClient implements Client { for (const otherSetting of otherSettings) { settings_filesEncoding.push(otherSetting.filesEncoding); settings_filesExclude.push(otherSetting.filesExclude); + settings_filesAutoSaveAfterDelay.push(otherSetting.filesAutoSaveAfterDelay); settings_searchExclude.push(otherSetting.searchExclude); settings_editorAutoClosingBrackets.push(otherSetting.editorAutoClosingBrackets); } @@ -1260,15 +1266,17 @@ export class DefaultClient implements Client { maxMemory: workspaceSettings.codeAnalysisMaxMemory, updateDelay: workspaceSettings.codeAnalysisUpdateDelay, exclude: settings_codeAnalysisExclude, + runInBackground: settings_codeAnalysisRunInBackground, clangTidy: { + enabled: settings_clangTidyEnabled, path: settings_clangTidyPath, buildPath: settings_clangTidyBuildPath, config: settings_clangTidyConfig, fallbackConfig: settings_clangTidyFallbackConfig, fix: { - settings_clangTidyFixWarnings, - settings_clangTidyFixErrors, - settings_clangTidyFixNotes + warnings: settings_clangTidyFixWarnings, + errors: settings_clangTidyFixErrors, + notes: settings_clangTidyFixNotes }, args: settings_clangTidyArgs, checks: settings_clangTidyChecks @@ -1353,7 +1361,8 @@ export class DefaultClient implements Client { clang_format_sortIncludes: settings_clangFormatSortIncludes, extension_path: util.extensionPath, files: { - encoding: settings_filesEncoding + encoding: settings_filesEncoding, + autoSaveAfterDelay: settings_filesAutoSaveAfterDelay }, editor: { autoClosingBrackets: settings_editorAutoClosingBrackets @@ -1471,7 +1480,8 @@ export class DefaultClient implements Client { files: { encoding: otherSettingsFolder.filesEncoding, exclude: vscode.workspace.getConfiguration("files.exclude", this.RootUri), - associations: new OtherSettings().filesAssociations + associations: new OtherSettings().filesAssociations, + autoSaveAfterDelay: otherSettingsFolder.filesAutoSaveAfterDelay }, workspace_fallback_encoding: otherSettingsWorkspace.filesEncoding, search: { diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index c06a34e89f..dd8a1ba4c7 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -979,6 +979,7 @@ function onRunCodeAnalysisOnActiveFile(): void { onActivationEvent(); if (activeDocument !== "") { getActiveClient().handleRunCodeAnalysisOnActiveFile(); + vscode.commands.executeCommand("workbench.action.files.saveAll"); } } @@ -986,12 +987,14 @@ function onRunCodeAnalysisOnOpenFiles(): void { onActivationEvent(); if (openFileVersions.size > 0) { getActiveClient().handleRunCodeAnalysisOnOpenFiles(); + vscode.commands.executeCommand("workbench.action.files.saveAll"); } } function onRunCodeAnalysisOnAllFiles(): void { onActivationEvent(); getActiveClient().handleRunCodeAnalysisOnAllFiles(); + vscode.commands.executeCommand("workbench.action.files.saveAll"); } function onAddToIncludePath(path: string): void { diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 9a9304effd..28a20f7393 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -753,6 +753,7 @@ export class OtherSettings { vscode.workspace.getConfiguration("files").update("associations", value, vscode.ConfigurationTarget.Workspace); } public get filesExclude(): vscode.WorkspaceConfiguration | undefined { return vscode.workspace.getConfiguration("files", this.resource).get("exclude"); } + public get filesAutoSaveAfterDelay(): boolean { return vscode.workspace.getConfiguration("files", this.resource).get("autoSave") === "afterDelay"; } public get searchExclude(): vscode.WorkspaceConfiguration | undefined { return vscode.workspace.getConfiguration("search", this.resource).get("exclude"); } public get settingsEditor(): string | undefined { return vscode.workspace.getConfiguration("workbench.settings").get("editor"); } From 55c1d6bc057c90c511ce14d03c2245aafcba13f2 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 1 Sep 2021 15:38:28 -0700 Subject: [PATCH 043/101] Fix cancel/pause/resume. --- Extension/package.json | 6 +++--- Extension/src/LanguageServer/client.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index a2bd86230c..da71b91f19 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -353,11 +353,11 @@ }, "C_Cpp.codeAnalysis.updateDelay": { "type": "number", - "default": 3000, + "default": 2000, "description": "%c_cpp.configuration.codeAnalysis.updateDelay.description%", "scope": "application", - "minimum": 1000, - "maximum": 5000 + "minimum": 0, + "maximum": 6000 }, "C_Cpp.codeAnalysis.exclude": { "type": "object", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index d1b4a5dd6f..10ba41d661 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -491,9 +491,9 @@ const FileDeletedNotification: NotificationType = new N const ResetDatabaseNotification: NotificationType = new NotificationType('cpptools/resetDatabase'); const PauseParsingNotification: NotificationType = new NotificationType('cpptools/pauseParsing'); const ResumeParsingNotification: NotificationType = new NotificationType('cpptools/resumeParsing'); -const PauseCodeAnalysisNotification: NotificationType = new NotificationType('cpptools/PauseCodeAnalysis'); -const ResumeCodeAnalysisNotification: NotificationType = new NotificationType('cpptools/ResumeCodeAnalysis'); -const CancelCodeAnalysisNotification: NotificationType = new NotificationType('cpptools/CancelCodeAnalysis'); +const PauseCodeAnalysisNotification: NotificationType = new NotificationType('cpptools/pauseCodeAnalysis'); +const ResumeCodeAnalysisNotification: NotificationType = new NotificationType('cpptools/resumeCodeAnalysis'); +const CancelCodeAnalysisNotification: NotificationType = new NotificationType('cpptools/cancelCodeAnalysis'); const ActiveDocumentChangeNotification: NotificationType = new NotificationType('cpptools/activeDocumentChange'); const TextEditorSelectionChangeNotification: NotificationType = new NotificationType('cpptools/textEditorSelectionChange'); const ChangeCppPropertiesNotification: NotificationType = new NotificationType('cpptools/didChangeCppProperties'); From b3b867fbb63e9fe09727217352f877f873d02eb5 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 1 Sep 2021 17:55:39 -0700 Subject: [PATCH 044/101] Update plist. --- Extension/package.json | 2 +- Extension/yarn.lock | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index da71b91f19..9cdbb1b0e9 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -4362,7 +4362,7 @@ "https-proxy-agent": "^2.2.4", "minimatch": "^3.0.4", "mkdirp": "^0.5.1", - "plist": "^3.0.2", + "plist": "^3.0.4", "tmp": "^0.1.0", "vscode-cpptools": "^5.0.0", "vscode-extension-telemetry": "^0.1.7", diff --git a/Extension/yarn.lock b/Extension/yarn.lock index fb44117e0e..197275609c 100644 --- a/Extension/yarn.lock +++ b/Extension/yarn.lock @@ -4424,14 +4424,13 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -plist@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.2.tgz#74bbf011124b90421c22d15779cee60060ba95bc" - integrity sha512-MSrkwZBdQ6YapHy87/8hDU8MnIcyxBKjeF+McXnr5A9MtffPewTs7G3hlpodT5TacyfIyFTaJEhh3GGcmasTgQ== +plist@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.4.tgz#a62df837e3aed2bb3b735899d510c4f186019cbe" + integrity sha512-ksrr8y9+nXOxQB2osVNqrgvX/XQPOXaU4BQMKjYq8PvaY1U18mo+fKgBSwzK+luSyinOuPae956lSVcBwxlAMg== dependencies: base64-js "^1.5.1" xmlbuilder "^9.0.7" - xmldom "^0.5.0" plugin-error@^1.0.1: version "1.0.1" @@ -6087,11 +6086,6 @@ xmlbuilder@~11.0.0: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== -xmldom@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.5.0.tgz#193cb96b84aa3486127ea6272c4596354cb4962e" - integrity sha512-Foaj5FXVzgn7xFzsKeNIde9g6aFBxTPi37iwsno8QvApmtg7KYrr+OPyRHcJF7dud2a5nGRBXK3n0dL62Gf7PA== - xtend@~4.0.0, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" From cf24fe0b8bd1724383286f49092e4c271aca5977 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 3 Sep 2021 00:16:02 -0700 Subject: [PATCH 045/101] Minor changes. --- Extension/src/LanguageServer/client.ts | 13 +++++++++++++ Extension/src/LanguageServer/clientCollection.ts | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 10ba41d661..6fffa6bb92 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -468,6 +468,11 @@ interface IntervalTimerParams { freeMemory: number; }; +interface TextDocumentWillSaveParams { + document: vscode.TextDocument; + reason: vscode.TextDocumentSaveReason; +} + // Requests const QueryCompilerDefaultsRequest: RequestType = new RequestType('cpptools/queryCompilerDefaults'); const QueryTranslationUnitSourceRequest: RequestType = new RequestType('cpptools/queryTranslationUnitSource'); @@ -482,6 +487,7 @@ export const FormatDocumentRequest: RequestType = new RequestType('cpptools/formatRange'); export const FormatOnTypeRequest: RequestType = new RequestType('cpptools/formatOnType'); const GoToDirectiveInGroupRequest: RequestType = new RequestType('cpptools/goToDirectiveInGroup'); +const WillSaveWaitUntilRequest: RequestType = new RequestType('textDocument/willSaveWaitUntil'); // Notifications to the server const DidOpenNotification: NotificationType = new NotificationType('textDocument/didOpen'); @@ -654,6 +660,7 @@ export interface Client { requestWhenReady(request: () => Thenable): Thenable; notifyWhenLanguageClientReady(notify: () => void): void; awaitUntilLanguageClientReady(): void; + onWillSaveWaitUntil(params: TextDocumentWillSaveParams): Promise; requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable; activeDocumentChanged(document: vscode.TextDocument): Promise; activate(): void; @@ -2101,6 +2108,11 @@ export class DefaultClient implements Client { return this.queueTask(task); } + public async onWillSaveWaitUntil(params: TextDocumentWillSaveParams): Promise { + await this.awaitUntilLanguageClientReady(); + await this.languageClient.sendRequest(WillSaveWaitUntilRequest, params); + } + /** * listen for notifications from the language server. */ @@ -3141,6 +3153,7 @@ class NullClient implements Client { requestWhenReady(request: () => Thenable): Thenable { return request(); } notifyWhenLanguageClientReady(notify: () => void): void { } awaitUntilLanguageClientReady(): void { } + onWillSaveWaitUntil(params: TextDocumentWillSaveParams): Promise { return Promise.resolve(); } requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable { return Promise.resolve(""); } activeDocumentChanged(document: vscode.TextDocument): Promise { return Promise.resolve(); } activate(): void { } diff --git a/Extension/src/LanguageServer/clientCollection.ts b/Extension/src/LanguageServer/clientCollection.ts index c904e331f1..42dcd8847a 100644 --- a/Extension/src/LanguageServer/clientCollection.ts +++ b/Extension/src/LanguageServer/clientCollection.ts @@ -62,6 +62,7 @@ export class ClientCollection { this.disposables.push(vscode.workspace.onDidChangeWorkspaceFolders(e => this.onDidChangeWorkspaceFolders(e))); this.disposables.push(vscode.workspace.onDidCloseTextDocument(d => this.onDidCloseTextDocument(d))); + this.disposables.push(vscode.workspace.onWillSaveTextDocument(e => this.onWillSaveWaitUntil(e))); } public async activeDocumentChanged(document: vscode.TextDocument): Promise { @@ -138,6 +139,10 @@ export class ClientCollection { } } + private onWillSaveWaitUntil(e: vscode.TextDocumentWillSaveEvent): void { + e.waitUntil(this.activeClient.onWillSaveWaitUntil(e)); + } + private onDidChangeWorkspaceFolders(e?: vscode.WorkspaceFoldersChangeEvent): void { const folderCount: number = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders.length : 0; if (folderCount > 1) { From 8444fca1f5774e7da5ab1f531410af8360ae439d Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 7 Sep 2021 17:25:26 -0700 Subject: [PATCH 046/101] Fixes. --- Extension/src/LanguageServer/client.ts | 18 +++++++++++------- Extension/src/LanguageServer/extension.ts | 12 ++++++------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 6fffa6bb92..8569a6c26e 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -468,8 +468,8 @@ interface IntervalTimerParams { freeMemory: number; }; -interface TextDocumentWillSaveParams { - document: vscode.TextDocument; +export interface TextDocumentWillSaveParams { + textDocument: TextDocumentIdentifier; reason: vscode.TextDocumentSaveReason; } @@ -487,7 +487,7 @@ export const FormatDocumentRequest: RequestType = new RequestType('cpptools/formatRange'); export const FormatOnTypeRequest: RequestType = new RequestType('cpptools/formatOnType'); const GoToDirectiveInGroupRequest: RequestType = new RequestType('cpptools/goToDirectiveInGroup'); -const WillSaveWaitUntilRequest: RequestType = new RequestType('textDocument/willSaveWaitUntil'); +const WillSaveWaitUntilRequest: RequestType = new RequestType('cpptools/willSaveWaitUntil'); // Notifications to the server const DidOpenNotification: NotificationType = new NotificationType('textDocument/didOpen'); @@ -660,7 +660,7 @@ export interface Client { requestWhenReady(request: () => Thenable): Thenable; notifyWhenLanguageClientReady(notify: () => void): void; awaitUntilLanguageClientReady(): void; - onWillSaveWaitUntil(params: TextDocumentWillSaveParams): Promise; + onWillSaveWaitUntil(params: vscode.TextDocumentWillSaveEvent): Promise; requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable; activeDocumentChanged(document: vscode.TextDocument): Promise; activate(): void; @@ -2108,9 +2108,13 @@ export class DefaultClient implements Client { return this.queueTask(task); } - public async onWillSaveWaitUntil(params: TextDocumentWillSaveParams): Promise { + public async onWillSaveWaitUntil(params: vscode.TextDocumentWillSaveEvent): Promise { + const params2: TextDocumentWillSaveParams = { + textDocument: this.languageClient.code2ProtocolConverter.asTextDocumentIdentifier(params.document), + reason: params.reason + }; await this.awaitUntilLanguageClientReady(); - await this.languageClient.sendRequest(WillSaveWaitUntilRequest, params); + await this.languageClient.sendRequest(WillSaveWaitUntilRequest, params2); } /** @@ -3153,7 +3157,7 @@ class NullClient implements Client { requestWhenReady(request: () => Thenable): Thenable { return request(); } notifyWhenLanguageClientReady(notify: () => void): void { } awaitUntilLanguageClientReady(): void { } - onWillSaveWaitUntil(params: TextDocumentWillSaveParams): Promise { return Promise.resolve(); } + onWillSaveWaitUntil(params: vscode.TextDocumentWillSaveEvent): Promise { return Promise.resolve(); } requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable { return Promise.resolve(""); } activeDocumentChanged(document: vscode.TextDocument): Promise { return Promise.resolve(); } activate(): void { } diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index dd8a1ba4c7..f87638adbe 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -975,26 +975,26 @@ function onCheckForCompiler(): void { client.handleCheckForCompiler(); } -function onRunCodeAnalysisOnActiveFile(): void { +async function onRunCodeAnalysisOnActiveFile(): Promise { onActivationEvent(); if (activeDocument !== "") { + await vscode.commands.executeCommand("workbench.action.files.saveAll"); getActiveClient().handleRunCodeAnalysisOnActiveFile(); - vscode.commands.executeCommand("workbench.action.files.saveAll"); } } -function onRunCodeAnalysisOnOpenFiles(): void { +async function onRunCodeAnalysisOnOpenFiles(): Promise { onActivationEvent(); if (openFileVersions.size > 0) { + await vscode.commands.executeCommand("workbench.action.files.saveAll"); getActiveClient().handleRunCodeAnalysisOnOpenFiles(); - vscode.commands.executeCommand("workbench.action.files.saveAll"); } } -function onRunCodeAnalysisOnAllFiles(): void { +async function onRunCodeAnalysisOnAllFiles(): Promise { onActivationEvent(); + await vscode.commands.executeCommand("workbench.action.files.saveAll"); getActiveClient().handleRunCodeAnalysisOnAllFiles(); - vscode.commands.executeCommand("workbench.action.files.saveAll"); } function onAddToIncludePath(path: string): void { From cb2c21413e517833db359ea28d8d87735586ce43 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 7 Sep 2021 18:08:58 -0700 Subject: [PATCH 047/101] Undo previous changes. --- Extension/src/LanguageServer/client.ts | 17 ----------------- .../src/LanguageServer/clientCollection.ts | 5 ----- 2 files changed, 22 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 8569a6c26e..10ba41d661 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -468,11 +468,6 @@ interface IntervalTimerParams { freeMemory: number; }; -export interface TextDocumentWillSaveParams { - textDocument: TextDocumentIdentifier; - reason: vscode.TextDocumentSaveReason; -} - // Requests const QueryCompilerDefaultsRequest: RequestType = new RequestType('cpptools/queryCompilerDefaults'); const QueryTranslationUnitSourceRequest: RequestType = new RequestType('cpptools/queryTranslationUnitSource'); @@ -487,7 +482,6 @@ export const FormatDocumentRequest: RequestType = new RequestType('cpptools/formatRange'); export const FormatOnTypeRequest: RequestType = new RequestType('cpptools/formatOnType'); const GoToDirectiveInGroupRequest: RequestType = new RequestType('cpptools/goToDirectiveInGroup'); -const WillSaveWaitUntilRequest: RequestType = new RequestType('cpptools/willSaveWaitUntil'); // Notifications to the server const DidOpenNotification: NotificationType = new NotificationType('textDocument/didOpen'); @@ -660,7 +654,6 @@ export interface Client { requestWhenReady(request: () => Thenable): Thenable; notifyWhenLanguageClientReady(notify: () => void): void; awaitUntilLanguageClientReady(): void; - onWillSaveWaitUntil(params: vscode.TextDocumentWillSaveEvent): Promise; requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable; activeDocumentChanged(document: vscode.TextDocument): Promise; activate(): void; @@ -2108,15 +2101,6 @@ export class DefaultClient implements Client { return this.queueTask(task); } - public async onWillSaveWaitUntil(params: vscode.TextDocumentWillSaveEvent): Promise { - const params2: TextDocumentWillSaveParams = { - textDocument: this.languageClient.code2ProtocolConverter.asTextDocumentIdentifier(params.document), - reason: params.reason - }; - await this.awaitUntilLanguageClientReady(); - await this.languageClient.sendRequest(WillSaveWaitUntilRequest, params2); - } - /** * listen for notifications from the language server. */ @@ -3157,7 +3141,6 @@ class NullClient implements Client { requestWhenReady(request: () => Thenable): Thenable { return request(); } notifyWhenLanguageClientReady(notify: () => void): void { } awaitUntilLanguageClientReady(): void { } - onWillSaveWaitUntil(params: vscode.TextDocumentWillSaveEvent): Promise { return Promise.resolve(); } requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable { return Promise.resolve(""); } activeDocumentChanged(document: vscode.TextDocument): Promise { return Promise.resolve(); } activate(): void { } diff --git a/Extension/src/LanguageServer/clientCollection.ts b/Extension/src/LanguageServer/clientCollection.ts index 42dcd8847a..c904e331f1 100644 --- a/Extension/src/LanguageServer/clientCollection.ts +++ b/Extension/src/LanguageServer/clientCollection.ts @@ -62,7 +62,6 @@ export class ClientCollection { this.disposables.push(vscode.workspace.onDidChangeWorkspaceFolders(e => this.onDidChangeWorkspaceFolders(e))); this.disposables.push(vscode.workspace.onDidCloseTextDocument(d => this.onDidCloseTextDocument(d))); - this.disposables.push(vscode.workspace.onWillSaveTextDocument(e => this.onWillSaveWaitUntil(e))); } public async activeDocumentChanged(document: vscode.TextDocument): Promise { @@ -139,10 +138,6 @@ export class ClientCollection { } } - private onWillSaveWaitUntil(e: vscode.TextDocumentWillSaveEvent): void { - e.waitUntil(this.activeClient.onWillSaveWaitUntil(e)); - } - private onDidChangeWorkspaceFolders(e?: vscode.WorkspaceFoldersChangeEvent): void { const folderCount: number = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders.length : 0; if (folderCount > 1) { From 4022b2ca63e4471cac3bd863d5a1cb515dcb4084 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 7 Sep 2021 18:59:35 -0700 Subject: [PATCH 048/101] Undo previous changes. --- Extension/src/LanguageServer/client.ts | 17 +++++++++++++++++ .../src/LanguageServer/clientCollection.ts | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 10ba41d661..8569a6c26e 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -468,6 +468,11 @@ interface IntervalTimerParams { freeMemory: number; }; +export interface TextDocumentWillSaveParams { + textDocument: TextDocumentIdentifier; + reason: vscode.TextDocumentSaveReason; +} + // Requests const QueryCompilerDefaultsRequest: RequestType = new RequestType('cpptools/queryCompilerDefaults'); const QueryTranslationUnitSourceRequest: RequestType = new RequestType('cpptools/queryTranslationUnitSource'); @@ -482,6 +487,7 @@ export const FormatDocumentRequest: RequestType = new RequestType('cpptools/formatRange'); export const FormatOnTypeRequest: RequestType = new RequestType('cpptools/formatOnType'); const GoToDirectiveInGroupRequest: RequestType = new RequestType('cpptools/goToDirectiveInGroup'); +const WillSaveWaitUntilRequest: RequestType = new RequestType('cpptools/willSaveWaitUntil'); // Notifications to the server const DidOpenNotification: NotificationType = new NotificationType('textDocument/didOpen'); @@ -654,6 +660,7 @@ export interface Client { requestWhenReady(request: () => Thenable): Thenable; notifyWhenLanguageClientReady(notify: () => void): void; awaitUntilLanguageClientReady(): void; + onWillSaveWaitUntil(params: vscode.TextDocumentWillSaveEvent): Promise; requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable; activeDocumentChanged(document: vscode.TextDocument): Promise; activate(): void; @@ -2101,6 +2108,15 @@ export class DefaultClient implements Client { return this.queueTask(task); } + public async onWillSaveWaitUntil(params: vscode.TextDocumentWillSaveEvent): Promise { + const params2: TextDocumentWillSaveParams = { + textDocument: this.languageClient.code2ProtocolConverter.asTextDocumentIdentifier(params.document), + reason: params.reason + }; + await this.awaitUntilLanguageClientReady(); + await this.languageClient.sendRequest(WillSaveWaitUntilRequest, params2); + } + /** * listen for notifications from the language server. */ @@ -3141,6 +3157,7 @@ class NullClient implements Client { requestWhenReady(request: () => Thenable): Thenable { return request(); } notifyWhenLanguageClientReady(notify: () => void): void { } awaitUntilLanguageClientReady(): void { } + onWillSaveWaitUntil(params: vscode.TextDocumentWillSaveEvent): Promise { return Promise.resolve(); } requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable { return Promise.resolve(""); } activeDocumentChanged(document: vscode.TextDocument): Promise { return Promise.resolve(); } activate(): void { } diff --git a/Extension/src/LanguageServer/clientCollection.ts b/Extension/src/LanguageServer/clientCollection.ts index c904e331f1..42dcd8847a 100644 --- a/Extension/src/LanguageServer/clientCollection.ts +++ b/Extension/src/LanguageServer/clientCollection.ts @@ -62,6 +62,7 @@ export class ClientCollection { this.disposables.push(vscode.workspace.onDidChangeWorkspaceFolders(e => this.onDidChangeWorkspaceFolders(e))); this.disposables.push(vscode.workspace.onDidCloseTextDocument(d => this.onDidCloseTextDocument(d))); + this.disposables.push(vscode.workspace.onWillSaveTextDocument(e => this.onWillSaveWaitUntil(e))); } public async activeDocumentChanged(document: vscode.TextDocument): Promise { @@ -138,6 +139,10 @@ export class ClientCollection { } } + private onWillSaveWaitUntil(e: vscode.TextDocumentWillSaveEvent): void { + e.waitUntil(this.activeClient.onWillSaveWaitUntil(e)); + } + private onDidChangeWorkspaceFolders(e?: vscode.WorkspaceFoldersChangeEvent): void { const folderCount: number = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders.length : 0; if (folderCount > 1) { From d89d7fb84e5195743aeac4af8a7577876831c749 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 8 Sep 2021 11:26:17 -0700 Subject: [PATCH 049/101] Fix settings access. --- Extension/src/LanguageServer/client.ts | 3 ++- Extension/src/LanguageServer/customProviders.ts | 3 ++- Extension/src/LanguageServer/extension.ts | 2 +- Extension/src/LanguageServer/settings.ts | 4 ++-- Extension/src/main.ts | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 8569a6c26e..282fccf0a9 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1527,7 +1527,8 @@ export class DefaultClient implements Client { } const settings: CppSettings = new CppSettings(); if (changedSettings["formatting"]) { - if (settings.formattingEngine !== "Disabled") { + const folderSettings: CppSettings = new CppSettings(this.RootUri); + if (folderSettings.formattingEngine !== "Disabled") { // Because the setting is not a bool, changes do not always imply we need to // register/unregister the providers. if (!this.documentFormattingProviderDisposable) { diff --git a/Extension/src/LanguageServer/customProviders.ts b/Extension/src/LanguageServer/customProviders.ts index 83b51e7b43..17230ac78d 100644 --- a/Extension/src/LanguageServer/customProviders.ts +++ b/Extension/src/LanguageServer/customProviders.ts @@ -7,6 +7,7 @@ import * as vscode from 'vscode'; import { CustomConfigurationProvider, Version, SourceFileConfigurationItem, WorkspaceBrowseConfiguration } from 'vscode-cpptools'; import { CppSettings } from './settings'; +import * as ext from './extension'; /** * An interface that is guaranteed to be backward compatible with version 0 @@ -157,7 +158,7 @@ export class CustomConfigurationProviderCollection { } public add(provider: CustomConfigurationProvider, version: Version): boolean { - if (new CppSettings().intelliSenseEngine === "Disabled") { + if (new CppSettings(ext.getActiveClient().RootUri).intelliSenseEngine === "Disabled") { console.warn("Language service is disabled. Provider will not be registered."); return false; } diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index f87638adbe..fa176439c0 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -308,7 +308,7 @@ function sendActivationTelemetry(): void { } function realActivation(): void { - if (new CppSettings().intelliSenseEngine === "Disabled") { + if (new CppSettings(vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders[0].uri : undefined).intelliSenseEngine === "Disabled") { throw new Error(intelliSenseDisabledError); } else { console.log("activating extension"); diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 28a20f7393..7ec05a6244 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -30,10 +30,10 @@ class Settings { /** * create the Settings object. - * @param resource The path to a resource to which the settings should apply, or undefined if global settings are desired + * @param resource The path to a resource to which the settings should apply, or null if global settings are desired */ constructor(section: string, public resource?: vscode.Uri) { - this.settings = vscode.workspace.getConfiguration(section, resource ? resource : undefined); + this.settings = vscode.workspace.getConfiguration(section, resource ? resource : null); } protected get Section(): vscode.WorkspaceConfiguration { return this.settings; } diff --git a/Extension/src/main.ts b/Extension/src/main.ts index cafd068d5b..0010fdd261 100644 --- a/Extension/src/main.ts +++ b/Extension/src/main.ts @@ -392,7 +392,7 @@ async function postInstall(info: PlatformInformation): Promise { } async function finalizeExtensionActivation(): Promise { - const settings: CppSettings = new CppSettings(); + const settings: CppSettings = new CppSettings(vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders[0].uri : undefined); if (settings.intelliSenseEngine === "Disabled") { languageServiceDisabled = true; getTemporaryCommandRegistrarInstance().disableLanguageServer(); From 825773e172176a8018f06d9d4c78acb82b0ea288 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 10 Sep 2021 13:28:45 -0700 Subject: [PATCH 050/101] onWillSaveWaitUntil logging --- Extension/src/LanguageServer/client.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 2828ee7b3b..a9ef414bf0 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -487,7 +487,7 @@ export const FormatDocumentRequest: RequestType = new RequestType('cpptools/formatRange'); export const FormatOnTypeRequest: RequestType = new RequestType('cpptools/formatOnType'); const GoToDirectiveInGroupRequest: RequestType = new RequestType('cpptools/goToDirectiveInGroup'); -const WillSaveWaitUntilRequest: RequestType = new RequestType('cpptools/willSaveWaitUntil'); +const WillSaveWaitUntilRequest: RequestType = new RequestType('textDocument/willSaveWaitUntil'); // Notifications to the server const DidOpenNotification: NotificationType = new NotificationType('textDocument/didOpen'); @@ -2119,8 +2119,15 @@ export class DefaultClient implements Client { textDocument: this.languageClient.code2ProtocolConverter.asTextDocumentIdentifier(params.document), reason: params.reason }; - await this.awaitUntilLanguageClientReady(); - await this.languageClient.sendRequest(WillSaveWaitUntilRequest, params2); + console.log("onWillSaveWaitUntil start: " + new Date()); + try { + await this.awaitUntilLanguageClientReady(); + await this.languageClient.sendRequest(WillSaveWaitUntilRequest, params2); + } catch (e) { + console.log("onWillSaveWaitUntil: " + e); + return; + } + console.log("onWillSaveWaitUntil end: " + new Date()); } /** From 8f9a1fc7452a538062f8ea2cc2d7a7b1e587d873 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 10 Sep 2021 18:16:22 -0700 Subject: [PATCH 051/101] Fix an onWillSaveTextDocument issue. --- Extension/src/LanguageServer/clientCollection.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/clientCollection.ts b/Extension/src/LanguageServer/clientCollection.ts index 42dcd8847a..9e6286968d 100644 --- a/Extension/src/LanguageServer/clientCollection.ts +++ b/Extension/src/LanguageServer/clientCollection.ts @@ -62,7 +62,9 @@ export class ClientCollection { this.disposables.push(vscode.workspace.onDidChangeWorkspaceFolders(e => this.onDidChangeWorkspaceFolders(e))); this.disposables.push(vscode.workspace.onDidCloseTextDocument(d => this.onDidCloseTextDocument(d))); - this.disposables.push(vscode.workspace.onWillSaveTextDocument(e => this.onWillSaveWaitUntil(e))); + this.defaultClient.notifyWhenLanguageClientReady(() => { + this.disposables.push(vscode.workspace.onWillSaveTextDocument(d => this.onWillSaveWaitUntil(d))); + }); } public async activeDocumentChanged(document: vscode.TextDocument): Promise { From e3a3b16e5722fd9f9f17275672c5c0129ef9241f Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 13 Sep 2021 11:44:39 -0700 Subject: [PATCH 052/101] Fix autoSave warning. --- Extension/src/LanguageServer/settings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 7ec05a6244..d597784930 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -753,7 +753,7 @@ export class OtherSettings { vscode.workspace.getConfiguration("files").update("associations", value, vscode.ConfigurationTarget.Workspace); } public get filesExclude(): vscode.WorkspaceConfiguration | undefined { return vscode.workspace.getConfiguration("files", this.resource).get("exclude"); } - public get filesAutoSaveAfterDelay(): boolean { return vscode.workspace.getConfiguration("files", this.resource).get("autoSave") === "afterDelay"; } + public get filesAutoSaveAfterDelay(): boolean { return vscode.workspace.getConfiguration("files").get("autoSave") === "afterDelay"; } public get searchExclude(): vscode.WorkspaceConfiguration | undefined { return vscode.workspace.getConfiguration("search", this.resource).get("exclude"); } public get settingsEditor(): string | undefined { return vscode.workspace.getConfiguration("workbench.settings").get("editor"); } From d26f3a91fc43169f69b235259b73933ca0344936 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 13 Sep 2021 16:31:49 -0700 Subject: [PATCH 053/101] Remove WillSave stuff. --- Extension/src/LanguageServer/client.ts | 18 ------------------ .../src/LanguageServer/clientCollection.ts | 7 ------- 2 files changed, 25 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index e692049cf0..56c2da5a3f 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -487,7 +487,6 @@ export const FormatDocumentRequest: RequestType = new RequestType('cpptools/formatRange'); export const FormatOnTypeRequest: RequestType = new RequestType('cpptools/formatOnType'); const GoToDirectiveInGroupRequest: RequestType = new RequestType('cpptools/goToDirectiveInGroup'); -const WillSaveWaitUntilRequest: RequestType = new RequestType('textDocument/willSaveWaitUntil'); // Notifications to the server const DidOpenNotification: NotificationType = new NotificationType('textDocument/didOpen'); @@ -660,7 +659,6 @@ export interface Client { requestWhenReady(request: () => Thenable): Thenable; notifyWhenLanguageClientReady(notify: () => void): void; awaitUntilLanguageClientReady(): void; - onWillSaveWaitUntil(params: vscode.TextDocumentWillSaveEvent): Promise; requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable; activeDocumentChanged(document: vscode.TextDocument): Promise; activate(): void; @@ -2115,21 +2113,6 @@ export class DefaultClient implements Client { return this.queueTask(task); } - public async onWillSaveWaitUntil(params: vscode.TextDocumentWillSaveEvent): Promise { - const params2: TextDocumentWillSaveParams = { - textDocument: this.languageClient.code2ProtocolConverter.asTextDocumentIdentifier(params.document), - reason: params.reason - }; - console.log("onWillSaveWaitUntil start: " + new Date()); - try { - await this.awaitUntilLanguageClientReady(); - await this.languageClient.sendRequest(WillSaveWaitUntilRequest, params2); - } catch (e) { - console.log("onWillSaveWaitUntil: " + e); - return; - } - console.log("onWillSaveWaitUntil end: " + new Date()); - } /** * listen for notifications from the language server. @@ -3171,7 +3154,6 @@ class NullClient implements Client { requestWhenReady(request: () => Thenable): Thenable { return request(); } notifyWhenLanguageClientReady(notify: () => void): void { } awaitUntilLanguageClientReady(): void { } - onWillSaveWaitUntil(params: vscode.TextDocumentWillSaveEvent): Promise { return Promise.resolve(); } requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable { return Promise.resolve(""); } activeDocumentChanged(document: vscode.TextDocument): Promise { return Promise.resolve(); } activate(): void { } diff --git a/Extension/src/LanguageServer/clientCollection.ts b/Extension/src/LanguageServer/clientCollection.ts index 9e6286968d..c904e331f1 100644 --- a/Extension/src/LanguageServer/clientCollection.ts +++ b/Extension/src/LanguageServer/clientCollection.ts @@ -62,9 +62,6 @@ export class ClientCollection { this.disposables.push(vscode.workspace.onDidChangeWorkspaceFolders(e => this.onDidChangeWorkspaceFolders(e))); this.disposables.push(vscode.workspace.onDidCloseTextDocument(d => this.onDidCloseTextDocument(d))); - this.defaultClient.notifyWhenLanguageClientReady(() => { - this.disposables.push(vscode.workspace.onWillSaveTextDocument(d => this.onWillSaveWaitUntil(d))); - }); } public async activeDocumentChanged(document: vscode.TextDocument): Promise { @@ -141,10 +138,6 @@ export class ClientCollection { } } - private onWillSaveWaitUntil(e: vscode.TextDocumentWillSaveEvent): void { - e.waitUntil(this.activeClient.onWillSaveWaitUntil(e)); - } - private onDidChangeWorkspaceFolders(e?: vscode.WorkspaceFoldersChangeEvent): void { const folderCount: number = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders.length : 0; if (folderCount > 1) { From 01049e509b16adad68776d2575cfa64cd37e7407 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 13 Sep 2021 16:38:56 -0700 Subject: [PATCH 054/101] Fix linter issue. --- Extension/src/LanguageServer/client.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 56c2da5a3f..f8d2da8383 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -2113,7 +2113,6 @@ export class DefaultClient implements Client { return this.queueTask(task); } - /** * listen for notifications from the language server. */ From a3e8e0659d5b27ff98b3e4f56713fb5c182209dd Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 14 Sep 2021 12:17:16 -0700 Subject: [PATCH 055/101] Fix settings change no working. --- Extension/src/LanguageServer/client.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index f8d2da8383..77fa37a5af 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1470,9 +1470,24 @@ export class DefaultClient implements Client { const settings: any = { C_Cpp: { ...cppSettingsScoped, + codeAnalysis: { + ...vscode.workspace.getConfiguration("C_Cpp.codeAnalysis", this.RootUri), + clangTidy: { + ...vscode.workspace.getConfiguration("C_Cpp.codeAnalysis.clangTidy", this.RootUri), + fix: { + ...vscode.workspace.getConfiguration("C_Cpp.codeAnalysis.clangTidy.fix", this.RootUri) + } + } + }, files: { exclude: vscode.workspace.getConfiguration("C_Cpp.files.exclude", this.RootUri) }, + intelliSense: { + ...vscode.workspace.getConfiguration("C_Cpp.intelliSense", this.RootUri) + }, + references: { + ...vscode.workspace.getConfiguration("C_Cpp.references", this.RootUri) + }, vcFormat: { ...vscode.workspace.getConfiguration("C_Cpp.vcFormat", this.RootUri), indent: vscode.workspace.getConfiguration("C_Cpp.vcFormat.indent", this.RootUri), From 2875554cbb6af158885504b6ada7631304be21fc Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 14 Sep 2021 14:23:40 -0700 Subject: [PATCH 056/101] Settings fixes. --- Extension/package.json | 2 +- Extension/package.nls.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 0593ba3881..bd2ed00ea5 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -354,7 +354,7 @@ "C_Cpp.codeAnalysis.updateDelay": { "type": "number", "default": 2000, - "description": "%c_cpp.configuration.codeAnalysis.updateDelay.description%", + "description": "%c_cpp.configuration.codeAnalysis.updateDelay.markdownDescription%", "scope": "application", "minimum": 0, "maximum": 6000 diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 42c72361e8..4a8d778d0f 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -34,7 +34,7 @@ "c_cpp.configuration.references.maxMemory.markdownDescription": "Fewer 'Find All References' and 'Rename' processes will be cached and run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for code analysis. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", - "c_cpp.configuration.codeAnalysis.updateDelay.description": "Controls the delay in milliseconds before code analysis starts processing after a save is triggered from an edit when `#files.autoSave#` is `afterDelay` and `#C_Cpp.runInBackground#` is `true`.", + "c_cpp.configuration.codeAnalysis.updateDelay.markdownDescription": "Controls the delay in milliseconds before code analysis starts processing after a save is triggered from an edit when `#files.autoSave#` is `afterDelay` and `#C_Cpp.runInBackground#` is `true`.", "c_cpp.configuration.codeAnalysis.exclude.markdownDescription": "Configure glob patterns for excluding folders and files for code analysis. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "c_cpp.configuration.codeAnalysis.excludeBoolean.description": "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.", "c_cpp.configuration.codeAnalysis.excludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", @@ -164,7 +164,7 @@ "c_cpp.configuration.exclusionPolicy.markdownDescription": { "message": "Instructs the extension when to use the `#files.exclude#` (and `#C_Cpp.files.exclude#`) setting when determining which files should be added to the code navigation database while traversing through the paths in the `browse.path` array. If your `#files.exclude#` setting only contains folders, then `checkFolders` is the best choice and will increase the speed at which the extension can initialize the code navigation database.", "comment": [ "Markdown text between `` should not be translated and the punctuation should not be altered." ] }, "c_cpp.configuration.exclusionPolicy.checkFolders.description": "The exclusion filters will only be evaluated once per folder (individual files are not checked).", "c_cpp.configuration.exclusionPolicy.checkFilesAndFolders.description": "The exclusion filters will be evaluated against every file and folder encountered.", - "c_cpp.configuration.preferredPathSeparator.description": "The character used as a path separator for #include auto-completion results.", + "c_cpp.configuration.preferredPathSeparator.description": "The character used as a path separator for `#include` auto-completion results.", "c_cpp.configuration.simplifyStructuredComments.markdownDescription": { "message": "If `true`, tooltips of hover and auto-complete will only display certain labels of structured comments. Otherwise, all comments are displayed.", "comment": [ "Markdown text between `` should not be translated and the punctuation should not be altered." ] }, "c_cpp.configuration.commentContinuationPatterns.items.anyof.string.markdownDescription": { "message": "The pattern that begins a multiline or single line comment block. The continuation pattern defaults to ` * ` for multiline comment blocks or this string for single line comment blocks.", "comment": [ "Markdown text between `` should not be translated and the punctuation should not be altered." ] }, "c_cpp.configuration.commentContinuationPatterns.items.anyof.object.begin.description": "The pattern that begins a multiline or single line comment block.", From 5ba7dc0bae5799e2f3825662860e51b9e0d773cd Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 15 Sep 2021 11:27:19 -0700 Subject: [PATCH 057/101] Fix updateDelay string. --- Extension/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/package.json b/Extension/package.json index 80a1a769fb..39bde737b3 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -354,7 +354,7 @@ "C_Cpp.codeAnalysis.updateDelay": { "type": "number", "default": 2000, - "description": "%c_cpp.configuration.codeAnalysis.updateDelay.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.updateDelay.markdownDescription%", "scope": "application", "minimum": 0, "maximum": 6000 From 23fef4c6981e5d81bba18e9c736bc31a48864c04 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 15 Sep 2021 11:39:54 -0700 Subject: [PATCH 058/101] Fix clangTidy.path string. --- Extension/package.nls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 52d4445b21..21fb49199b 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -41,7 +41,7 @@ "c_cpp.configuration.codeAnalysis.runInBackground.markdownDescription": "If `true`, code analysis will run automatically in the background.", "c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription": "If `true`, code analysis will run automatically after a build is completed.", "c_cpp.configuration.codeAnalysis.clangTidy.enabled.markdownDescription": "If `true`, code analysis using `clang-tidy` will be enabled.", - "c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription": "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.", + "c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription": "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.", "c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for `clang-tidy`. If not specified, the build configuration from IntelliSense will be used.", "c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription": "Specifies a `clang-tidy` configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, `clang-tidy` will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": "Specifies a `clang-tidy` configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", From 62e63c1fbd97ab4517c062ad5d2abe1e29fbff22 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 15 Sep 2021 18:11:23 -0700 Subject: [PATCH 059/101] New diagnostics type. --- Extension/src/LanguageServer/client.ts | 33 +++++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 77fa37a5af..4e31ef5fef 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -62,7 +62,8 @@ let diagnosticsChannel: vscode.OutputChannel; let outputChannel: vscode.OutputChannel; let debugChannel: vscode.OutputChannel; let warningChannel: vscode.OutputChannel; -let diagnosticsCollection: vscode.DiagnosticCollection; +let diagnosticsCollectionIntelliSense: vscode.DiagnosticCollection; +let diagnosticsCollectionCodeAnalysis: vscode.DiagnosticCollection; let workspaceDisposables: vscode.Disposable[] = []; export let workspaceReferences: refs.ReferencesManager; export const openFileVersions: Map = new Map(); @@ -149,23 +150,37 @@ function showWarning(params: ShowWarningParams): void { } function publishDiagnostics(params: PublishDiagnosticsParams): void { - if (!diagnosticsCollection) { - diagnosticsCollection = vscode.languages.createDiagnosticCollection("C/C++"); + const is_intelliSense: boolean = params.diagnosticsType === DiagnosticsType.IntelliSense; + if (is_intelliSense) { + if (!diagnosticsCollectionIntelliSense) { + diagnosticsCollectionIntelliSense = vscode.languages.createDiagnosticCollection("C/C++"); + } + } else if (!diagnosticsCollectionCodeAnalysis) { + diagnosticsCollectionCodeAnalysis = vscode.languages.createDiagnosticCollection("clang-tidy"); } // Convert from our Diagnostic objects to vscode Diagnostic objects - const diagnostics: vscode.Diagnostic[] = []; + const diagnosticsIntelliSense: vscode.Diagnostic[] = []; + const diagnosticsCodeAnalysis: vscode.Diagnostic[] = []; params.diagnostics.forEach((d) => { const message: string = util.getLocalizedString(d.localizeStringParams); const r: vscode.Range = new vscode.Range(d.range.start.line, d.range.start.character, d.range.end.line, d.range.end.character); const diagnostic: vscode.Diagnostic = new vscode.Diagnostic(r, message, d.severity); diagnostic.code = d.code; diagnostic.source = d.source; - diagnostics.push(diagnostic); + if (is_intelliSense) { + diagnosticsIntelliSense.push(diagnostic); + } else { + diagnosticsCodeAnalysis.push(diagnostic); + } }); const realUri: vscode.Uri = vscode.Uri.parse(params.uri); - diagnosticsCollection.set(realUri, diagnostics); + if (is_intelliSense) { + diagnosticsCollectionIntelliSense.set(realUri, diagnosticsIntelliSense); + } else { + diagnosticsCollectionCodeAnalysis.set(realUri, diagnosticsCodeAnalysis); + } clientCollection.timeTelemetryCollector.setUpdateRangeTime(realUri); } @@ -265,9 +280,15 @@ interface Diagnostic { localizeStringParams: LocalizeStringParams; } +enum DiagnosticsType { + IntelliSense, + CodeAnalysis +} + interface PublishDiagnosticsParams { uri: string; diagnostics: Diagnostic[]; + diagnosticsType: DiagnosticsType; } interface GetCodeActionsRequestParams { From c3d1c9e3f66fe25bf7f5e91735530458ba379553 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 16 Sep 2021 16:47:50 -0700 Subject: [PATCH 060/101] Fix source. --- Extension/src/LanguageServer/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 4e31ef5fef..cc08f706e4 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -167,7 +167,7 @@ function publishDiagnostics(params: PublishDiagnosticsParams): void { const r: vscode.Range = new vscode.Range(d.range.start.line, d.range.start.character, d.range.end.line, d.range.end.character); const diagnostic: vscode.Diagnostic = new vscode.Diagnostic(r, message, d.severity); diagnostic.code = d.code; - diagnostic.source = d.source; + diagnostic.source = "clang-tidy"; if (is_intelliSense) { diagnosticsIntelliSense.push(diagnostic); } else { From d4033d6d6d1a70d768d34360ba3fa5ddbb433d10 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 16 Sep 2021 18:32:18 -0700 Subject: [PATCH 061/101] Change source. --- Extension/src/LanguageServer/client.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index cc08f706e4..e94941bc6c 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -167,7 +167,8 @@ function publishDiagnostics(params: PublishDiagnosticsParams): void { const r: vscode.Range = new vscode.Range(d.range.start.line, d.range.start.character, d.range.end.line, d.range.end.character); const diagnostic: vscode.Diagnostic = new vscode.Diagnostic(r, message, d.severity); diagnostic.code = d.code; - diagnostic.source = "clang-tidy"; + diagnostic.source = "C/C++"; + if (is_intelliSense) { diagnosticsIntelliSense.push(diagnostic); } else { From 15582f2bc281b8e71da34def53aef0c8ae6264a1 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 17 Sep 2021 16:02:53 -0700 Subject: [PATCH 062/101] Remove TypeScript activeDoc handling. --- Extension/src/LanguageServer/client.ts | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index e94941bc6c..17721c6b46 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -67,7 +67,6 @@ let diagnosticsCollectionCodeAnalysis: vscode.DiagnosticCollection; let workspaceDisposables: vscode.Disposable[] = []; export let workspaceReferences: refs.ReferencesManager; export const openFileVersions: Map = new Map(); -export const openNeverActiveFiles: Set = new Set(); export const cachedEditorConfigSettings: Map = new Map(); export const cachedEditorConfigLookups: Map = new Map(); @@ -1665,7 +1664,6 @@ export class DefaultClient implements Client { if (document.uri.scheme === "file") { const uri: string = document.uri.toString(); openFileVersions.set(uri, document.version); - openNeverActiveFiles.add(uri); } } @@ -1676,9 +1674,6 @@ export class DefaultClient implements Client { } openFileVersions.delete(uri); - if (openNeverActiveFiles.has(uri)) { - openNeverActiveFiles.delete(uri); - } } private registeredProviders: CustomConfigurationProvider1[] = []; @@ -2583,17 +2578,8 @@ export class DefaultClient implements Client { */ public async activeDocumentChanged(document: vscode.TextDocument): Promise { await this.updateActiveDocumentTextOptions(); - this.notifyWhenLanguageClientReady(() => { - this.languageClient.sendNotification(ActiveDocumentChangeNotification, this.languageClient.code2ProtocolConverter.asTextDocumentIdentifier(document)); - const uri: string = document.uri.toString(); - if (openNeverActiveFiles.has(uri)) { - openNeverActiveFiles.delete(uri); - const settings: CppSettings = new CppSettings(this.RootUri); - if (settings.clangTidyEnabled && settings.codeAnalysisRunInBackground) { - this.handleRunCodeAnalysisOnActiveFile(); - } - } - }); + await this.awaitUntilLanguageClientReady(); + this.languageClient.sendNotification(ActiveDocumentChangeNotification, this.languageClient.code2ProtocolConverter.asTextDocumentIdentifier(document)); } /** From c70110be334ef4bda0e0e8edcb8a0792ef11d000 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 17 Sep 2021 18:39:50 -0700 Subject: [PATCH 063/101] Split checks into enabled/disabled. --- Extension/package.json | 1090 +++++++++++----------- Extension/package.nls.json | 53 +- Extension/src/LanguageServer/client.ts | 14 +- Extension/src/LanguageServer/settings.ts | 3 +- 4 files changed, 590 insertions(+), 570 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 091013d08e..28aef4b792 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -445,7 +445,7 @@ "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription%", "scope": "resource" }, - "C_Cpp.codeAnalysis.clangTidy.checks": { + "C_Cpp.codeAnalysis.clangTidy.checks.enabled": { "type": "array", "items": { "type": "string", @@ -986,547 +986,557 @@ "readability-uniqueptr-delete-release", "readability-uppercase-literal-suffix", "readability-use-anyofallof", - "zircon-temporary-objects", - "-*", - "-abseil-*", - "-abseil-duration-*", - "-abseil-duration-addition", - "-abseil-duration-comparison", - "-abseil-duration-conversion-cast", - "-abseil-duration-division", - "-abseil-duration-factory-*", - "-abseil-duration-factory-float", - "-abseil-duration-factory-scale", - "-abseil-duration-subtraction", - "-abseil-duration-unnecessary-conversion", - "-abseil-faster-strsplit-delimiter", - "-abseil-no-*", - "-abseil-no-internal-dependencies", - "-abseil-no-namespace", - "-abseil-redundant-strcat-calls", - "-abseil-str-cat-append", - "-abseil-string-find-*", - "-abseil-string-find-startswith", - "-abseil-string-find-str-contains", - "-abseil-time-*", - "-abseil-time-comparison", - "-abseil-time-subtraction", - "-abseil-upgrade-duration-conversions", - "-altera-*", - "-altera-kernel-name-restriction", - "-altera-single-work-item-barrier", - "-altera-struct-pack-align", - "-android-*", - "-android-cloexec-*", - "-android-cloexec-accept", - "-android-cloexec-accept4", - "-android-cloexec-creat", - "-android-cloexec-dup", - "-android-cloexec-epoll-*", - "-android-cloexec-epoll-create", - "-android-cloexec-epoll-create1", - "-android-cloexec-fopen", - "-android-cloexec-inotify-*", - "-android-cloexec-inotify-init", - "-android-cloexec-inotify-init1", - "-android-cloexec-memfd-create", - "-android-cloexec-open", - "-android-cloexec-pipe", - "-android-cloexec-pipe2", - "-android-cloexec-socket", - "-android-comparison-in-temp-failure-retry", - "-boost-use-to-string", - "-bugprone-*", - "-bugprone-argument-comment", - "-bugprone-assert-side-effect", - "-bugprone-bad-signal-to-kill-thread", - "-bugprone-bool-pointer-implicit-conversion", - "-bugprone-branch-clone", - "-bugprone-copy-constructor-init", - "-bugprone-dangling-handle", - "-bugprone-dynamic-static-initializers", - "-bugprone-exception-escape", - "-bugprone-fold-init-type", - "-bugprone-forward-declaration-namespace", - "-bugprone-forwarding-reference-overload", - "-bugprone-inaccurate-erase", - "-bugprone-incorrect-roundings", - "-bugprone-infinite-loop", - "-bugprone-integer-division", - "-bugprone-lambda-function-name", - "-bugprone-macro-parentheses", - "-bugprone-macro-repeated-side-effects", - "-bugprone-misplaced-*", - "-bugprone-misplaced-operator-in-strlen-in-alloc", - "-bugprone-misplaced-pointer-arithmetic-in-alloc", - "-bugprone-misplaced-widening-cast", - "-bugprone-move-forwarding-reference", - "-bugprone-multiple-statement-macro", - "-bugprone-narrowing-conversions", - "-bugprone-no-escape", - "-bugprone-not-null-terminated-result", - "-bugprone-parent-virtual-call", - "-bugprone-posix-return", - "-bugprone-redundant-branch-condition", - "-bugprone-reserved-identifier", - "-bugprone-signal-handler", - "-bugprone-signed-char-misuse", - "-bugprone-sizeof-*", - "-bugprone-sizeof-container", - "-bugprone-sizeof-expression", - "-bugprone-spuriously-wake-up-functions", - "-bugprone-string-*", - "-bugprone-string-constructor", - "-bugprone-string-integer-assignment", - "-bugprone-string-literal-with-embedded-nul", - "-bugprone-suspicious-*", - "-bugprone-suspicious-enum-usage", - "-bugprone-suspicious-include", - "-bugprone-suspicious-memset-usage", - "-bugprone-suspicious-missing-comma", - "-bugprone-suspicious-semicolon", - "-bugprone-suspicious-string-compare", - "-bugprone-swapped-arguments", - "-bugprone-terminating-continue", - "-bugprone-throw-keyword-missing", - "-bugprone-too-small-loop-variable", - "-bugprone-undefined-memory-manipulation", - "-bugprone-undelegated-constructor", - "-bugprone-unhandled-self-assignment", - "-bugprone-unused-raii", - "-bugprone-unused-return-value", - "-bugprone-use-after-move", - "-bugprone-virtual-near-miss", - "-cert-*", - "-cert-con*", - "-cert-con36-c", - "-cert-con54-cpp", - "-cert-dcl*", - "-cert-dcl03-c", - "-cert-dcl16-c", - "-cert-dcl21-cpp", - "-cert-dcl37-c", - "-cert-dcl50-cpp", - "-cert-dcl51-cpp", - "-cert-dcl54-cpp", - "-cert-dcl58-cpp", - "-cert-dcl59-cpp", - "-cert-env33-c", - "-cert-err*", - "-cert-err09-cpp", - "-cert-err34-c", - "-cert-err52-cpp", - "-cert-err58-cpp", - "-cert-err60-cpp", - "-cert-err61-cpp", - "-cert-fio38-c", - "-cert-flp30-c", - "-cert-mem57-cpp", - "-cert-msc*", - "-cert-msc30-c", - "-cert-msc32-c", - "-cert-msc50-cpp", - "-cert-msc51-cpp", - "-cert-oop*", - "-cert-oop11-cpp", - "-cert-oop54-cpp", - "-cert-oop57-cpp", - "-cert-oop58-cpp", - "-cert-pos44-c", - "-cert-sig30-c", - "-cert-str34-c", - "-clang-analyzer-*", - "-clang-analyzer-apiModeling.*", - "-clang-analyzer-apiModeling.StdCLibraryFunctions", - "-clang-analyzer-apiModeling.TrustNonnull", - "-clang-analyzer-apiModeling.google.GTest", - "-clang-analyzer-apiModeling.llvm.*", - "-clang-analyzer-apiModeling.llvm.CastValue", - "-clang-analyzer-apiModeling.llvm.ReturnValue", - "-clang-analyzer-core.*", - "-clang-analyzer-core.CallAndMessage", - "-clang-analyzer-core.CallAndMessageModeling", - "-clang-analyzer-core.DivideZero", - "-clang-analyzer-core.DynamicTypePropagation", - "-clang-analyzer-core.NonNullParamChecker", - "-clang-analyzer-core.NonnilStringConstants", - "-clang-analyzer-core.NullDereference", - "-clang-analyzer-core.StackAddrEscapeBase", - "-clang-analyzer-core.StackAddressEscape", - "-clang-analyzer-core.UndefinedBinaryOperatorResult", - "-clang-analyzer-core.VLASize", - "-clang-analyzer-core.builtin.*", - "-clang-analyzer-core.builtin.BuiltinFunctions", - "-clang-analyzer-core.builtin.NoReturnFunctions", - "-clang-analyzer-core.uninitialized.*", - "-clang-analyzer-core.uninitialized.ArraySubscript", - "-clang-analyzer-core.uninitialized.Assign", - "-clang-analyzer-core.uninitialized.Branch", - "-clang-analyzer-core.uninitialized.CapturedBlockVariable", - "-clang-analyzer-core.uninitialized.UndefReturn", - "-clang-analyzer-cplusplus.*", - "-clang-analyzer-cplusplus.InnerPointer", - "-clang-analyzer-cplusplus.Move", - "-clang-analyzer-cplusplus.NewDelete", - "-clang-analyzer-cplusplus.NewDeleteLeaks", - "-clang-analyzer-cplusplus.PlacementNew", - "-clang-analyzer-cplusplus.PureVirtualCall", - "-clang-analyzer-cplusplus.SelfAssignment", - "-clang-analyzer-cplusplus.SmartPtrModeling", - "-clang-analyzer-cplusplus.VirtualCallModeling", - "-clang-analyzer-deadcode.DeadStores", - "-clang-analyzer-fuchsia.HandleChecker", - "-clang-analyzer-nullablity.*", - "-clang-analyzer-nullability.NullPassedToNonnull", - "-clang-analyzer-nullability.NullReturnedFromNonnull", - "-clang-analyzer-nullability.NullabilityBase", - "-clang-analyzer-nullability.NullableDereferenced", - "-clang-analyzer-nullability.NullablePassedToNonnull", - "-clang-analyzer-nullability.NullableReturnedFromNonnull", - "-clang-analyzer-optin.*", - "-clang-analyzer-optin.cplusplus.*", - "-clang-analyzer-optin.cplusplus.UninitializedObject", - "-clang-analyzer-optin.cplusplus.VirtualCall", - "-clang-analyzer-optin.mpi.MPI-Checker", - "-clang-analyzer-optin.osx.*", - "-clang-analyzer-optin.osx.OSObjectCStyleCast", - "-clang-analyzer-optin.osx.cocoa.localizability.*", - "-clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker", - "-clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker", - "-clang-analyzer-optin.performance.*", - "-clang-analyzer-optin.performance.GCDAntipattern", - "-clang-analyzer-optin.performance.Padding", - "-clang-analyzer-optin.portability.UnixAPI", - "-clang-analyzer-osx.*", - "-clang-analyzer-osx.API", - "-clang-analyzer-osx.MIG", - "-clang-analyzer-osx.NSOrCFErrorDerefChecker", - "-clang-analyzer-osx.NumberObjectConversion", - "-clang-analyzer-osx.OSObjectRetainCount", - "-clang-analyzer-osx.ObjCProperty", - "-clang-analyzer-osx.SecKeychainAPI", - "-clang-analyzer-osx.cocoa.*", - "-clang-analyzer-osx.cocoa.AtSync", - "-clang-analyzer-osx.cocoa.AutoreleaseWrite", - "-clang-analyzer-osx.cocoa.ClassRelease", - "-clang-analyzer-osx.cocoa.Dealloc", - "-clang-analyzer-osx.cocoa.IncompatibleMethodTypes", - "-clang-analyzer-osx.cocoa.Loops", - "-clang-analyzer-osx.cocoa.MissingSuperCall", - "-clang-analyzer-osx.cocoa.NSAutoreleasePool", - "-clang-analyzer-osx.cocoa.NSError", - "-clang-analyzer-osx.cocoa.NilArg", - "-clang-analyzer-osx.cocoa.NonNilReturnValue", - "-clang-analyzer-osx.cocoa.ObjCGenerics", - "-clang-analyzer-osx.cocoa.RetainCount", - "-clang-analyzer-osx.cocoa.RetainCountBase", - "-clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak", - "-clang-analyzer-osx.cocoa.SelfInit", - "-clang-analyzer-osx.cocoa.SuperDealloc", - "-clang-analyzer-osx.cocoa.UnusedIvars", - "-clang-analyzer-osx.cocoa.VariadicMethodTypes", - "-clang-analyzer-osx.coreFoundation.*", - "-clang-analyzer-osx.coreFoundation.CFError", - "-clang-analyzer-osx.coreFoundation.CFNumber", - "-clang-analyzer-osx.coreFoundation.CFRetainRelease", - "-clang-analyzer-osx.coreFoundation.containers.*", - "-clang-analyzer-osx.coreFoundation.containers.OutOfBounds", - "-clang-analyzer-osx.coreFoundation.containers.PointerSizedValues", - "-clang-analyzer-security.*", - "-clang-analyzer-security.FloatLoopCounter", - "-clang-analyzer-security.insecureAPI.*", - "-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling", - "-clang-analyzer-security.insecureAPI.SecuritySyntaxChecker", - "-clang-analyzer-security.insecureAPI.UncheckedReturn", - "-clang-analyzer-security.insecureAPI.bcmp", - "-clang-analyzer-security.insecureAPI.bcopy", - "-clang-analyzer-security.insecureAPI.bzero", - "-clang-analyzer-security.insecureAPI.decodeValueOfObjCType", - "-clang-analyzer-security.insecureAPI.getpw", - "-clang-analyzer-security.insecureAPI.gets", - "-clang-analyzer-security.insecureAPI.mkstemp", - "-clang-analyzer-security.insecureAPI.mktemp", - "-clang-analyzer-security.insecureAPI.rand", - "-clang-analyzer-security.insecureAPI.strcpy", - "-clang-analyzer-security.insecureAPI.vfork", - "-clang-analyzer-unix.*", - "-clang-analyzer-unix.API", - "-clang-analyzer-unix.DynamicMemoryModeling", - "-clang-analyzer-unix.Malloc", - "-clang-analyzer-unix.MallocSizeof", - "-clang-analyzer-unix.MismatchedDeallocator", - "-clang-analyzer-unix.Vfork", - "-clang-analyzer-unix.cstring.*", - "-clang-analyzer-unix.cstring.BadSizeArg", - "-clang-analyzer-unix.cstring.CStringModeling", - "-clang-analyzer-unix.cstring.NullArg", - "-clang-analyzer-valist.*", - "-clang-analyzer-valist.CopyToSelf", - "-clang-analyzer-valist.Uninitialized", - "-clang-analyzer-valist.Unterminated", - "-clang-analyzer-valist.ValistBase", - "-clang-analyzer-webkit.*", - "-clang-analyzer-webkit.NoUncountedMemberChecker", - "-clang-analyzer-webkit.RefCntblBaseVirtualDtor", - "-clang-analyzer-webkit.UncountedLambdaCapturesChecker", - "-concurrency-mt-unsafe", - "-cppcoreguidelines-*", - "-cppcoreguidelines-avoid-*", - "-cppcoreguidelines-avoid-c-arrays", - "-cppcoreguidelines-avoid-goto", - "-cppcoreguidelines-avoid-magic-numbers", - "-cppcoreguidelines-avoid-non-const-global-variables", - "-cppcoreguidelines-c-copy-assignment-signature", - "-cppcoreguidelines-explicit-virtual-functions", - "-cppcoreguidelines-init-variables", - "-cppcoreguidelines-interfaces-global-init", - "-cppcoreguidelines-macro-usage", - "-cppcoreguidelines-narrowing-conversions", - "-cppcoreguidelines-no-malloc", - "-cppcoreguidelines-non-private-member-variables-in-classes", - "-cppcoreguidelines-owning-memory", - "-cppcoreguidelines-pro-bounds-*", - "-cppcoreguidelines-pro-bounds-array-to-pointer-decay", - "-cppcoreguidelines-pro-bounds-constant-array-index", - "-cppcoreguidelines-pro-bounds-pointer-arithmetic", - "-cppcoreguidelines-pro-type-*", - "-cppcoreguidelines-pro-type-const-cast", - "-cppcoreguidelines-pro-type-cstyle-cast", - "-cppcoreguidelines-pro-type-member-init", - "-cppcoreguidelines-pro-type-reinterpret-cast", - "-cppcoreguidelines-pro-type-static-cast-downcast", - "-cppcoreguidelines-pro-type-union-access", - "-cppcoreguidelines-pro-type-vararg", - "-cppcoreguidelines-slicing", - "-cppcoreguidelines-special-member-functions", - "-darwin-*", - "-darwin-avoid-spinlock", - "-darwin-dispatch-once-nonstatic", - "-fuschsia-*", - "-fuschsia-default-*", - "-fuchsia-default-arguments-calls", - "-fuchsia-default-arguments-declarations", - "-fuchsia-header-anon-namespaces", - "-fuchsia-multiple-inheritance", - "-fuchsia-overloaded-operator", - "-fuchsia-statically-constructed-objects", - "-fuchsia-trailing-return", - "-fuchsia-virtual-inheritance", - "-google-*", - "-google-build-*", - "-google-build-explicit-make-pair", - "-google-build-namespaces", - "-google-build-using-namespace", - "-google-default-arguments", - "-google-explicit-constructor", - "-google-global-names-in-headers", - "-google-objc-*", - "-google-objc-avoid-*", - "-google-objc-avoid-nsobject-new", - "-google-objc-avoid-throwing-exception", - "-google-objc-function-naming", - "-google-objc-global-variable-declaration", - "-google-readability-*", - "-google-readability-avoid-underscore-in-googletest-name", - "-google-readability-braces-around-statements", - "-google-readability-casting", - "-google-readability-function-size", - "-google-readability-namespace-comments", - "-google-readability-todo", - "-google-runtime-*", - "-google-runtime-int", - "-google-runtime-operator", - "-google-upgrade-googletest-case", - "-hicpp-*", - "-hicpp-avoid-*", - "-hicpp-avoid-c-arrays", - "-hicpp-avoid-goto", - "-hicpp-braces-around-statements", - "-hicpp-deprecated-headers", - "-hicpp-exception-baseclass", - "-hicpp-explicit-conversions", - "-hicpp-function-size", - "-hicpp-invalid-access-moved", - "-hicpp-member-init", - "-hicpp-move-const-arg", - "-hicpp-multiway-paths-covered", - "-hicpp-named-parameter", - "-hicpp-new-delete-operators", - "-hicpp-no-*", - "-hicpp-no-array-decay", - "-hicpp-no-assembler", - "-hicpp-no-malloc", - "-hicpp-noexcept-move", - "-hicpp-signed-bitwise", - "-hicpp-special-member-functions", - "-hicpp-static-assert", - "-hicpp-undelegated-constructor", - "-hicpp-uppercase-literal-suffix", - "-hicpp-use-*", - "-hicpp-use-auto", - "-hicpp-use-emplace", - "-hicpp-use-equals-*", - "-hicpp-use-equals-default", - "-hicpp-use-equals-delete", - "-hicpp-use-noexcept", - "-hicpp-use-nullptr", - "-hicpp-use-override", - "-hicpp-vararg", - "-linuxkernel-must-check-errs", - "-llvm-*", - "-llvm-else-after-return", - "-llvm-header-guard", - "-llvm-include-order", - "-llvm-namespace-comment", - "-llvm-prefer-*", - "-llvm-prefer-isa-or-dyn-cast-in-conditionals", - "-llvm-prefer-register-over-unsigned", - "-llvm-qualified-auto", - "-llvm-twine-local", - "-llvmlibc-*", - "-llvmlibc-callee-namespace", - "-llvmlibc-implementation-in-namespace", - "-llvmlibc-restrict-system-libc-headers", - "-misc-*", - "-misc-definitions-in-headers", - "-misc-misplaced-const", - "-misc-new-delete-overloads", - "-misc-no-recursion", - "-misc-non-*", - "-misc-non-copyable-objects", - "-misc-non-private-member-variables-in-classes", - "-misc-redundant-expression", - "-misc-static-assert", - "-misc-throw-by-value-catch-by-reference", - "-misc-unconventional-assign-operator", - "-misc-uniqueptr-reset-release", - "-misc-unused-*", - "-misc-unused-alias-decls", - "-misc-unused-parameters", - "-misc-unused-using-decls", - "-modernize-*", - "-modernize-avoid-*", - "-modernize-avoid-bind", - "-modernize-avoid-c-arrays", - "-modernize-concat-nested-namespaces", - "-modernize-deprecated-*", - "-modernize-deprecated-headers", - "-modernize-deprecated-ios-base-aliases", - "-modernize-loop-convert", - "-modernize-make-*", - "-modernize-make-shared", - "-modernize-make-unique", - "-modernize-pass-by-value", - "-modernize-raw-string-literal", - "-modernize-redundant-void-arg", - "-modernize-replace-*", - "-modernize-replace-auto-ptr", - "-modernize-replace-disallow-copy-and-assign-macro", - "-modernize-replace-random-shuffle", - "-modernize-return-braced-init-list", - "-modernize-shrink-to-fit", - "-modernize-unary-static-assert", - "-modernize-use-*", - "-modernize-use-auto", - "-modernize-use-bool-literals", - "-modernize-use-default-member-init", - "-modernize-use-emplace", - "-modernize-use-equals-*", - "-modernize-use-equals-default", - "-modernize-use-equals-delete", - "-modernize-use-nodiscard", - "-modernize-use-noexcept", - "-modernize-use-nullptr", - "-modernize-use-override", - "-modernize-use-trailing-return-type", - "-modernize-use-transparent-functors", - "-modernize-use-uncaught-exceptions", - "-modernize-use-using", - "-mpi-*", - "-mpi-buffer-deref", - "-mpi-type-mismatch", - "-objc-*", - "-objc-avoid-nserror-init", - "-objc-dealloc-in-category", - "-objc-forbidden-subclassing", - "-objc-missing-hash", - "-objc-nsinvocation-argument-lifetime", - "-objc-property-declaration", - "-objc-super-self", - "-openmp-*", - "-openmp-exception-escape", - "-openmp-use-default-none", - "-performance-*", - "-performance-faster-string-find", - "-performance-for-range-copy", - "-performance-implicit-conversion-in-loop", - "-performance-inefficient-*", - "-performance-inefficient-algorithm", - "-performance-inefficient-string-concatenation", - "-performance-inefficient-vector-operation", - "-performance-move-*", - "-performance-move-const-arg", - "-performance-move-constructor-init", - "-performance-no-*", - "-performance-no-automatic-move", - "-performance-no-int-to-ptr", - "-performance-noexcept-move-constructor", - "-performance-trivially-destructible", - "-performance-type-promotion-in-math-fn", - "-performance-unnecessary-*", - "-performance-unnecessary-copy-initialization", - "-performance-unnecessary-value-param", - "-portability-*", - "-portability-restrict-system-includes", - "-portability-simd-intrinsics", - "-readability-*", - "-readability-avoid-const-params-in-decls", - "-readability-braces-around-statements", - "-readability-const-return-type", - "-readability-container-size-empty", - "-readability-convert-member-functions-to-static", - "-readability-delete-null-pointer", - "-readability-deleted-default", - "-readability-else-after-return", - "-readability-function-*", - "-readability-function-cognitive-complexity", - "-readability-function-size", - "-readability-identifier-naming", - "-readability-implicit-bool-conversion", - "-readability-inconsistent-declaration-parameter-name", - "-readability-isolate-declaration", - "-readability-magic-numbers", - "-readability-make-member-function-const", - "-readability-misleading-indentation", - "-readability-misplaced-array-index", - "-readability-named-parameter", - "-readability-non-const-parameter", - "-readability-qualified-auto", - "-readability-redundant-*", - "-readability-redundant-access-specifiers", - "-readability-redundant-control-flow", - "-readability-redundant-declaration", - "-readability-redundant-function-ptr-dereference", - "-readability-redundant-member-init", - "-readability-redundant-preprocessor", - "-readability-redundant-smartptr-get", - "-readability-redundant-string-*", - "-readability-redundant-string-cstr", - "-readability-redundant-string-init", - "-readability-simplify-*", - "-readability-simplify-boolean-expr", - "-readability-simplify-subscript-expr", - "-readability-static-*", - "-readability-static-accessed-through-instance", - "-readability-static-definition-in-anonymous-namespace", - "-readability-string-compare", - "-readability-uniqueptr-delete-release", - "-readability-uppercase-literal-suffix", - "-readability-use-anyofallof", - "-zircon-temporary-objects" + "zircon-temporary-objects" ] }, - "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.checks.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.checks.enabled.markdownDescription%", + "scope": "resource" + }, + "C_Cpp.codeAnalysis.clangTidy.checks.disabled": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "*", + "abseil-*", + "abseil-duration-*", + "abseil-duration-addition", + "abseil-duration-comparison", + "abseil-duration-conversion-cast", + "abseil-duration-division", + "abseil-duration-factory-*", + "abseil-duration-factory-float", + "abseil-duration-factory-scale", + "abseil-duration-subtraction", + "abseil-duration-unnecessary-conversion", + "abseil-faster-strsplit-delimiter", + "abseil-no-*", + "abseil-no-internal-dependencies", + "abseil-no-namespace", + "abseil-redundant-strcat-calls", + "abseil-str-cat-append", + "abseil-string-find-*", + "abseil-string-find-startswith", + "abseil-string-find-str-contains", + "abseil-time-*", + "abseil-time-comparison", + "abseil-time-subtraction", + "abseil-upgrade-duration-conversions", + "altera-*", + "altera-kernel-name-restriction", + "altera-single-work-item-barrier", + "altera-struct-pack-align", + "android-*", + "android-cloexec-*", + "android-cloexec-accept", + "android-cloexec-accept4", + "android-cloexec-creat", + "android-cloexec-dup", + "android-cloexec-epoll-*", + "android-cloexec-epoll-create", + "android-cloexec-epoll-create1", + "android-cloexec-fopen", + "android-cloexec-inotify-*", + "android-cloexec-inotify-init", + "android-cloexec-inotify-init1", + "android-cloexec-memfd-create", + "android-cloexec-open", + "android-cloexec-pipe", + "android-cloexec-pipe2", + "android-cloexec-socket", + "android-comparison-in-temp-failure-retry", + "boost-use-to-string", + "bugprone-*", + "bugprone-argument-comment", + "bugprone-assert-side-effect", + "bugprone-bad-signal-to-kill-thread", + "bugprone-bool-pointer-implicit-conversion", + "bugprone-branch-clone", + "bugprone-copy-constructor-init", + "bugprone-dangling-handle", + "bugprone-dynamic-static-initializers", + "bugprone-exception-escape", + "bugprone-fold-init-type", + "bugprone-forward-declaration-namespace", + "bugprone-forwarding-reference-overload", + "bugprone-inaccurate-erase", + "bugprone-incorrect-roundings", + "bugprone-infinite-loop", + "bugprone-integer-division", + "bugprone-lambda-function-name", + "bugprone-macro-parentheses", + "bugprone-macro-repeated-side-effects", + "bugprone-misplaced-*", + "bugprone-misplaced-operator-in-strlen-in-alloc", + "bugprone-misplaced-pointer-arithmetic-in-alloc", + "bugprone-misplaced-widening-cast", + "bugprone-move-forwarding-reference", + "bugprone-multiple-statement-macro", + "bugprone-narrowing-conversions", + "bugprone-no-escape", + "bugprone-not-null-terminated-result", + "bugprone-parent-virtual-call", + "bugprone-posix-return", + "bugprone-redundant-branch-condition", + "bugprone-reserved-identifier", + "bugprone-signal-handler", + "bugprone-signed-char-misuse", + "bugprone-sizeof-*", + "bugprone-sizeof-container", + "bugprone-sizeof-expression", + "bugprone-spuriously-wake-up-functions", + "bugprone-string-*", + "bugprone-string-constructor", + "bugprone-string-integer-assignment", + "bugprone-string-literal-with-embedded-nul", + "bugprone-suspicious-*", + "bugprone-suspicious-enum-usage", + "bugprone-suspicious-include", + "bugprone-suspicious-memset-usage", + "bugprone-suspicious-missing-comma", + "bugprone-suspicious-semicolon", + "bugprone-suspicious-string-compare", + "bugprone-swapped-arguments", + "bugprone-terminating-continue", + "bugprone-throw-keyword-missing", + "bugprone-too-small-loop-variable", + "bugprone-undefined-memory-manipulation", + "bugprone-undelegated-constructor", + "bugprone-unhandled-self-assignment", + "bugprone-unused-raii", + "bugprone-unused-return-value", + "bugprone-use-after-move", + "bugprone-virtual-near-miss", + "cert-*", + "cert-con*", + "cert-con36-c", + "cert-con54-cpp", + "cert-dcl*", + "cert-dcl03-c", + "cert-dcl16-c", + "cert-dcl21-cpp", + "cert-dcl37-c", + "cert-dcl50-cpp", + "cert-dcl51-cpp", + "cert-dcl54-cpp", + "cert-dcl58-cpp", + "cert-dcl59-cpp", + "cert-env33-c", + "cert-err*", + "cert-err09-cpp", + "cert-err34-c", + "cert-err52-cpp", + "cert-err58-cpp", + "cert-err60-cpp", + "cert-err61-cpp", + "cert-fio38-c", + "cert-flp30-c", + "cert-mem57-cpp", + "cert-msc*", + "cert-msc30-c", + "cert-msc32-c", + "cert-msc50-cpp", + "cert-msc51-cpp", + "cert-oop*", + "cert-oop11-cpp", + "cert-oop54-cpp", + "cert-oop57-cpp", + "cert-oop58-cpp", + "cert-pos44-c", + "cert-sig30-c", + "cert-str34-c", + "clang-analyzer-*", + "clang-analyzer-apiModeling.*", + "clang-analyzer-apiModeling.StdCLibraryFunctions", + "clang-analyzer-apiModeling.TrustNonnull", + "clang-analyzer-apiModeling.google.GTest", + "clang-analyzer-apiModeling.llvm.*", + "clang-analyzer-apiModeling.llvm.CastValue", + "clang-analyzer-apiModeling.llvm.ReturnValue", + "clang-analyzer-core.*", + "clang-analyzer-core.CallAndMessage", + "clang-analyzer-core.CallAndMessageModeling", + "clang-analyzer-core.DivideZero", + "clang-analyzer-core.DynamicTypePropagation", + "clang-analyzer-core.NonNullParamChecker", + "clang-analyzer-core.NonnilStringConstants", + "clang-analyzer-core.NullDereference", + "clang-analyzer-core.StackAddrEscapeBase", + "clang-analyzer-core.StackAddressEscape", + "clang-analyzer-core.UndefinedBinaryOperatorResult", + "clang-analyzer-core.VLASize", + "clang-analyzer-core.builtin.*", + "clang-analyzer-core.builtin.BuiltinFunctions", + "clang-analyzer-core.builtin.NoReturnFunctions", + "clang-analyzer-core.uninitialized.*", + "clang-analyzer-core.uninitialized.ArraySubscript", + "clang-analyzer-core.uninitialized.Assign", + "clang-analyzer-core.uninitialized.Branch", + "clang-analyzer-core.uninitialized.CapturedBlockVariable", + "clang-analyzer-core.uninitialized.UndefReturn", + "clang-analyzer-cplusplus.*", + "clang-analyzer-cplusplus.InnerPointer", + "clang-analyzer-cplusplus.Move", + "clang-analyzer-cplusplus.NewDelete", + "clang-analyzer-cplusplus.NewDeleteLeaks", + "clang-analyzer-cplusplus.PlacementNew", + "clang-analyzer-cplusplus.PureVirtualCall", + "clang-analyzer-cplusplus.SelfAssignment", + "clang-analyzer-cplusplus.SmartPtrModeling", + "clang-analyzer-cplusplus.VirtualCallModeling", + "clang-analyzer-deadcode.DeadStores", + "clang-analyzer-fuchsia.HandleChecker", + "clang-analyzer-nullablity.*", + "clang-analyzer-nullability.NullPassedToNonnull", + "clang-analyzer-nullability.NullReturnedFromNonnull", + "clang-analyzer-nullability.NullabilityBase", + "clang-analyzer-nullability.NullableDereferenced", + "clang-analyzer-nullability.NullablePassedToNonnull", + "clang-analyzer-nullability.NullableReturnedFromNonnull", + "clang-analyzer-optin.*", + "clang-analyzer-optin.cplusplus.*", + "clang-analyzer-optin.cplusplus.UninitializedObject", + "clang-analyzer-optin.cplusplus.VirtualCall", + "clang-analyzer-optin.mpi.MPI-Checker", + "clang-analyzer-optin.osx.*", + "clang-analyzer-optin.osx.OSObjectCStyleCast", + "clang-analyzer-optin.osx.cocoa.localizability.*", + "clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker", + "clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker", + "clang-analyzer-optin.performance.*", + "clang-analyzer-optin.performance.GCDAntipattern", + "clang-analyzer-optin.performance.Padding", + "clang-analyzer-optin.portability.UnixAPI", + "clang-analyzer-osx.*", + "clang-analyzer-osx.API", + "clang-analyzer-osx.MIG", + "clang-analyzer-osx.NSOrCFErrorDerefChecker", + "clang-analyzer-osx.NumberObjectConversion", + "clang-analyzer-osx.OSObjectRetainCount", + "clang-analyzer-osx.ObjCProperty", + "clang-analyzer-osx.SecKeychainAPI", + "clang-analyzer-osx.cocoa.*", + "clang-analyzer-osx.cocoa.AtSync", + "clang-analyzer-osx.cocoa.AutoreleaseWrite", + "clang-analyzer-osx.cocoa.ClassRelease", + "clang-analyzer-osx.cocoa.Dealloc", + "clang-analyzer-osx.cocoa.IncompatibleMethodTypes", + "clang-analyzer-osx.cocoa.Loops", + "clang-analyzer-osx.cocoa.MissingSuperCall", + "clang-analyzer-osx.cocoa.NSAutoreleasePool", + "clang-analyzer-osx.cocoa.NSError", + "clang-analyzer-osx.cocoa.NilArg", + "clang-analyzer-osx.cocoa.NonNilReturnValue", + "clang-analyzer-osx.cocoa.ObjCGenerics", + "clang-analyzer-osx.cocoa.RetainCount", + "clang-analyzer-osx.cocoa.RetainCountBase", + "clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak", + "clang-analyzer-osx.cocoa.SelfInit", + "clang-analyzer-osx.cocoa.SuperDealloc", + "clang-analyzer-osx.cocoa.UnusedIvars", + "clang-analyzer-osx.cocoa.VariadicMethodTypes", + "clang-analyzer-osx.coreFoundation.*", + "clang-analyzer-osx.coreFoundation.CFError", + "clang-analyzer-osx.coreFoundation.CFNumber", + "clang-analyzer-osx.coreFoundation.CFRetainRelease", + "clang-analyzer-osx.coreFoundation.containers.*", + "clang-analyzer-osx.coreFoundation.containers.OutOfBounds", + "clang-analyzer-osx.coreFoundation.containers.PointerSizedValues", + "clang-analyzer-security.*", + "clang-analyzer-security.FloatLoopCounter", + "clang-analyzer-security.insecureAPI.*", + "clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling", + "clang-analyzer-security.insecureAPI.SecuritySyntaxChecker", + "clang-analyzer-security.insecureAPI.UncheckedReturn", + "clang-analyzer-security.insecureAPI.bcmp", + "clang-analyzer-security.insecureAPI.bcopy", + "clang-analyzer-security.insecureAPI.bzero", + "clang-analyzer-security.insecureAPI.decodeValueOfObjCType", + "clang-analyzer-security.insecureAPI.getpw", + "clang-analyzer-security.insecureAPI.gets", + "clang-analyzer-security.insecureAPI.mkstemp", + "clang-analyzer-security.insecureAPI.mktemp", + "clang-analyzer-security.insecureAPI.rand", + "clang-analyzer-security.insecureAPI.strcpy", + "clang-analyzer-security.insecureAPI.vfork", + "clang-analyzer-unix.*", + "clang-analyzer-unix.API", + "clang-analyzer-unix.DynamicMemoryModeling", + "clang-analyzer-unix.Malloc", + "clang-analyzer-unix.MallocSizeof", + "clang-analyzer-unix.MismatchedDeallocator", + "clang-analyzer-unix.Vfork", + "clang-analyzer-unix.cstring.*", + "clang-analyzer-unix.cstring.BadSizeArg", + "clang-analyzer-unix.cstring.CStringModeling", + "clang-analyzer-unix.cstring.NullArg", + "clang-analyzer-valist.*", + "clang-analyzer-valist.CopyToSelf", + "clang-analyzer-valist.Uninitialized", + "clang-analyzer-valist.Unterminated", + "clang-analyzer-valist.ValistBase", + "clang-analyzer-webkit.*", + "clang-analyzer-webkit.NoUncountedMemberChecker", + "clang-analyzer-webkit.RefCntblBaseVirtualDtor", + "clang-analyzer-webkit.UncountedLambdaCapturesChecker", + "concurrency-mt-unsafe", + "cppcoreguidelines-*", + "cppcoreguidelines-avoid-*", + "cppcoreguidelines-avoid-c-arrays", + "cppcoreguidelines-avoid-goto", + "cppcoreguidelines-avoid-magic-numbers", + "cppcoreguidelines-avoid-non-const-global-variables", + "cppcoreguidelines-c-copy-assignment-signature", + "cppcoreguidelines-explicit-virtual-functions", + "cppcoreguidelines-init-variables", + "cppcoreguidelines-interfaces-global-init", + "cppcoreguidelines-macro-usage", + "cppcoreguidelines-narrowing-conversions", + "cppcoreguidelines-no-malloc", + "cppcoreguidelines-non-private-member-variables-in-classes", + "cppcoreguidelines-owning-memory", + "cppcoreguidelines-pro-bounds-*", + "cppcoreguidelines-pro-bounds-array-to-pointer-decay", + "cppcoreguidelines-pro-bounds-constant-array-index", + "cppcoreguidelines-pro-bounds-pointer-arithmetic", + "cppcoreguidelines-pro-type-*", + "cppcoreguidelines-pro-type-const-cast", + "cppcoreguidelines-pro-type-cstyle-cast", + "cppcoreguidelines-pro-type-member-init", + "cppcoreguidelines-pro-type-reinterpret-cast", + "cppcoreguidelines-pro-type-static-cast-downcast", + "cppcoreguidelines-pro-type-union-access", + "cppcoreguidelines-pro-type-vararg", + "cppcoreguidelines-slicing", + "cppcoreguidelines-special-member-functions", + "darwin-*", + "darwin-avoid-spinlock", + "darwin-dispatch-once-nonstatic", + "fuschsia-*", + "fuschsia-default-*", + "fuchsia-default-arguments-calls", + "fuchsia-default-arguments-declarations", + "fuchsia-header-anon-namespaces", + "fuchsia-multiple-inheritance", + "fuchsia-overloaded-operator", + "fuchsia-statically-constructed-objects", + "fuchsia-trailing-return", + "fuchsia-virtual-inheritance", + "google-*", + "google-build-*", + "google-build-explicit-make-pair", + "google-build-namespaces", + "google-build-using-namespace", + "google-default-arguments", + "google-explicit-constructor", + "google-global-names-in-headers", + "google-objc-*", + "google-objc-avoid-*", + "google-objc-avoid-nsobject-new", + "google-objc-avoid-throwing-exception", + "google-objc-function-naming", + "google-objc-global-variable-declaration", + "google-readability-*", + "google-readability-avoid-underscore-in-googletest-name", + "google-readability-braces-around-statements", + "google-readability-casting", + "google-readability-function-size", + "google-readability-namespace-comments", + "google-readability-todo", + "google-runtime-*", + "google-runtime-int", + "google-runtime-operator", + "google-upgrade-googletest-case", + "hicpp-*", + "hicpp-avoid-*", + "hicpp-avoid-c-arrays", + "hicpp-avoid-goto", + "hicpp-braces-around-statements", + "hicpp-deprecated-headers", + "hicpp-exception-baseclass", + "hicpp-explicit-conversions", + "hicpp-function-size", + "hicpp-invalid-access-moved", + "hicpp-member-init", + "hicpp-move-const-arg", + "hicpp-multiway-paths-covered", + "hicpp-named-parameter", + "hicpp-new-delete-operators", + "hicpp-no-*", + "hicpp-no-array-decay", + "hicpp-no-assembler", + "hicpp-no-malloc", + "hicpp-noexcept-move", + "hicpp-signed-bitwise", + "hicpp-special-member-functions", + "hicpp-static-assert", + "hicpp-undelegated-constructor", + "hicpp-uppercase-literal-suffix", + "hicpp-use-*", + "hicpp-use-auto", + "hicpp-use-emplace", + "hicpp-use-equals-*", + "hicpp-use-equals-default", + "hicpp-use-equals-delete", + "hicpp-use-noexcept", + "hicpp-use-nullptr", + "hicpp-use-override", + "hicpp-vararg", + "linuxkernel-must-check-errs", + "llvm-*", + "llvm-else-after-return", + "llvm-header-guard", + "llvm-include-order", + "llvm-namespace-comment", + "llvm-prefer-*", + "llvm-prefer-isa-or-dyn-cast-in-conditionals", + "llvm-prefer-register-over-unsigned", + "llvm-qualified-auto", + "llvm-twine-local", + "llvmlibc-*", + "llvmlibc-callee-namespace", + "llvmlibc-implementation-in-namespace", + "llvmlibc-restrict-system-libc-headers", + "misc-*", + "misc-definitions-in-headers", + "misc-misplaced-const", + "misc-new-delete-overloads", + "misc-no-recursion", + "misc-non-*", + "misc-non-copyable-objects", + "misc-non-private-member-variables-in-classes", + "misc-redundant-expression", + "misc-static-assert", + "misc-throw-by-value-catch-by-reference", + "misc-unconventional-assign-operator", + "misc-uniqueptr-reset-release", + "misc-unused-*", + "misc-unused-alias-decls", + "misc-unused-parameters", + "misc-unused-using-decls", + "modernize-*", + "modernize-avoid-*", + "modernize-avoid-bind", + "modernize-avoid-c-arrays", + "modernize-concat-nested-namespaces", + "modernize-deprecated-*", + "modernize-deprecated-headers", + "modernize-deprecated-ios-base-aliases", + "modernize-loop-convert", + "modernize-make-*", + "modernize-make-shared", + "modernize-make-unique", + "modernize-pass-by-value", + "modernize-raw-string-literal", + "modernize-redundant-void-arg", + "modernize-replace-*", + "modernize-replace-auto-ptr", + "modernize-replace-disallow-copy-and-assign-macro", + "modernize-replace-random-shuffle", + "modernize-return-braced-init-list", + "modernize-shrink-to-fit", + "modernize-unary-static-assert", + "modernize-use-*", + "modernize-use-auto", + "modernize-use-bool-literals", + "modernize-use-default-member-init", + "modernize-use-emplace", + "modernize-use-equals-*", + "modernize-use-equals-default", + "modernize-use-equals-delete", + "modernize-use-nodiscard", + "modernize-use-noexcept", + "modernize-use-nullptr", + "modernize-use-override", + "modernize-use-trailing-return-type", + "modernize-use-transparent-functors", + "modernize-use-uncaught-exceptions", + "modernize-use-using", + "mpi-*", + "mpi-buffer-deref", + "mpi-type-mismatch", + "objc-*", + "objc-avoid-nserror-init", + "objc-dealloc-in-category", + "objc-forbidden-subclassing", + "objc-missing-hash", + "objc-nsinvocation-argument-lifetime", + "objc-property-declaration", + "objc-super-self", + "openmp-*", + "openmp-exception-escape", + "openmp-use-default-none", + "performance-*", + "performance-faster-string-find", + "performance-for-range-copy", + "performance-implicit-conversion-in-loop", + "performance-inefficient-*", + "performance-inefficient-algorithm", + "performance-inefficient-string-concatenation", + "performance-inefficient-vector-operation", + "performance-move-*", + "performance-move-const-arg", + "performance-move-constructor-init", + "performance-no-*", + "performance-no-automatic-move", + "performance-no-int-to-ptr", + "performance-noexcept-move-constructor", + "performance-trivially-destructible", + "performance-type-promotion-in-math-fn", + "performance-unnecessary-*", + "performance-unnecessary-copy-initialization", + "performance-unnecessary-value-param", + "portability-*", + "portability-restrict-system-includes", + "portability-simd-intrinsics", + "readability-*", + "readability-avoid-const-params-in-decls", + "readability-braces-around-statements", + "readability-const-return-type", + "readability-container-size-empty", + "readability-convert-member-functions-to-static", + "readability-delete-null-pointer", + "readability-deleted-default", + "readability-else-after-return", + "readability-function-*", + "readability-function-cognitive-complexity", + "readability-function-size", + "readability-identifier-naming", + "readability-implicit-bool-conversion", + "readability-inconsistent-declaration-parameter-name", + "readability-isolate-declaration", + "readability-magic-numbers", + "readability-make-member-function-const", + "readability-misleading-indentation", + "readability-misplaced-array-index", + "readability-named-parameter", + "readability-non-const-parameter", + "readability-qualified-auto", + "readability-redundant-*", + "readability-redundant-access-specifiers", + "readability-redundant-control-flow", + "readability-redundant-declaration", + "readability-redundant-function-ptr-dereference", + "readability-redundant-member-init", + "readability-redundant-preprocessor", + "readability-redundant-smartptr-get", + "readability-redundant-string-*", + "readability-redundant-string-cstr", + "readability-redundant-string-init", + "readability-simplify-*", + "readability-simplify-boolean-expr", + "readability-simplify-subscript-expr", + "readability-static-*", + "readability-static-accessed-through-instance", + "readability-static-definition-in-anonymous-namespace", + "readability-string-compare", + "readability-uniqueptr-delete-release", + "readability-uppercase-literal-suffix", + "readability-use-anyofallof", + "zircon-temporary-objects" + ] + }, + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.checks.disabled.markdownDescription%", "scope": "resource" }, "C_Cpp.clang_format_path": { diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 21fb49199b..61388797db 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -24,32 +24,33 @@ "c_cpp.command.RunCodeAnalysisOnActiveFile.title": "Run Code Analysis on Active File", "c_cpp.command.RunCodeAnalysisOnOpenFiles.title": "Run Code Analysis on Open Files", "c_cpp.command.RunCodeAnalysisOnAllFiles.title": "Run Code Analysis on All Files", - "c_cpp.configuration.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may not always be used. The default of `null` uses the number of logical processors available.", - "c_cpp.configuration.maxCachedProcesses.markdownDescription": "The maximum number of cached processes to use for language service processing. The default of `null` uses twice the number of logical processors available.", - "c_cpp.configuration.maxMemory.markdownDescription": "The maximum memory (in MB) available for language service processing. Fewer processes will be cached and run concurrently after this memory usage is exceeded. The default of `null` uses the system's free memory.", - "c_cpp.configuration.intelliSense.maxCachedProcesses.markdownDescription": "The maximum number of IntelliSense processes to keep running. The default of `null` uses value inherited from `#C_Cpp.maxCachedProcesses#`", - "c_cpp.configuration.intelliSense.maxMemory.markdownDescription": "Older IntelliSense processes will shut down before new processes are created after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", - "c_cpp.configuration.references.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", - "c_cpp.configuration.references.maxCachedProcesses.markdownDescription": "The maximum number of processes to keep in memory for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxCachedProcesses#`.", - "c_cpp.configuration.references.maxMemory.markdownDescription": "Fewer 'Find All References' and 'Rename' processes will be cached and run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", - "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": "The maximum number of concurrent threads to use for code analysis. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", - "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", - "c_cpp.configuration.codeAnalysis.updateDelay.markdownDescription": "Controls the delay in milliseconds before code analysis starts processing after a save is triggered from an edit when `#files.autoSave#` is `afterDelay` and `#C_Cpp.runInBackground#` is `true`.", - "c_cpp.configuration.codeAnalysis.exclude.markdownDescription": "Configure glob patterns for excluding folders and files for code analysis. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", - "c_cpp.configuration.codeAnalysis.excludeBoolean.description": "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.", - "c_cpp.configuration.codeAnalysis.excludeWhen.markdownDescription": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", - "c_cpp.configuration.codeAnalysis.runInBackground.markdownDescription": "If `true`, code analysis will run automatically in the background.", - "c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription": "If `true`, code analysis will run automatically after a build is completed.", - "c_cpp.configuration.codeAnalysis.clangTidy.enabled.markdownDescription": "If `true`, code analysis using `clang-tidy` will be enabled.", - "c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription": "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.", - "c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription": "Path to the `compile_commands.json` compilation database for `clang-tidy`. If not specified, the build configuration from IntelliSense will be used.", - "c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription": "Specifies a `clang-tidy` configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, `clang-tidy` will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", - "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": "Specifies a `clang-tidy` configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", - "c_cpp.configuration.codeAnalysis.clangTidy.fix.warnings.markdownDescription": "If `true`, `clang-tidy` fixes for warnings are automatically applied. No fixes are applied if errors occur unless `#C_Cpp.codeAnalysis.clangTidy.fix.errors#` is also set.", - "c_cpp.configuration.codeAnalysis.clangTidy.fix.errors.markdownDescription": "If `true`, `clang-tidy` fixes for warnings and errors are automatically applied.", - "c_cpp.configuration.codeAnalysis.clangTidy.fix.notes.markdownDescription": "If `true`, `clang-tidy` fixes for warnings are automatically applied, along with fixes found through an associated diagnostic note.", - "c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription": "Additional command line arguments to pass to `clang-tidy`. These take precedence over the equivalent `C_Cpp.codeAnalysis.clangTidy.*` settings.", - "c_cpp.configuration.codeAnalysis.clangTidy.checks.markdownDescription": "Values without a `-` prefix add `clang-tidy` checks with matching names, and values with the `-` prefix remove checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly removed.", + "c_cpp.configuration.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may not always be used. The default of `null` uses the number of logical processors available.", + "c_cpp.configuration.maxCachedProcesses.markdownDescription": { "message": "The maximum number of cached processes to use for language service processing. The default of `null` uses twice the number of logical processors available.", "comment": [ "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." ] }, + "c_cpp.configuration.maxMemory.markdownDescription": { "message": "The maximum memory (in MB) available for language service processing. Fewer processes will be cached and run concurrently after this memory usage is exceeded. The default of `null` uses the system's free memory.", "comment": [ "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." ] }, + "c_cpp.configuration.intelliSense.maxCachedProcesses.markdownDescription": { "message": "The maximum number of IntelliSense processes to keep running. The default of `null` uses value inherited from `#C_Cpp.maxCachedProcesses#`", "comment": [ "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." ] }, + "c_cpp.configuration.intelliSense.maxMemory.markdownDescription": { "message": "Older IntelliSense processes will shut down before new processes are created after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, + "c_cpp.configuration.references.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "comment": [ "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." ] }, + "c_cpp.configuration.references.maxCachedProcesses.markdownDescription": { "message": "The maximum number of processes to keep in memory for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxCachedProcesses#`.", "comment": [ "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." ] }, + "c_cpp.configuration.references.maxMemory.markdownDescription": { "message": "Fewer 'Find All References' and 'Rename' processes will be cached and run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for code analysis. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": { "message": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.updateDelay.markdownDescription": { "message": "Controls the delay in milliseconds before code analysis starts processing after a save is triggered from an edit when `#files.autoSave#` is `afterDelay` and `#C_Cpp.runInBackground#` is `true`.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.exclude.markdownDescription": { "message": "Configure glob patterns for excluding folders and files for code analysis. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.excludeBoolean.description": "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.excludeWhen.markdownDescription": { "message": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.runInBackground.markdownDescription": { "message": "If `true`, code analysis will run automatically in the background.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription": { "message": "If `true`, code analysis will run automatically after a build is completed.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.enabled.markdownDescription": { "message": "If `true`, code analysis using `clang-tidy` will be enabled.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription": { "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.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription": { "message": "Path to the `compile_commands.json` compilation database for `clang-tidy`. If not specified, the build configuration from IntelliSense will be used.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, `clang-tidy` will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.fix.warnings.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied. No fixes are applied if errors occur unless `#C_Cpp.codeAnalysis.clangTidy.fix.errors#` is also set.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.fix.errors.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings and errors are automatically applied.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.fix.notes.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied, along with fixes found through an associated diagnostic note.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription": { "message": "Additional command line arguments to pass to `clang-tidy`. These take precedence over the equivalent `C_Cpp.codeAnalysis.clangTidy.*` settings.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.checks.enabled.markdownDescription": { "message": "List of enabled `clang-tidy` checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly disabled.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.checks.disabled.markdownDescription": { "message": "List of disabled `clang-tidy` checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any.", "comment": [ "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." ] }, "c_cpp.configuration.formatting.description": "Configures the formatting engine", "c_cpp.configuration.formatting.clangFormat.markdownDescription": { "message": "`clang-format` will be used to format code.", "comment": [ "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." ] }, "c_cpp.configuration.formatting.vcFormat.markdownDescription": { "message": "The Visual C++ formatting engine will be used to format code.", "comment": [ "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." ] }, diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 17721c6b46..74b5ebeec5 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1062,7 +1062,8 @@ export class DefaultClient implements Client { const settings_clangTidyFixErrors: (boolean | undefined)[] = []; const settings_clangTidyFixNotes: (boolean | undefined)[] = []; const settings_clangTidyArgs: (string | undefined)[] = []; - const settings_clangTidyChecks: (string[] | undefined)[] = []; + const settings_clangTidyChecksEnabled: (string[] | undefined)[] = []; + const settings_clangTidyChecksDisabled: (string[] | undefined)[] = []; const settings_filesEncoding: (string | undefined)[] = []; const settings_cppFilesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; const settings_filesExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; @@ -1171,7 +1172,8 @@ export class DefaultClient implements Client { settings_clangTidyFixErrors.push(setting.clangTidyFixErrors); settings_clangTidyFixNotes.push(setting.clangTidyFixNotes); settings_clangTidyArgs.push(setting.clangTidyArgs); - settings_clangTidyChecks.push(setting.clangTidyChecks); + settings_clangTidyChecksEnabled.push(setting.clangTidyChecksEnabled); + settings_clangTidyChecksDisabled.push(setting.clangTidyChecksDisabled); settings_indentBraces.push(setting.vcFormatIndentBraces); settings_indentWithinParentheses.push(setting.vcFormatIndentWithinParentheses); settings_indentPreserveWithinParentheses.push(setting.vcFormatIndentPreserveWithinParentheses); @@ -1311,7 +1313,10 @@ export class DefaultClient implements Client { notes: settings_clangTidyFixNotes }, args: settings_clangTidyArgs, - checks: settings_clangTidyChecks + checks: { + enabled: settings_clangTidyChecksEnabled, + disabled: settings_clangTidyChecksDisabled + } } }, clang_format_path: settings_clangFormatPath, @@ -1497,6 +1502,9 @@ export class DefaultClient implements Client { ...vscode.workspace.getConfiguration("C_Cpp.codeAnalysis.clangTidy", this.RootUri), fix: { ...vscode.workspace.getConfiguration("C_Cpp.codeAnalysis.clangTidy.fix", this.RootUri) + }, + checks: { + ...vscode.workspace.getConfiguration("C_Cpp.codeAnalysis.clangTidy.checks", this.RootUri) } } }, diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index d597784930..6c8eed62fe 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -165,7 +165,8 @@ export class CppSettings extends Settings { public get clangTidyFixErrors(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.errors"); } public get clangTidyFixNotes(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.notes"); } public get clangTidyArgs(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.args"); } - public get clangTidyChecks(): string[] | undefined { return super.Section.get("codeAnalysis.clangTidy.checks"); } + public get clangTidyChecksEnabled(): string[] | undefined { return super.Section.get("codeAnalysis.clangTidy.checks.enabled"); } + public get clangTidyChecksDisabled(): string[] | undefined { return super.Section.get("codeAnalysis.clangTidy.checks.disabled"); } public get clangFormatStyle(): string | undefined { return super.Section.get("clang_format_style"); } public get clangFormatFallbackStyle(): string | undefined { return super.Section.get("clang_format_fallbackStyle"); } public get clangFormatSortIncludes(): string | undefined { return super.Section.get("clang_format_sortIncludes"); } From e72aff735379e6ff8b5d4d7a5b0ee1a02cfc7b1b Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 20 Sep 2021 11:56:52 -0700 Subject: [PATCH 064/101] Fix string bugs. --- Extension/package.json | 2 +- Extension/package.nls.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 28aef4b792..2489fe9d0f 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -367,7 +367,7 @@ "anyOf": [ { "type": "boolean", - "description": "%c_cpp.configuration.codeAnalysis.excludeBoolean.description%" + "markdownDescription": "%c_cpp.configuration.codeAnalysis.excludeBoolean.markdownDescription%" }, { "type": "object", diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 61388797db..c8bfbd79d1 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -24,7 +24,7 @@ "c_cpp.command.RunCodeAnalysisOnActiveFile.title": "Run Code Analysis on Active File", "c_cpp.command.RunCodeAnalysisOnOpenFiles.title": "Run Code Analysis on Open Files", "c_cpp.command.RunCodeAnalysisOnAllFiles.title": "Run Code Analysis on All Files", - "c_cpp.configuration.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may not always be used. The default of `null` uses the number of logical processors available.", + "c_cpp.configuration.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may not always be used. The default of `null` uses the number of logical processors available.", "comment": [ "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." ] }, "c_cpp.configuration.maxCachedProcesses.markdownDescription": { "message": "The maximum number of cached processes to use for language service processing. The default of `null` uses twice the number of logical processors available.", "comment": [ "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." ] }, "c_cpp.configuration.maxMemory.markdownDescription": { "message": "The maximum memory (in MB) available for language service processing. Fewer processes will be cached and run concurrently after this memory usage is exceeded. The default of `null` uses the system's free memory.", "comment": [ "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." ] }, "c_cpp.configuration.intelliSense.maxCachedProcesses.markdownDescription": { "message": "The maximum number of IntelliSense processes to keep running. The default of `null` uses value inherited from `#C_Cpp.maxCachedProcesses#`", "comment": [ "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." ] }, @@ -36,15 +36,15 @@ "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": { "message": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.updateDelay.markdownDescription": { "message": "Controls the delay in milliseconds before code analysis starts processing after a save is triggered from an edit when `#files.autoSave#` is `afterDelay` and `#C_Cpp.runInBackground#` is `true`.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.exclude.markdownDescription": { "message": "Configure glob patterns for excluding folders and files for code analysis. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.excludeBoolean.description": "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.excludeBoolean.markdownDescription": { "message": "The glob pattern to match file paths against. Set to `true` or `false` to enable or disable the pattern.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.excludeWhen.markdownDescription": { "message": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.runInBackground.markdownDescription": { "message": "If `true`, code analysis will run automatically in the background.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription": { "message": "If `true`, code analysis will run automatically after a build is completed.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.enabled.markdownDescription": { "message": "If `true`, code analysis using `clang-tidy` will be enabled.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription": { "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.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription": { "message": "Path to the `compile_commands.json` compilation database for `clang-tidy`. If not specified, the build configuration from IntelliSense will be used.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, `clang-tidy` will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, `clang-tidy` will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", "comment": [ "Words 'key' and 'value' in '{key: value, ...}' should be translated, but all other 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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", "comment": [ "Words 'key' and 'value' in '{key: value, ...}' should be translated, but all other 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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fix.warnings.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied. No fixes are applied if errors occur unless `#C_Cpp.codeAnalysis.clangTidy.fix.errors#` is also set.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fix.errors.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings and errors are automatically applied.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fix.notes.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied, along with fixes found through an associated diagnostic note.", "comment": [ "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." ] }, From 374060eacf860d77a89a3e32f94b65f6175dc82b Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 23 Sep 2021 12:15:37 -0700 Subject: [PATCH 065/101] Fix typos. --- Extension/package.nls.json | 2 +- Extension/src/LanguageServer/settings.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/package.nls.json b/Extension/package.nls.json index c8bfbd79d1..4459b421ba 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -44,7 +44,7 @@ "c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription": { "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.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription": { "message": "Path to the `compile_commands.json` compilation database for `clang-tidy`. If not specified, the build configuration from IntelliSense will be used.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, `clang-tidy` will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", "comment": [ "Words 'key' and 'value' in '{key: value, ...}' should be translated, but all other 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." ] }, - "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format to be be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", "comment": [ "Words 'key' and 'value' in '{key: value, ...}' should be translated, but all other 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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format to be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", "comment": [ "Words 'key' and 'value' in '{key: value, ...}' should be translated, but all other 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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fix.warnings.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied. No fixes are applied if errors occur unless `#C_Cpp.codeAnalysis.clangTidy.fix.errors#` is also set.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fix.errors.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings and errors are automatically applied.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fix.notes.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied, along with fixes found through an associated diagnostic note.", "comment": [ "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." ] }, diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 6c8eed62fe..850018e51e 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -114,7 +114,7 @@ export class CppSettings extends Settings { if (!path) { return undefined; } else { - // Attempt to invoke both our own version of clang-* to see if we can successfully execute it, and to get it's version. + // Attempt to invoke both our own version of clang-* to see if we can successfully execute it, and to get its version. let clangVersion: string; try { const exePath: string = getExtensionFilePath(`./LLVM/bin/${clangName}`); From 05a918d48601815a1c5094122740e715c3265a50 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 23 Sep 2021 21:35:50 -0700 Subject: [PATCH 066/101] Pause fixes. --- Extension/src/LanguageServer/client.ts | 10 ++++++++++ Extension/src/LanguageServer/ui.ts | 25 +++++++++++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index b4879c9637..4d3655e5b8 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -577,6 +577,7 @@ class ClientModel { public isParsingFiles: DataBinding; public isUpdatingIntelliSense: DataBinding; public isRunningCodeAnalysis: DataBinding; + public isCodeAnalysisPaused: DataBinding; public codeAnalysisProcessed: DataBinding; public codeAnalysisTotal: DataBinding; public referencesCommandMode: DataBinding; @@ -590,6 +591,7 @@ class ClientModel { this.isParsingFiles = new DataBinding(false); this.isUpdatingIntelliSense = new DataBinding(false); this.isRunningCodeAnalysis = new DataBinding(false); + this.isCodeAnalysisPaused = new DataBinding(false); this.codeAnalysisProcessed = new DataBinding(0); this.codeAnalysisTotal = new DataBinding(0); this.referencesCommandMode = new DataBinding(refs.ReferencesCommandMode.None); @@ -604,6 +606,7 @@ class ClientModel { this.isParsingFiles.activate(); this.isUpdatingIntelliSense.activate(); this.isRunningCodeAnalysis.activate(); + this.isCodeAnalysisPaused.activate(); this.codeAnalysisProcessed.activate(); this.codeAnalysisTotal.activate(); this.referencesCommandMode.activate(); @@ -618,6 +621,7 @@ class ClientModel { this.isParsingFiles.deactivate(); this.isUpdatingIntelliSense.deactivate(); this.isRunningCodeAnalysis.deactivate(); + this.isCodeAnalysisPaused.deactivate(); this.codeAnalysisProcessed.deactivate(); this.codeAnalysisTotal.deactivate(); this.referencesCommandMode.deactivate(); @@ -632,6 +636,7 @@ class ClientModel { this.isParsingFiles.dispose(); this.isUpdatingIntelliSense.dispose(); this.isRunningCodeAnalysis.dispose(); + this.isCodeAnalysisPaused.dispose(); this.codeAnalysisProcessed.dispose(); this.codeAnalysisTotal.dispose(); this.referencesCommandMode.dispose(); @@ -647,6 +652,7 @@ export interface Client { ParsingFilesChanged: vscode.Event; IntelliSenseParsingChanged: vscode.Event; RunningCodeAnalysisChanged: vscode.Event; + CodeAnalysisPausedChanged: vscode.Event; CodeAnalysisProcessedChanged: vscode.Event; CodeAnalysisTotalChanged: vscode.Event; ReferencesCommandModeChanged: vscode.Event; @@ -767,6 +773,7 @@ export class DefaultClient implements Client { public get ParsingFilesChanged(): vscode.Event { return this.model.isParsingFiles.ValueChanged; } public get IntelliSenseParsingChanged(): vscode.Event { return this.model.isUpdatingIntelliSense.ValueChanged; } public get RunningCodeAnalysisChanged(): vscode.Event { return this.model.isRunningCodeAnalysis.ValueChanged; } + public get CodeAnalysisPausedChanged(): vscode.Event { return this.model.isCodeAnalysisPaused.ValueChanged; } public get CodeAnalysisProcessedChanged(): vscode.Event { return this.model.codeAnalysisProcessed.ValueChanged; } public get CodeAnalysisTotalChanged(): vscode.Event { return this.model.codeAnalysisTotal.ValueChanged; } public get ReferencesCommandModeChanged(): vscode.Event { return this.model.referencesCommandMode.ValueChanged; } @@ -2635,10 +2642,12 @@ export class DefaultClient implements Client { public PauseCodeAnalysis(): void { this.notifyWhenLanguageClientReady(() => this.languageClient.sendNotification(PauseCodeAnalysisNotification)); + this.model.isCodeAnalysisPaused.Value = true; } public ResumeCodeAnalysis(): void { this.notifyWhenLanguageClientReady(() => this.languageClient.sendNotification(ResumeCodeAnalysisNotification)); + this.model.isCodeAnalysisPaused.Value = false; } public CancelCodeAnalysis(): void { @@ -3160,6 +3169,7 @@ class NullClient implements Client { public get ParsingFilesChanged(): vscode.Event { return this.booleanEvent.event; } public get IntelliSenseParsingChanged(): vscode.Event { return this.booleanEvent.event; } public get RunningCodeAnalysisChanged(): vscode.Event { return this.booleanEvent.event; } + public get CodeAnalysisPausedChanged(): vscode.Event { return this.booleanEvent.event; } public get CodeAnalysisProcessedChanged(): vscode.Event { return this.numberEvent.event; } public get CodeAnalysisTotalChanged(): vscode.Event { return this.numberEvent.event; } public get ReferencesCommandModeChanged(): vscode.Event { return this.referencesCommandModeEvent.event; } diff --git a/Extension/src/LanguageServer/ui.ts b/Extension/src/LanguageServer/ui.ts index 21b77ec5a1..347340bf66 100644 --- a/Extension/src/LanguageServer/ui.ts +++ b/Extension/src/LanguageServer/ui.ts @@ -46,6 +46,7 @@ export class UI { private isParsingFiles: boolean = false; private isUpdatingIntelliSense: boolean = false; private isRunningCodeAnalysis: boolean = false; + private isCodeAnalysisPaused: boolean = false; private codeAnalysisProcessed: number = 0; private codeAnalysisTotal: number = 0; private workspaceParsingStatus: string = ""; @@ -55,6 +56,7 @@ export class UI { private readonly updatingIntelliSenseTooltip: string = localize("updating.intellisense.tooltip", "Updating IntelliSense"); private readonly codeAnalysisTranslationHint: string = "{0} is a program name, such as clang-tidy"; private runningCodeAnalysisTooltip: string = ""; + private codeAnalysisPausedTooltip: string = ""; constructor() { const configTooltip: string = localize("c.cpp.configuration.tooltip", "C/C++ Configuration"); @@ -87,6 +89,8 @@ export class UI { this.codeAnalysisProgram = "clang-tidy"; this.runningCodeAnalysisTooltip = localize( { key: "running.analysis.tooltip", comment: [this.codeAnalysisTranslationHint] }, "Running {0}", this.codeAnalysisProgram); + this.codeAnalysisPausedTooltip = localize( + { key: "code.analysis.paused.tooltip", comment: [this.codeAnalysisTranslationHint] }, "{0} paused", this.codeAnalysisProgram); } private set ActiveConfig(label: string) { @@ -109,7 +113,7 @@ export class UI { + (val ? this.workspaceParsingStatus : ""); } - private setIsParsingWorkspacePausable(val: boolean): void { + private setIsParsingWorkspacePausable(val: boolean): void { if (val) { this.browseEngineStatusBarItem.command = "C_Cpp.ShowParsingCommands"; } else { @@ -117,11 +121,19 @@ export class UI { } } - private setIsParsingWorkspacePaused(val: boolean): void { + private setIsParsingWorkspacePaused(val: boolean): void { this.isParsingWorkspacePaused = val; } - private setIsParsingFiles(val: boolean): void { + private setIsCodeAnalysisPaused(val: boolean): void { + this.isCodeAnalysisPaused = val; + const twoStatus: boolean = val && this.isUpdatingIntelliSense; + this.intelliSenseStatusBarItem.tooltip = (this.isUpdatingIntelliSense ? this.updatingIntelliSenseTooltip : "") + + (twoStatus ? " | " : "") + + (val ? this.codeAnalysisPausedTooltip : this.runningCodeAnalysisTooltip); + } + + private setIsParsingFiles(val: boolean): void { this.isParsingFiles = val; const showIcon: boolean = val || this.isParsingWorkspace; const twoStatus: boolean = val && this.isParsingWorkspace; @@ -132,7 +144,7 @@ export class UI { + (this.isParsingWorkspace ? this.workspaceParsingStatus : ""); } - private setIsUpdatingIntelliSense(val: boolean): void { + private setIsUpdatingIntelliSense(val: boolean): void { this.isUpdatingIntelliSense = val; const showIcon: boolean = val || this.isRunningCodeAnalysis; const twoStatus: boolean = val && this.isRunningCodeAnalysis; @@ -143,7 +155,7 @@ export class UI { + (this.isRunningCodeAnalysis ? this.runningCodeAnalysisTooltip : ""); } - private setIsRunningCodeAnalysis(val: boolean): void { + private setIsRunningCodeAnalysis(val: boolean): void { if (this.isRunningCodeAnalysis && !val) { this.codeAnalysisTotal = 0; this.codeAnalysisProcessed = 0; @@ -271,6 +283,7 @@ export class UI { client.ParsingFilesChanged(value => { this.setIsParsingFiles(value); }); client.IntelliSenseParsingChanged(value => { this.setIsUpdatingIntelliSense(value); }); client.RunningCodeAnalysisChanged(value => { this.setIsRunningCodeAnalysis(value); }); + client.CodeAnalysisPausedChanged(value => { this.setIsCodeAnalysisPaused(value); }); client.CodeAnalysisProcessedChanged(value => { this.setCodeAnalysisProcessed(value); }); client.CodeAnalysisTotalChanged(value => { this.setCodeAnalysisTotal(value); }); client.ReferencesCommandModeChanged(value => { this.ReferencesCommand = value; }); @@ -359,7 +372,7 @@ export class UI { const items: IndexableQuickPickItem[] = []; items.push({ label: localize({ key: "cancel.analysis", comment: [this.codeAnalysisTranslationHint]}, "Cancel {0}", this.codeAnalysisProgram), description: "", index: 0 }); - if (this.isParsingWorkspacePaused) { + if (this.isCodeAnalysisPaused) { items.push({ label: localize({ key: "resume.analysis", comment: [this.codeAnalysisTranslationHint]}, "Resume {0}", this.codeAnalysisProgram), description: "", index: 2 }); } else { items.push({ label: localize({ key: "pause.analysis", comment: [this.codeAnalysisTranslationHint]}, "Pause {0}", this.codeAnalysisProgram), description: "", index: 1 }); From cf64cdc9a1de810d775cb806bff54792df0af082 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 24 Sep 2021 18:47:35 -0700 Subject: [PATCH 067/101] Update exclude strings. --- Extension/package.nls.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/package.nls.json b/Extension/package.nls.json index a546d4d439..cf5d057609 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -36,7 +36,7 @@ "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for code analysis. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": { "message": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.updateDelay.markdownDescription": { "message": "Controls the delay in milliseconds before code analysis starts processing after a save is triggered from an edit when `#files.autoSave#` is `afterDelay` and `#C_Cpp.runInBackground#` is `true`.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.exclude.markdownDescription": { "message": "Configure glob patterns for excluding folders and files for code analysis. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.exclude.markdownDescription": { "message": "Configure glob patterns for excluding folders and files for code analysis. Inherits values from `#files.exclude#` and `#C_Cpp.files.exclude#`. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.excludeBoolean.markdownDescription": { "message": "The glob pattern to match file paths against. Set to `true` or `false` to enable or disable the pattern.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.excludeWhen.markdownDescription": { "message": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.runInBackground.markdownDescription": { "message": "If `true`, code analysis will run automatically in the background.", "comment": [ "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." ] }, @@ -204,7 +204,7 @@ "c_cpp.configuration.addNodeAddonIncludePaths.markdownDescription": { "message": "Add include paths from `nan` and `node-addon-api` when they are dependencies.", "comment": [ "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." ] }, "c_cpp.configuration.renameRequiresIdentifier.markdownDescription": { "message": "If `true`, 'Rename Symbol' will require a valid C/C++ identifier.", "comment": [ "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." ] }, "c_cpp.configuration.autocompleteAddParentheses.markdownDescription": { "message": "If `true`, autocomplete will automatically add `(` after function calls, in which case `)` may also be added, depending on the value of the `#editor.autoClosingBrackets#` setting.", "comment": [ "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." ] }, - "c_cpp.configuration.filesExclude.markdownDescription": { "message": "Configure glob patterns for excluding folders (and files if `#C_Cpp.exclusionPolicy#` is changed). These are specific to the C/C++ extension and are in addition to `#files.exclude#`, but unlike `#files.exclude#` they are not removed from the Explorer view. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "comment": [ "Markdown text between `` and [) should not be translated and the capitalization, spacing, and punctuation (including the ``) should not be altered: https://en.wikipedia.org/wiki/Markdown" ] }, + "c_cpp.configuration.filesExclude.markdownDescription": { "message": "Configure glob patterns for excluding folders (and files if `#C_Cpp.exclusionPolicy#` is changed). These are specific to the C/C++ extension and are in addition to `#files.exclude#`, but unlike `#files.exclude#` they also apply to paths outside the current workspace folder and are not removed from the Explorer view. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "comment": [ "Markdown text between `` and [) should not be translated and the capitalization, spacing, and punctuation (including the ``) should not be altered: https://en.wikipedia.org/wiki/Markdown" ] }, "c_cpp.configuration.filesExcludeBoolean.markdownDescription": { "message": "The glob pattern to match file paths against. Set to `true` or `false` to enable or disable the pattern.", "comment": [ "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." ] }, "c_cpp.configuration.filesExcludeWhen.markdownDescription": { "message": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", "comment": [ "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." ] }, "c_cpp.configuration.debugger.useBacktickCommandSubstitution.markdownDescription": { "message": "If `true`, debugger shell command substitution will use obsolete backtick (`).", "comment": [ "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." ] }, From 16f6ae298f686c9ebff2c877cd9778f4ff9847dd Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 27 Sep 2021 17:03:30 -0700 Subject: [PATCH 068/101] Add headerFilter. Fix enum value. --- Extension/package.json | 9 +++++++-- Extension/package.nls.json | 1 + Extension/src/LanguageServer/client.ts | 3 +++ Extension/src/LanguageServer/settings.ts | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 230a451f3e..4fb173d658 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -440,6 +440,11 @@ "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.fix.notes.markdownDescription%", "scope": "resource" }, + "C_Cpp.codeAnalysis.clangTidy.headerFilter": { + "type": "string", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.headerFilter.markdownDescription%", + "scope": "resource" + }, "C_Cpp.codeAnalysis.clangTidy.args": { "type": "string", "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription%", @@ -765,8 +770,8 @@ "darwin-*", "darwin-avoid-spinlock", "darwin-dispatch-once-nonstatic", - "fuschsia-*", - "fuschsia-default-*", + "fuchsia-*", + "fuchsia-default-*", "fuchsia-default-arguments-calls", "fuchsia-default-arguments-declarations", "fuchsia-header-anon-namespaces", diff --git a/Extension/package.nls.json b/Extension/package.nls.json index cf5d057609..670d6bab9a 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -49,6 +49,7 @@ "c_cpp.configuration.codeAnalysis.clangTidy.fix.warnings.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied. No fixes are applied if errors occur unless `#C_Cpp.codeAnalysis.clangTidy.fix.errors#` is also set.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fix.errors.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings and errors are automatically applied.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fix.notes.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied, along with fixes found through an associated diagnostic note.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.headerFilter.markdownDescription": { "message": "Regular expression matching the names of the headers to output diagnostics from. Diagnostics from the main file of each translation unit are always displayed. This option overrides the `HeaderFilterRegex` option in a `.clang-tidy` file, if any.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription": { "message": "Additional command line arguments to pass to `clang-tidy`. These take precedence over the equivalent `C_Cpp.codeAnalysis.clangTidy.*` settings.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.checks.enabled.markdownDescription": { "message": "List of enabled `clang-tidy` checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly disabled.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.checks.disabled.markdownDescription": { "message": "List of disabled `clang-tidy` checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any.", "comment": [ "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." ] }, diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 4d3655e5b8..74880d819e 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1070,6 +1070,7 @@ export class DefaultClient implements Client { const settings_clangTidyFixWarnings: (boolean | undefined)[] = []; const settings_clangTidyFixErrors: (boolean | undefined)[] = []; const settings_clangTidyFixNotes: (boolean | undefined)[] = []; + const settings_clangTidyHeaderFilter: (string | undefined)[] = []; const settings_clangTidyArgs: (string | undefined)[] = []; const settings_clangTidyChecksEnabled: (string[] | undefined)[] = []; const settings_clangTidyChecksDisabled: (string[] | undefined)[] = []; @@ -1180,6 +1181,7 @@ export class DefaultClient implements Client { settings_clangTidyFixWarnings.push(setting.clangTidyFixWarnings); settings_clangTidyFixErrors.push(setting.clangTidyFixErrors); settings_clangTidyFixNotes.push(setting.clangTidyFixNotes); + settings_clangTidyHeaderFilter.push(setting.clangTidyHeaderFilter); settings_clangTidyArgs.push(setting.clangTidyArgs); settings_clangTidyChecksEnabled.push(setting.clangTidyChecksEnabled); settings_clangTidyChecksDisabled.push(setting.clangTidyChecksDisabled); @@ -1321,6 +1323,7 @@ export class DefaultClient implements Client { errors: settings_clangTidyFixErrors, notes: settings_clangTidyFixNotes }, + headerFilter: settings_clangTidyHeaderFilter, args: settings_clangTidyArgs, checks: { enabled: settings_clangTidyChecksEnabled, diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 850018e51e..a4e19b6018 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -164,6 +164,7 @@ export class CppSettings extends Settings { public get clangTidyFixWarnings(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.warnings"); } public get clangTidyFixErrors(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.errors"); } public get clangTidyFixNotes(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.notes"); } + public get clangTidyHeaderFilter(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.headerFilter"); } public get clangTidyArgs(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.args"); } public get clangTidyChecksEnabled(): string[] | undefined { return super.Section.get("codeAnalysis.clangTidy.checks.enabled"); } public get clangTidyChecksDisabled(): string[] | undefined { return super.Section.get("codeAnalysis.clangTidy.checks.disabled"); } From 23703d77231d44b918bcaf9998f769429dda9219 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 27 Sep 2021 18:30:30 -0700 Subject: [PATCH 069/101] Fix enum. --- Extension/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 4fb173d658..25476320fd 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -1317,8 +1317,8 @@ "darwin-*", "darwin-avoid-spinlock", "darwin-dispatch-once-nonstatic", - "fuschsia-*", - "fuschsia-default-*", + "fuchsia-*", + "fuchsia-default-*", "fuchsia-default-arguments-calls", "fuchsia-default-arguments-declarations", "fuchsia-header-anon-namespaces", From 58f16295d4a239e8914904fd4c0cc30d87d103bc Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 29 Sep 2021 15:39:17 -0700 Subject: [PATCH 070/101] Filter out non-file uris. --- Extension/src/LanguageServer/client.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 74880d819e..7160037427 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -2230,6 +2230,9 @@ export class DefaultClient implements Client { false /* ignoreDeleteEvents */); this.rootPathFileWatcher.onDidCreate(async (uri) => { + if (uri.scheme !== 'file') { + return; + } const fileName: string = path.basename(uri.fsPath).toLowerCase(); if (fileName === ".editorconfig") { cachedEditorConfigSettings.clear(); @@ -2254,6 +2257,9 @@ export class DefaultClient implements Client { } } this.rootPathFileWatcher.onDidChange(async (uri) => { + if (uri.scheme !== 'file') { + return; + } const dotIndex: number = uri.fsPath.lastIndexOf('.'); const fileName: string = path.basename(uri.fsPath).toLowerCase(); if (fileName === ".editorconfig") { @@ -2277,6 +2283,9 @@ export class DefaultClient implements Client { }); this.rootPathFileWatcher.onDidDelete((uri) => { + if (uri.scheme !== 'file') { + return; + } const fileName: string = path.basename(uri.fsPath).toLowerCase(); if (fileName === ".editorconfig") { cachedEditorConfigSettings.clear(); From 45e005d81eeaf97ab64bfd1e4f92db90fc7a4963 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 1 Oct 2021 18:09:43 -0700 Subject: [PATCH 071/101] Add related info and target to diagnostics. --- Extension/src/LanguageServer/client.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 7160037427..ac0ac6f420 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -165,8 +165,21 @@ function publishDiagnostics(params: PublishDiagnosticsParams): void { const message: string = util.getLocalizedString(d.localizeStringParams); const r: vscode.Range = new vscode.Range(d.range.start.line, d.range.start.character, d.range.end.line, d.range.end.character); const diagnostic: vscode.Diagnostic = new vscode.Diagnostic(r, message, d.severity); - diagnostic.code = d.code; + if (typeof d.code === "string" && d.code.length !== 0 && d.code !== "clang-diagnostic-error") { + diagnostic.code = { value: d.code, + target: vscode.Uri.parse(`https://clang.llvm.org/extra/clang-tidy/checks/${d.code}.html`) }; + } else { + diagnostic.code = d.code; + } diagnostic.source = "C/C++"; + if (d.relatedInformation) { + diagnostic.relatedInformation = []; + for (const info of d.relatedInformation) { + const infoRange: vscode.Range = new vscode.Range(info.location.range.start.line, info.location.range.start.character, info.location.range.end.line, info.location.range.end.character); + diagnostic.relatedInformation.push(new vscode.DiagnosticRelatedInformation( + new vscode.Location(vscode.Uri.parse(info.location.uri), infoRange), info.message)); + } + } if (is_intelliSense) { diagnosticsIntelliSense.push(diagnostic); @@ -272,12 +285,18 @@ interface GetDiagnosticsResult { diagnostics: string; } +interface CppDiagnosticRelatedInformation { + location: Location; + message: string; +} + interface Diagnostic { range: Range; code?: number | string; source?: string; severity: vscode.DiagnosticSeverity; localizeStringParams: LocalizeStringParams; + relatedInformation?: CppDiagnosticRelatedInformation[]; } enum DiagnosticsType { From 107a86b347226e738d26c76bf4ba2728403a502f Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 4 Oct 2021 16:17:13 -0700 Subject: [PATCH 072/101] Add linter rule. --- Extension/.eslintrc.js | 1 + Extension/src/Debugger/configurations.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Extension/.eslintrc.js b/Extension/.eslintrc.js index 7ea41d4543..39c4b53c15 100644 --- a/Extension/.eslintrc.js +++ b/Extension/.eslintrc.js @@ -41,6 +41,7 @@ module.exports = { } } ], + "@typescript-eslint/no-for-in-array": "error", "@typescript-eslint/no-misused-new": "error", "@typescript-eslint/no-namespace": "error", "@typescript-eslint/no-non-null-assertion": "error", diff --git a/Extension/src/Debugger/configurations.ts b/Extension/src/Debugger/configurations.ts index 38fde7e595..7043ecacab 100644 --- a/Extension/src/Debugger/configurations.ts +++ b/Extension/src/Debugger/configurations.ts @@ -29,9 +29,9 @@ export function indentJsonString(json: string, numTabs: number = 1): string { } function formatString(format: string, args: string[]): string { - for (const arg in args) { - format = format.replace("{" + arg + "}", args[arg]); - } + args.forEach((arg: string, index: number) => { + format = format.replace("{" + index + "}", arg); + }); return format; } From b1f8cb50155bfc3ad41651e99b325f7a752e7ae0 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 4 Oct 2021 17:37:54 -0700 Subject: [PATCH 073/101] Fix clang-tidy settings checking. --- Extension/src/LanguageServer/settings.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index a4e19b6018..c86de9d28c 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -120,7 +120,13 @@ export class CppSettings extends Settings { const exePath: string = getExtensionFilePath(`./LLVM/bin/${clangName}`); const output: string[] = execSync(`${exePath} --version`).toString().split(" "); if (output.length < 3 || output[0] !== clangStr || output[1] !== "version" || !semver.valid(output[2])) { - return path; + if (output.length === 3) { + return path; + } + const versionIndex: number = output.findIndex((value: string) => value === "version"); + if (versionIndex < 0 || versionIndex + 1 >= output.length || !semver.valid(output[versionIndex + 1].trim())) { + return path; + } } clangVersion = output[2]; } catch (e) { From 1df4cf3e7389a2833e460d24cdbc8df4a6125fb9 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 6 Oct 2021 12:30:04 -0700 Subject: [PATCH 074/101] Update package hashes. --- Extension/package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index d8ca86bf06..593b42db26 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -4559,7 +4559,7 @@ "./LLVM/bin/clang-format", "./LLVM/bin/clang-tidy" ], - "integrity": "3F3E0C7219ABF9B4D17113B6DDE94A062365E38BABAE6E53721CC98444C8F4FA" + "integrity": "0B5F60E1D18B14FFF97EA436A080AC03D7A1B591A835E0F2B39C01C058375E36" }, { "description": "Clang tools (Linux / armhf)", @@ -4574,7 +4574,7 @@ "./LLVM/bin/clang-format", "./LLVM/bin/clang-tidy" ], - "integrity": "2A8F48B0B3CC8D516C177CF0A0FD671E688FB37A075151C4413D55FE0194A831" + "integrity": "80855487EE8E26E16F36A8E45A46366B6EA71AE7CFFB64022612019B014F0ED8" }, { "description": "Clang tools (Linux / aarch64)", @@ -4589,7 +4589,7 @@ "./LLVM/bin/clang-format", "./LLVM/bin/clang-tidy" ], - "integrity": "08EA62D201DA0744277969142AA376B9FCCE74BE7A86B65A71AE64D68D60496E" + "integrity": "2B5839C2E26DAE6DE9FF555FD096C517C5AEB003297F6DEFEE5290AB73CD0CE6" }, { "description": "Clang tools (macOS / x86_64)", @@ -4604,7 +4604,7 @@ "./LLVM/bin/clang-format", "./LLVM/bin/clang-tidy" ], - "integrity": "ADD73C4822497BDB03328FC50046A5B5C5A0D89E62835C0180EE7DC857801B10" + "integrity": "DD9A702A8104D385357D5A192F47E0D8EC516FC6239C8E210C429881F32A21DF" }, { "description": "Clang tools (macOS / ARM64)", @@ -4619,7 +4619,7 @@ "./LLVM/bin/clang-format", "./LLVM/bin/clang-tidy" ], - "integrity": "14DBEFB75DF25553939CFF56E5FC9F5E1520E81B716EA45C9E710C80F254CE34" + "integrity": "D5C827306C7AA94B3C2397E592199F1C68ADD4DB4BECF552B3C02CB280AC875B" }, { "description": "Clang tools (Windows x86)", @@ -4634,7 +4634,7 @@ "./LLVM/bin/clang-format.exe", "./LLVM/bin/clang-tidy.exe" ], - "integrity": "4600A5030CF419880D80F9C55A9346C21F6BA79CD8F540DB1576595DFE093492" + "integrity": "66BAAC412988FE1E40CE6F94BDE64BB7A2FB7C4E2493EBDBE6B4F994604A3FBD" }, { "description": "Clang tools (Windows x64)", @@ -4649,7 +4649,7 @@ "./LLVM/bin/clang-format.exe", "./LLVM/bin/clang-tidy.exe" ], - "integrity": "3BBC1ABAD14E7A6F2709708E1534DD1B912575682872614E780E2EC398F31B49" + "integrity": "702AF7F679CB943D3D80C2E68FC7B5708ACAA227E84417F835AE9C6A7468808E" }, { "description": "Clang tools (Windows arm64)", @@ -4664,7 +4664,7 @@ "./LLVM/bin/clang-format.exe", "./LLVM/bin/clang-tidy.exe" ], - "integrity": "67BDAC6D46A3F8C5F491D6BC9A461C1CF6179C57B1CA7F6643512A1338C44E17" + "integrity": "76032192FE82E8C51A4721E7C9660B3B5755BF75DAF47A71F844F561732A92F5" }, { "description": "OpenDebugAD7 (Windows x86/x64)", From 6c1d835bf291bbbef71d2b5b817c5e74bb15c209 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 6 Oct 2021 14:43:57 -0700 Subject: [PATCH 075/101] Change clangTidy.args to an array. --- Extension/package.json | 5 ++++- Extension/src/LanguageServer/settings.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 593b42db26..60f8de91c9 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -446,7 +446,10 @@ "scope": "resource" }, "C_Cpp.codeAnalysis.clangTidy.args": { - "type": "string", + "type": "array", + "items": { + "type": "string" + }, "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription%", "scope": "resource" }, diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 2bd5337959..63539c22a2 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -171,7 +171,7 @@ export class CppSettings extends Settings { public get clangTidyFixErrors(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.errors"); } public get clangTidyFixNotes(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.notes"); } public get clangTidyHeaderFilter(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.headerFilter"); } - public get clangTidyArgs(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.args"); } + public get clangTidyArgs(): string[] | undefined { return super.Section.get("codeAnalysis.clangTidy.args"); } public get clangTidyChecksEnabled(): string[] | undefined { return super.Section.get("codeAnalysis.clangTidy.checks.enabled"); } public get clangTidyChecksDisabled(): string[] | undefined { return super.Section.get("codeAnalysis.clangTidy.checks.disabled"); } public get clangFormatStyle(): string | undefined { return super.Section.get("clang_format_style"); } From d7a4eaf8cd29feab2cad4828d91d0921f0234abd Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 6 Oct 2021 15:24:08 -0700 Subject: [PATCH 076/101] Fix build error. --- Extension/src/LanguageServer/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index c322efd4d2..f625fdd15e 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1090,7 +1090,7 @@ export class DefaultClient implements Client { const settings_clangTidyFixErrors: (boolean | undefined)[] = []; const settings_clangTidyFixNotes: (boolean | undefined)[] = []; const settings_clangTidyHeaderFilter: (string | undefined)[] = []; - const settings_clangTidyArgs: (string | undefined)[] = []; + const settings_clangTidyArgs: (string[] | undefined)[] = []; const settings_clangTidyChecksEnabled: (string[] | undefined)[] = []; const settings_clangTidyChecksDisabled: (string[] | undefined)[] = []; const settings_filesEncoding: (string | undefined)[] = []; From 2a6f7b866260128b097464f462e51c0453018e50 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 8 Oct 2021 14:49:08 -0700 Subject: [PATCH 077/101] Add Clear Code Analysis Squiggles --- Extension/package.json | 5 +++++ Extension/package.nls.json | 3 ++- Extension/src/LanguageServer/client.ts | 11 ++++++++++- Extension/src/LanguageServer/extension.ts | 6 ++++++ Extension/src/commands.ts | 3 ++- Extension/src/main.ts | 1 + Extension/src/nativeStrings.json | 3 ++- 7 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 60f8de91c9..d736ad41d1 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -2743,6 +2743,11 @@ "command": "C_Cpp.RunCodeAnalysisOnAllFiles", "title": "%c_cpp.command.RunCodeAnalysisOnAllFiles.title%", "category": "C/C++" + }, + { + "command": "C_Cpp.ClearCodeAnalysisSquiggles", + "title": "%c_cpp.command.ClearCodeAnalysisSquiggles.title%", + "category": "C/C++" } ], "keybindings": [ diff --git a/Extension/package.nls.json b/Extension/package.nls.json index fee53d485a..8a4df76de6 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -25,6 +25,7 @@ "c_cpp.command.RunCodeAnalysisOnActiveFile.title": "Run Code Analysis on Active File", "c_cpp.command.RunCodeAnalysisOnOpenFiles.title": "Run Code Analysis on Open Files", "c_cpp.command.RunCodeAnalysisOnAllFiles.title": "Run Code Analysis on All Files", + "c_cpp.command.ClearCodeAnalysisSquiggles.title": "Clear Code Analysis Squiggles", "c_cpp.configuration.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may not always be used. The default of `null` uses the number of logical processors available.", "comment": [ "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." ] }, "c_cpp.configuration.maxCachedProcesses.markdownDescription": { "message": "The maximum number of cached processes to use for language service processing. The default of `null` uses twice the number of logical processors available.", "comment": [ "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." ] }, "c_cpp.configuration.maxMemory.markdownDescription": { "message": "The maximum memory (in MB) available for language service processing. Fewer processes will be cached and run concurrently after this memory usage is exceeded. The default of `null` uses the system's free memory.", "comment": [ "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." ] }, @@ -155,7 +156,7 @@ "c_cpp.configuration.autocomplete.markdownDescription": { "message": "Controls the auto-completion provider. If `Disabled` and you want word-based completion, you will also need to set `\"[cpp]\": {\"editor.wordBasedSuggestions\": true}` (and similarly for `c` and `cuda-cpp` languages).", "comment": [ "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." ] }, "c_cpp.configuration.autocomplete.default.description": "Uses the active IntelliSense engine.", "c_cpp.configuration.autocomplete.disabled.description": "Uses the word-based completion provided by Visual Studio Code.", - "c_cpp.configuration.errorSquiggles.description": "Controls whether suspected compile errors detected by the IntelliSense engine will be reported back to the editor. This setting is ignored by the Tag Parser engine.", + "c_cpp.configuration.errorSquiggles.description": "Controls whether suspected compile errors detected by the IntelliSense engine will be reported back to the editor. It also controls whether code analysis warnings are reported if includes can't be found. This setting is ignored by the Tag Parser engine.", "c_cpp.configuration.dimInactiveRegions.description": "Controls whether inactive preprocessor blocks are colored differently than active code. This setting has no effect if IntelliSense is disabled or if using the Default High Contrast theme.", "c_cpp.configuration.inactiveRegionOpacity.markdownDescription": { "message": "Controls the opacity of inactive preprocessor blocks. Scales between `0.1` and `1.0`. This setting only applies when inactive region dimming is enabled.", "comment": [ "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." ] }, "c_cpp.configuration.inactiveRegionForegroundColor.description": "Controls the font coloring of inactive preprocessor blocks. Input is in the form a hexadecimal color code or a valid Theme Color. If not set, this defaults to the syntax coloring scheme of the editor. This setting only applies when inactive region dimming is enabled.", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index f625fdd15e..1eba90fb38 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -501,7 +501,8 @@ interface SetTemporaryTextDocumentLanguageParams { enum CodeAnalysisScope { ActiveFile, OpenFiles, - AllFiles + AllFiles, + ClearSquiggles }; interface IntervalTimerParams { @@ -732,6 +733,7 @@ export interface Client { handleRunCodeAnalysisOnActiveFile(): Promise; handleRunCodeAnalysisOnOpenFiles(): Promise; handleRunCodeAnalysisOnAllFiles(): Promise; + handleClearCodeAnalysisSquiggles(): Promise; onInterval(): void; dispose(): void; addFileAssociations(fileAssociations: string, languageId: string): void; @@ -3106,6 +3108,12 @@ export class DefaultClient implements Client { this.languageClient.sendNotification(CodeAnalysisNotification, CodeAnalysisScope.AllFiles); } + public async handleClearCodeAnalysisSquiggles(): Promise { + await this.awaitUntilLanguageClientReady(); + diagnosticsCollectionCodeAnalysis.clear(); + this.languageClient.sendNotification(CodeAnalysisNotification, CodeAnalysisScope.ClearSquiggles); + } + public onInterval(): void { // These events can be discarded until the language client is ready. // Don't queue them up with this.notifyWhenLanguageClientReady calls. @@ -3294,6 +3302,7 @@ class NullClient implements Client { handleRunCodeAnalysisOnActiveFile(): Promise { return Promise.resolve(); } handleRunCodeAnalysisOnOpenFiles(): Promise { return Promise.resolve(); } handleRunCodeAnalysisOnAllFiles(): Promise { return Promise.resolve(); } + handleClearCodeAnalysisSquiggles(): Promise { return Promise.resolve(); } onInterval(): void { } dispose(): void { this.booleanEvent.dispose(); diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 7820a583cc..00e525b3fc 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -828,6 +828,7 @@ export function registerCommands(): void { disposables.push(vscode.commands.registerCommand('C_Cpp.RunCodeAnalysisOnActiveFile', onRunCodeAnalysisOnActiveFile)); disposables.push(vscode.commands.registerCommand('C_Cpp.RunCodeAnalysisOnOpenFiles', onRunCodeAnalysisOnOpenFiles)); disposables.push(vscode.commands.registerCommand('C_Cpp.RunCodeAnalysisOnAllFiles', onRunCodeAnalysisOnAllFiles)); + disposables.push(vscode.commands.registerCommand('C_Cpp.ClearCodeAnalysisSquiggles', onClearCodeAnalysisSquiggles)); disposables.push(vscode.commands.registerCommand('cpptools.activeConfigName', onGetActiveConfigName)); disposables.push(vscode.commands.registerCommand('cpptools.activeConfigCustomVariable', onGetActiveConfigCustomVariable)); disposables.push(vscode.commands.registerCommand('cpptools.setActiveConfigName', onSetActiveConfigName)); @@ -1017,6 +1018,11 @@ async function onRunCodeAnalysisOnAllFiles(): Promise { getActiveClient().handleRunCodeAnalysisOnAllFiles(); } +async function onClearCodeAnalysisSquiggles(): Promise { + onActivationEvent(); + getActiveClient().handleClearCodeAnalysisSquiggles(); +} + function onAddToIncludePath(path: string): void { if (!isFolderOpen()) { vscode.window.showInformationMessage(localize('add.includepath.open.first', 'Open a folder first to add to {0}', "includePath")); diff --git a/Extension/src/commands.ts b/Extension/src/commands.ts index 09ddd01da9..bfce15c5f9 100644 --- a/Extension/src/commands.ts +++ b/Extension/src/commands.ts @@ -39,7 +39,8 @@ class TemporaryCommandRegistrar { "C_Cpp.CheckForCompiler", "C_Cpp.RunCodeAnalysisOnActiveFile", "C_Cpp.RunCodeAnalysisOnOpenFiles", - "C_Cpp.RunCodeAnalysisOnAllFiles" + "C_Cpp.RunCodeAnalysisOnAllFiles", + "C_Cpp.ClearCodeAnalysisSquiggles" ]; constructor() { diff --git a/Extension/src/main.ts b/Extension/src/main.ts index f7fc944be4..093e3fb978 100644 --- a/Extension/src/main.ts +++ b/Extension/src/main.ts @@ -448,6 +448,7 @@ function rewriteManifest(): Promise { "onCommand:C_Cpp.RunCodeAnalysisOnActiveFile", "onCommand:C_Cpp.RunCodeAnalysisOnOpenFiles", "onCommand:C_Cpp.RunCodeAnalysisOnAllFiles", + "onCommand:C_Cpp.ClearCodeAnalysisSquiggles", "onDebugInitialConfigurations", "onDebugResolve:cppdbg", "onDebugResolve:cppvsdbg", diff --git a/Extension/src/nativeStrings.json b/Extension/src/nativeStrings.json index e8770d828e..d54fe87bb2 100644 --- a/Extension/src/nativeStrings.json +++ b/Extension/src/nativeStrings.json @@ -233,5 +233,6 @@ "text": "Inline macro", "hint": "'Inline' is a command and not an adjective, i.e. like 'Expand macro'." }, - "unable_to_access_browse_database": "Unable to access browse database. ({0})" + "unable_to_access_browse_database": "Unable to access browse database. ({0})", + "clear_code_analysis_squiggles": "Clear code analysis squiggles" } From 3896f40a75e5164d33d3e69f4505d6f56217708d Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 11 Oct 2021 11:04:57 -0700 Subject: [PATCH 078/101] Add to settings filtering. --- Extension/src/LanguageServer/settingsTracker.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/settingsTracker.ts b/Extension/src/LanguageServer/settingsTracker.ts index bb8b9c6b4e..1d7daa7eb1 100644 --- a/Extension/src/LanguageServer/settingsTracker.ts +++ b/Extension/src/LanguageServer/settingsTracker.ts @@ -177,7 +177,11 @@ export class SettingsTracker { break; } default: { - if (key === "clang_format_path" || key === "codeAnalysis.clangTidy.path" || key === "codeAnalysis.clangTidy.buildPath" || key === "intelliSenseCachePath" || key.startsWith("default.")) { + if (key === "clang_format_path" || key === "intelliSenseCachePath" || key.startsWith("default.") + || key === "codeAnalysis.clangTidy.path" || key === "codeAnalysis.clangTidy.buildPath" + || key === "codeAnalysis.clangTidy.headerFilter" || key === "codeAnalysis.clangTidy.args" + || key === "codeAnalysis.clangTidy.config" || key === "codeAnalysis.clangTidy.fallbackConfig" + ) { value = this.areEqual(val, settings.inspect(key)?.defaultValue) ? "" : "..."; // Track whether it's being used, but nothing specific about it. } else { value = String(this.previousCppSettings[key]); From eb164e0bd6a68ffe4a1ecf268d649393b7ec69b6 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 13 Oct 2021 16:39:52 -0700 Subject: [PATCH 079/101] Update buildPath description. --- Extension/package.nls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 8a4df76de6..43843ebd39 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -44,7 +44,7 @@ "c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription": { "message": "If `true`, code analysis will run automatically after a build is completed.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.enabled.markdownDescription": { "message": "If `true`, code analysis using `clang-tidy` will be enabled.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription": { "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.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription": { "message": "Path to the `compile_commands.json` compilation database for `clang-tidy`. If not specified, the build configuration from IntelliSense will be used.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription": { "message": "Path to a directory containing a `compile_commands.json` compilation database for `clang-tidy`. If not specified, the build configuration from IntelliSense will be used.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, `clang-tidy` will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", "comment": [ "Words 'key' and 'value' in '{key: value, ...}' should be translated, but all other 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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format to be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", "comment": [ "Words 'key' and 'value' in '{key: value, ...}' should be translated, but all other 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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fix.warnings.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied. No fixes are applied if errors occur unless `#C_Cpp.codeAnalysis.clangTidy.fix.errors#` is also set.", "comment": [ "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." ] }, From b1066042670641d37e5cf0ef0e50771f6f185f56 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 13 Oct 2021 16:56:28 -0700 Subject: [PATCH 080/101] Add (empty) to `null` string. --- Extension/package.nls.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 43843ebd39..a06027165b 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -26,16 +26,16 @@ "c_cpp.command.RunCodeAnalysisOnOpenFiles.title": "Run Code Analysis on Open Files", "c_cpp.command.RunCodeAnalysisOnAllFiles.title": "Run Code Analysis on All Files", "c_cpp.command.ClearCodeAnalysisSquiggles.title": "Clear Code Analysis Squiggles", - "c_cpp.configuration.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may not always be used. The default of `null` uses the number of logical processors available.", "comment": [ "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." ] }, - "c_cpp.configuration.maxCachedProcesses.markdownDescription": { "message": "The maximum number of cached processes to use for language service processing. The default of `null` uses twice the number of logical processors available.", "comment": [ "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." ] }, - "c_cpp.configuration.maxMemory.markdownDescription": { "message": "The maximum memory (in MB) available for language service processing. Fewer processes will be cached and run concurrently after this memory usage is exceeded. The default of `null` uses the system's free memory.", "comment": [ "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." ] }, - "c_cpp.configuration.intelliSense.maxCachedProcesses.markdownDescription": { "message": "The maximum number of IntelliSense processes to keep running. The default of `null` uses value inherited from `#C_Cpp.maxCachedProcesses#`", "comment": [ "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." ] }, - "c_cpp.configuration.intelliSense.maxMemory.markdownDescription": { "message": "Older IntelliSense processes will shut down before new processes are created after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, - "c_cpp.configuration.references.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "comment": [ "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." ] }, - "c_cpp.configuration.references.maxCachedProcesses.markdownDescription": { "message": "The maximum number of processes to keep in memory for 'Find All References' and 'Rename'. The default of `null` uses the value inherited from `#C_Cpp.maxCachedProcesses#`.", "comment": [ "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." ] }, - "c_cpp.configuration.references.maxMemory.markdownDescription": { "message": "Fewer 'Find All References' and 'Rename' processes will be cached and run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for code analysis. The default of `null` uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": { "message": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, + "c_cpp.configuration.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for language service processing. The value is a hint and may not always be used. The default of `null` (empty) uses the number of logical processors available.", "comment": [ "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." ] }, + "c_cpp.configuration.maxCachedProcesses.markdownDescription": { "message": "The maximum number of cached processes to use for language service processing. The default of `null` (empty) uses twice the number of logical processors available.", "comment": [ "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." ] }, + "c_cpp.configuration.maxMemory.markdownDescription": { "message": "The maximum memory (in MB) available for language service processing. Fewer processes will be cached and run concurrently after this memory usage is exceeded. The default of `null` (empty) uses the system's free memory.", "comment": [ "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." ] }, + "c_cpp.configuration.intelliSense.maxCachedProcesses.markdownDescription": { "message": "The maximum number of IntelliSense processes to keep running. The default of `null` (empty) uses value inherited from `#C_Cpp.maxCachedProcesses#`", "comment": [ "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." ] }, + "c_cpp.configuration.intelliSense.maxMemory.markdownDescription": { "message": "Older IntelliSense processes will shut down before new processes are created after this memory usage (in MB) is exceeded. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, + "c_cpp.configuration.references.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for 'Find All References' and 'Rename'. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "comment": [ "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." ] }, + "c_cpp.configuration.references.maxCachedProcesses.markdownDescription": { "message": "The maximum number of processes to keep in memory for 'Find All References' and 'Rename'. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxCachedProcesses#`.", "comment": [ "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." ] }, + "c_cpp.configuration.references.maxMemory.markdownDescription": { "message": "Fewer 'Find All References' and 'Rename' processes will be cached and run concurrently after this memory usage (in MB) is exceeded. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for code analysis. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": { "message": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.updateDelay.markdownDescription": { "message": "Controls the delay in milliseconds before code analysis starts processing after a save is triggered from an edit when `#files.autoSave#` is `afterDelay` and `#C_Cpp.runInBackground#` is `true`.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.exclude.markdownDescription": { "message": "Configure glob patterns for excluding folders and files for code analysis. Inherits values from `#files.exclude#` and `#C_Cpp.files.exclude#`. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.excludeBoolean.markdownDescription": { "message": "The glob pattern to match file paths against. Set to `true` or `false` to enable or disable the pattern.", "comment": [ "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." ] }, From e3da374d32fe859e3e0084ee043bbdf5c4505ff0 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 13 Oct 2021 19:55:56 -0700 Subject: [PATCH 081/101] Code review feedback. --- Extension/src/LanguageServer/client.ts | 59 +++++++++++++++----------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 1eba90fb38..395b3f9126 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -149,17 +149,42 @@ function showWarning(params: ShowWarningParams): void { } function publishDiagnostics(params: PublishDiagnosticsParams): void { - const is_intelliSense: boolean = params.diagnosticsType === DiagnosticsType.IntelliSense; - if (is_intelliSense) { - if (!diagnosticsCollectionIntelliSense) { - diagnosticsCollectionIntelliSense = vscode.languages.createDiagnosticCollection("C/C++"); + if (!diagnosticsCollectionIntelliSense) { + diagnosticsCollectionIntelliSense = vscode.languages.createDiagnosticCollection("C/C++"); + } + + // Convert from our Diagnostic objects to vscode Diagnostic objects + const diagnosticsIntelliSense: vscode.Diagnostic[] = []; + params.diagnostics.forEach((d) => { + const message: string = util.getLocalizedString(d.localizeStringParams); + const r: vscode.Range = new vscode.Range(d.range.start.line, d.range.start.character, d.range.end.line, d.range.end.character); + const diagnostic: vscode.Diagnostic = new vscode.Diagnostic(r, message, d.severity); + diagnostic.code = d.code; + diagnostic.source = "C/C++"; + if (d.relatedInformation) { + diagnostic.relatedInformation = []; + for (const info of d.relatedInformation) { + const infoRange: vscode.Range = new vscode.Range(info.location.range.start.line, info.location.range.start.character, info.location.range.end.line, info.location.range.end.character); + diagnostic.relatedInformation.push(new vscode.DiagnosticRelatedInformation( + new vscode.Location(vscode.Uri.parse(info.location.uri), infoRange), info.message)); + } } - } else if (!diagnosticsCollectionCodeAnalysis) { + + diagnosticsIntelliSense.push(diagnostic); + }); + + const realUri: vscode.Uri = vscode.Uri.parse(params.uri); + diagnosticsCollectionIntelliSense.set(realUri, diagnosticsIntelliSense); + + clientCollection.timeTelemetryCollector.setUpdateRangeTime(realUri); +} + +function publishCodeAnalysisDiagnostics(params: PublishDiagnosticsParams): void { + if (!diagnosticsCollectionCodeAnalysis) { diagnosticsCollectionCodeAnalysis = vscode.languages.createDiagnosticCollection("clang-tidy"); } // Convert from our Diagnostic objects to vscode Diagnostic objects - const diagnosticsIntelliSense: vscode.Diagnostic[] = []; const diagnosticsCodeAnalysis: vscode.Diagnostic[] = []; params.diagnostics.forEach((d) => { const message: string = util.getLocalizedString(d.localizeStringParams); @@ -181,21 +206,11 @@ function publishDiagnostics(params: PublishDiagnosticsParams): void { } } - if (is_intelliSense) { - diagnosticsIntelliSense.push(diagnostic); - } else { - diagnosticsCodeAnalysis.push(diagnostic); - } + diagnosticsCodeAnalysis.push(diagnostic); }); const realUri: vscode.Uri = vscode.Uri.parse(params.uri); - if (is_intelliSense) { - diagnosticsCollectionIntelliSense.set(realUri, diagnosticsIntelliSense); - } else { - diagnosticsCollectionCodeAnalysis.set(realUri, diagnosticsCodeAnalysis); - } - - clientCollection.timeTelemetryCollector.setUpdateRangeTime(realUri); + diagnosticsCollectionCodeAnalysis.set(realUri, diagnosticsCodeAnalysis); } interface WorkspaceFolderParams { @@ -299,15 +314,9 @@ interface Diagnostic { relatedInformation?: CppDiagnosticRelatedInformation[]; } -enum DiagnosticsType { - IntelliSense, - CodeAnalysis -} - interface PublishDiagnosticsParams { uri: string; diagnostics: Diagnostic[]; - diagnosticsType: DiagnosticsType; } interface GetCodeActionsRequestParams { @@ -574,6 +583,7 @@ const ReferencesNotification: NotificationType = new NotificationType('cpptools/reportReferencesProgress'); const RequestCustomConfig: NotificationType = new NotificationType('cpptools/requestCustomConfig'); const PublishDiagnosticsNotification: NotificationType = new NotificationType('cpptools/publishDiagnostics'); +const PublishCodeAnalysisDiagnosticsNotification: NotificationType = new NotificationType('cpptools/publishCodeAnalysisDiagnostics'); const ShowMessageWindowNotification: NotificationType = new NotificationType('cpptools/showMessageWindow'); const ShowWarningNotification: NotificationType = new NotificationType('cpptools/showWarning'); const ReportTextDocumentLanguage: NotificationType = new NotificationType('cpptools/reportTextDocumentLanguage'); @@ -2238,6 +2248,7 @@ export class DefaultClient implements Client { client.handleRequestCustomConfig(requestFile); }); this.languageClient.onNotification(PublishDiagnosticsNotification, publishDiagnostics); + this.languageClient.onNotification(PublishCodeAnalysisDiagnosticsNotification, publishCodeAnalysisDiagnostics); this.languageClient.onNotification(ShowMessageWindowNotification, showMessageWindow); this.languageClient.onNotification(ShowWarningNotification, showWarning); this.languageClient.onNotification(ReportTextDocumentLanguage, (e) => this.setTextDocumentLanguage(e)); From 55d76e85a935d7f2b9d3b8beff5f2235ef81d487 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 20 Oct 2021 12:46:14 -0700 Subject: [PATCH 082/101] Fix link. --- Extension/src/LanguageServer/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 395b3f9126..5fc617e644 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -190,7 +190,7 @@ function publishCodeAnalysisDiagnostics(params: PublishDiagnosticsParams): void const message: string = util.getLocalizedString(d.localizeStringParams); const r: vscode.Range = new vscode.Range(d.range.start.line, d.range.start.character, d.range.end.line, d.range.end.character); const diagnostic: vscode.Diagnostic = new vscode.Diagnostic(r, message, d.severity); - if (typeof d.code === "string" && d.code.length !== 0 && d.code !== "clang-diagnostic-error") { + if (typeof d.code === "string" && d.code.length !== 0 && !d.code.startsWith("clang-diagnostic-")) { diagnostic.code = { value: d.code, target: vscode.Uri.parse(`https://clang.llvm.org/extra/clang-tidy/checks/${d.code}.html`) }; } else { From ea30896e6912880a4df90c061f323e3348f3465f Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 20 Oct 2021 22:48:26 -0700 Subject: [PATCH 083/101] Remove buildPath. --- Extension/package.json | 5 ----- Extension/package.nls.json | 1 - Extension/src/LanguageServer/client.ts | 3 --- Extension/src/LanguageServer/settings.ts | 1 - Extension/src/LanguageServer/settingsTracker.ts | 2 +- 5 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index d736ad41d1..536ad02449 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -407,11 +407,6 @@ "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription%", "scope": "machine-overridable" }, - "C_Cpp.codeAnalysis.clangTidy.buildPath": { - "type": "string", - "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription%", - "scope": "machine-overridable" - }, "C_Cpp.codeAnalysis.clangTidy.config": { "type": "string", "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription%", diff --git a/Extension/package.nls.json b/Extension/package.nls.json index a06027165b..10e684d011 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -44,7 +44,6 @@ "c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription": { "message": "If `true`, code analysis will run automatically after a build is completed.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.enabled.markdownDescription": { "message": "If `true`, code analysis using `clang-tidy` will be enabled.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription": { "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.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.clangTidy.buildPath.markdownDescription": { "message": "Path to a directory containing a `compile_commands.json` compilation database for `clang-tidy`. If not specified, the build configuration from IntelliSense will be used.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, `clang-tidy` will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", "comment": [ "Words 'key' and 'value' in '{key: value, ...}' should be translated, but all other 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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format to be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", "comment": [ "Words 'key' and 'value' in '{key: value, ...}' should be translated, but all other 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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fix.warnings.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied. No fixes are applied if errors occur unless `#C_Cpp.codeAnalysis.clangTidy.fix.errors#` is also set.", "comment": [ "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." ] }, diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 5fc617e644..151fb2119a 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1095,7 +1095,6 @@ export class DefaultClient implements Client { const settings_codeAnalysisRunInBackground: (boolean | undefined)[] = []; const settings_clangTidyEnabled: (boolean | undefined)[] = []; const settings_clangTidyPath: (string | undefined)[] = []; - const settings_clangTidyBuildPath: (string | undefined)[] = []; const settings_clangTidyConfig: (string | undefined)[] = []; const settings_clangTidyFallbackConfig: (string | undefined)[] = []; const settings_clangTidyFixWarnings: (boolean | undefined)[] = []; @@ -1206,7 +1205,6 @@ export class DefaultClient implements Client { settings_codeAnalysisRunInBackground.push(setting.codeAnalysisRunInBackground); settings_clangTidyEnabled.push(setting.clangTidyEnabled); settings_clangTidyPath.push(util.resolveVariables(setting.clangTidyPath, this.AdditionalEnvironment)); - settings_clangTidyBuildPath.push(setting.clangTidyBuildPath); settings_clangTidyConfig.push(setting.clangTidyConfig); settings_clangTidyFallbackConfig.push(setting.clangTidyFallbackConfig); settings_clangTidyFixWarnings.push(setting.clangTidyFixWarnings); @@ -1346,7 +1344,6 @@ export class DefaultClient implements Client { clangTidy: { enabled: settings_clangTidyEnabled, path: settings_clangTidyPath, - buildPath: settings_clangTidyBuildPath, config: settings_clangTidyConfig, fallbackConfig: settings_clangTidyFallbackConfig, fix: { diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 63539c22a2..ce7077a36c 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -164,7 +164,6 @@ export class CppSettings extends Settings { public get codeAnalysisRunInBackground(): boolean | undefined { return super.Section.get("codeAnalysis.runInBackground"); } public get codeAnalysisRunOnBuild(): boolean | undefined { return super.Section.get("codeAnalysis.runOnBuild"); } public get clangTidyEnabled(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.enabled"); } - public get clangTidyBuildPath(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.buildPath"); } public get clangTidyConfig(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.config"); } public get clangTidyFallbackConfig(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.fallbackConfig"); } public get clangTidyFixWarnings(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.warnings"); } diff --git a/Extension/src/LanguageServer/settingsTracker.ts b/Extension/src/LanguageServer/settingsTracker.ts index 1d7daa7eb1..4e560e268d 100644 --- a/Extension/src/LanguageServer/settingsTracker.ts +++ b/Extension/src/LanguageServer/settingsTracker.ts @@ -178,7 +178,7 @@ export class SettingsTracker { } default: { if (key === "clang_format_path" || key === "intelliSenseCachePath" || key.startsWith("default.") - || key === "codeAnalysis.clangTidy.path" || key === "codeAnalysis.clangTidy.buildPath" + || key === "codeAnalysis.clangTidy.path" || || key === "codeAnalysis.clangTidy.headerFilter" || key === "codeAnalysis.clangTidy.args" || key === "codeAnalysis.clangTidy.config" || key === "codeAnalysis.clangTidy.fallbackConfig" ) { From 8faed1b176777e99a618a2e8689232234951b743 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 20 Oct 2021 22:54:46 -0700 Subject: [PATCH 084/101] Fix build error. --- Extension/src/LanguageServer/settingsTracker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/settingsTracker.ts b/Extension/src/LanguageServer/settingsTracker.ts index 4e560e268d..46048ee85f 100644 --- a/Extension/src/LanguageServer/settingsTracker.ts +++ b/Extension/src/LanguageServer/settingsTracker.ts @@ -178,7 +178,7 @@ export class SettingsTracker { } default: { if (key === "clang_format_path" || key === "intelliSenseCachePath" || key.startsWith("default.") - || key === "codeAnalysis.clangTidy.path" || + || key === "codeAnalysis.clangTidy.path" || key === "codeAnalysis.clangTidy.headerFilter" || key === "codeAnalysis.clangTidy.args" || key === "codeAnalysis.clangTidy.config" || key === "codeAnalysis.clangTidy.fallbackConfig" ) { From 08810ae71626419cbda7475ec90e51ffc722f70a Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 21 Oct 2021 13:41:36 -0700 Subject: [PATCH 085/101] Rename setting to runAutomatically. --- Extension/package.json | 4 ++-- Extension/package.nls.json | 4 ++-- Extension/src/LanguageServer/client.ts | 6 +++--- Extension/src/LanguageServer/settings.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 58acd27d9c..4bb9dded5c 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -384,9 +384,9 @@ }, "scope": "resource" }, - "C_Cpp.codeAnalysis.runInBackground": { + "C_Cpp.codeAnalysis.runAutomatically": { "type": "boolean", - "markdownDescription": "%c_cpp.configuration.codeAnalysis.runInBackground.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.runAutomatically.markdownDescription%", "default": true, "scope": "resource" }, diff --git a/Extension/package.nls.json b/Extension/package.nls.json index edc402cd4c..364a76225a 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -36,11 +36,11 @@ "c_cpp.configuration.references.maxMemory.markdownDescription": { "message": "Fewer 'Find All References' and 'Rename' processes will be cached and run concurrently after this memory usage (in MB) is exceeded. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for code analysis. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": { "message": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.updateDelay.markdownDescription": { "message": "Controls the delay in milliseconds before code analysis starts processing after a save is triggered from an edit when `#files.autoSave#` is `afterDelay` and `#C_Cpp.runInBackground#` is `true`.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.updateDelay.markdownDescription": { "message": "Controls the delay in milliseconds before code analysis starts processing after a save is triggered from an edit when `#files.autoSave#` is `afterDelay` and `#C_Cpp.runAutomatically#` is `true`.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.exclude.markdownDescription": { "message": "Configure glob patterns for excluding folders and files for code analysis. Inherits values from `#files.exclude#` and `#C_Cpp.files.exclude#`. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.excludeBoolean.markdownDescription": { "message": "The glob pattern to match file paths against. Set to `true` or `false` to enable or disable the pattern.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.excludeWhen.markdownDescription": { "message": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.runInBackground.markdownDescription": { "message": "If `true`, code analysis will run automatically in the background.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.runAutomatically.markdownDescription": { "message": "If `true`, code analysis will run automatically on a file after it is opened or saved.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription": { "message": "If `true`, code analysis will run automatically after a build is completed.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.enabled.markdownDescription": { "message": "If `true`, code analysis using `clang-tidy` will be enabled.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription": { "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.", "comment": [ "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." ] }, diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 151fb2119a..5966a6a7ad 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1092,7 +1092,7 @@ export class DefaultClient implements Client { const settings_clangFormatFallbackStyle: (string | undefined)[] = []; const settings_clangFormatSortIncludes: (string | undefined)[] = []; const settings_codeAnalysisExclude: (vscode.WorkspaceConfiguration | undefined)[] = []; - const settings_codeAnalysisRunInBackground: (boolean | undefined)[] = []; + const settings_codeAnalysisRunAutomatically: (boolean | undefined)[] = []; const settings_clangTidyEnabled: (boolean | undefined)[] = []; const settings_clangTidyPath: (string | undefined)[] = []; const settings_clangTidyConfig: (string | undefined)[] = []; @@ -1202,7 +1202,7 @@ export class DefaultClient implements Client { for (const setting of settings) { settings_clangFormatPath.push(util.resolveVariables(setting.clangFormatPath, this.AdditionalEnvironment)); settings_codeAnalysisExclude.push(setting.codeAnalysisExclude); - settings_codeAnalysisRunInBackground.push(setting.codeAnalysisRunInBackground); + settings_codeAnalysisRunAutomatically.push(setting.codeAnalysisRunAutomatically); settings_clangTidyEnabled.push(setting.clangTidyEnabled); settings_clangTidyPath.push(util.resolveVariables(setting.clangTidyPath, this.AdditionalEnvironment)); settings_clangTidyConfig.push(setting.clangTidyConfig); @@ -1340,7 +1340,7 @@ export class DefaultClient implements Client { maxMemory: workspaceSettings.codeAnalysisMaxMemory, updateDelay: workspaceSettings.codeAnalysisUpdateDelay, exclude: settings_codeAnalysisExclude, - runInBackground: settings_codeAnalysisRunInBackground, + runAutomatically: settings_codeAnalysisRunAutomatically, clangTidy: { enabled: settings_clangTidyEnabled, path: settings_clangTidyPath, diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 850df7cb2b..2a326bceff 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -173,7 +173,7 @@ export class CppSettings extends Settings { public get codeAnalysisMaxMemory(): number | undefined | null { return super.Section.get("codeAnalysis.maxMemory"); } public get codeAnalysisUpdateDelay(): number | undefined | null { return super.Section.get("codeAnalysis.updateDelay"); } public get codeAnalysisExclude(): vscode.WorkspaceConfiguration | undefined { return super.Section.get("codeAnalysis.exclude"); } - public get codeAnalysisRunInBackground(): boolean | undefined { return super.Section.get("codeAnalysis.runInBackground"); } + public get codeAnalysisRunAutomatically(): boolean | undefined { return super.Section.get("codeAnalysis.runAutomatically"); } public get codeAnalysisRunOnBuild(): boolean | undefined { return super.Section.get("codeAnalysis.runOnBuild"); } public get clangTidyEnabled(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.enabled"); } public get clangTidyConfig(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.config"); } From e891989ab40a045f10b9ac677bf73e539639d65a Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 21 Oct 2021 18:22:48 -0700 Subject: [PATCH 086/101] Update runAutomaticaly string. --- Extension/package.nls.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 364a76225a..dce3e39250 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -36,13 +36,13 @@ "c_cpp.configuration.references.maxMemory.markdownDescription": { "message": "Fewer 'Find All References' and 'Rename' processes will be cached and run concurrently after this memory usage (in MB) is exceeded. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for code analysis. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": { "message": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.updateDelay.markdownDescription": { "message": "Controls the delay in milliseconds before code analysis starts processing after a save is triggered from an edit when `#files.autoSave#` is `afterDelay` and `#C_Cpp.runAutomatically#` is `true`.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.updateDelay.markdownDescription": { "message": "Controls the delay in milliseconds before code analysis starts processing after a save is triggered from an edit when `#files.autoSave#` is `afterDelay` and `#C_Cpp.codeAnalysis.runAutomatically#` is `true`.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.exclude.markdownDescription": { "message": "Configure glob patterns for excluding folders and files for code analysis. Inherits values from `#files.exclude#` and `#C_Cpp.files.exclude#`. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.excludeBoolean.markdownDescription": { "message": "The glob pattern to match file paths against. Set to `true` or `false` to enable or disable the pattern.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.excludeWhen.markdownDescription": { "message": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.runAutomatically.markdownDescription": { "message": "If `true`, code analysis will run automatically on a file after it is opened or saved.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription": { "message": "If `true`, code analysis will run automatically after a build is completed.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.clangTidy.enabled.markdownDescription": { "message": "If `true`, code analysis using `clang-tidy` will be enabled.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.enabled.markdownDescription": { "message": "If `true`, code analysis using `clang-tidy` will be enabled and run automatically if `#C_Cpp.codeAnalysis.runAutomatically#` is `true` (the default).", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription": { "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.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, `clang-tidy` will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", "comment": [ "Words 'key' and 'value' in '{key: value, ...}' should be translated, but all other 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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format to be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", "comment": [ "Words 'key' and 'value' in '{key: value, ...}' should be translated, but all other 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." ] }, From 5ecf57bf2f9401d054490c0d367622c2198167d5 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 22 Oct 2021 11:17:07 -0700 Subject: [PATCH 087/101] Fix code analysis squiggles clearing with custom configs. --- Extension/src/LanguageServer/client.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 5966a6a7ad..be862b8878 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1804,6 +1804,7 @@ export class DefaultClient implements Client { } this.clearCustomConfigurations(); + diagnosticsCollectionCodeAnalysis.clear(); this.trackedDocuments.forEach(document => { this.provideCustomConfiguration(document.uri, undefined); }); From 3bbcb95af2204a630a37a86d265d85b2a09d3f82 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 22 Oct 2021 11:32:16 -0700 Subject: [PATCH 088/101] Prevent clear on undefined. --- Extension/src/LanguageServer/client.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index be862b8878..879d24cefd 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1804,7 +1804,9 @@ export class DefaultClient implements Client { } this.clearCustomConfigurations(); - diagnosticsCollectionCodeAnalysis.clear(); + if (diagnosticsCollectionCodeAnalysis) { + diagnosticsCollectionCodeAnalysis.clear(); + } this.trackedDocuments.forEach(document => { this.provideCustomConfiguration(document.uri, undefined); }); @@ -3119,7 +3121,9 @@ export class DefaultClient implements Client { public async handleClearCodeAnalysisSquiggles(): Promise { await this.awaitUntilLanguageClientReady(); - diagnosticsCollectionCodeAnalysis.clear(); + if (diagnosticsCollectionCodeAnalysis) { + diagnosticsCollectionCodeAnalysis.clear(); + } this.languageClient.sendNotification(CodeAnalysisNotification, CodeAnalysisScope.ClearSquiggles); } From 4832e39b04a498304b5f6d99113e254d84b3978d Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 22 Oct 2021 15:10:42 -0700 Subject: [PATCH 089/101] Fix default settings. --- Extension/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 4bb9dded5c..0c6b27a9b2 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -419,19 +419,19 @@ }, "C_Cpp.codeAnalysis.clangTidy.fix.warnings": { "type": "boolean", - "default": "false", + "default": false, "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.fix.warnings.markdownDescription%", "scope": "resource" }, "C_Cpp.codeAnalysis.clangTidy.fix.errors": { "type": "boolean", - "default": "false", + "default": false, "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.fix.errors.markdownDescription%", "scope": "resource" }, "C_Cpp.codeAnalysis.clangTidy.fix.notes": { "type": "boolean", - "default": "false", + "default": false, "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.fix.notes.markdownDescription%", "scope": "resource" }, From e2d5761e638c55551ee1fc2f1ad4a9a00194813b Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 25 Oct 2021 12:44:33 -0700 Subject: [PATCH 090/101] Prevent NAN% status. --- Extension/src/LanguageServer/ui.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/ui.ts b/Extension/src/LanguageServer/ui.ts index 347340bf66..cb1d85b7c5 100644 --- a/Extension/src/LanguageServer/ui.ts +++ b/Extension/src/LanguageServer/ui.ts @@ -173,7 +173,7 @@ export class UI { private updateCodeAnalysisTooltip(): void { this.runningCodeAnalysisTooltip = localize({ key: "running.analysis.processed.tooltip", comment: [this.codeAnalysisTranslationHint] }, "Running {0}: {1} / {2} ({3}%)", this.codeAnalysisProgram, - this.codeAnalysisProcessed, this.codeAnalysisTotal, Math.floor(this.codeAnalysisProcessed / this.codeAnalysisTotal)); + this.codeAnalysisProcessed, Math.max(this.codeAnalysisTotal, 1), Math.floor(this.codeAnalysisProcessed / Math.max(this.codeAnalysisTotal, 1))); } private setCodeAnalysisProcessed(processed: number): void { From e76f996f9e42338d4a63e969bcf13728bc0b53e6 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 28 Oct 2021 17:09:19 -0700 Subject: [PATCH 091/101] Fix status message. --- Extension/src/LanguageServer/ui.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Extension/src/LanguageServer/ui.ts b/Extension/src/LanguageServer/ui.ts index cb1d85b7c5..7a7cb37a5e 100644 --- a/Extension/src/LanguageServer/ui.ts +++ b/Extension/src/LanguageServer/ui.ts @@ -173,12 +173,13 @@ export class UI { private updateCodeAnalysisTooltip(): void { this.runningCodeAnalysisTooltip = localize({ key: "running.analysis.processed.tooltip", comment: [this.codeAnalysisTranslationHint] }, "Running {0}: {1} / {2} ({3}%)", this.codeAnalysisProgram, - this.codeAnalysisProcessed, Math.max(this.codeAnalysisTotal, 1), Math.floor(this.codeAnalysisProcessed / Math.max(this.codeAnalysisTotal, 1))); + this.codeAnalysisProcessed, Math.max(this.codeAnalysisTotal, 1), Math.floor(100 * this.codeAnalysisProcessed / Math.max(this.codeAnalysisTotal, 1))); + this.setIsRunningCodeAnalysis(true); } private setCodeAnalysisProcessed(processed: number): void { this.codeAnalysisProcessed = processed; - if (this.codeAnalysisProcessed >= this.codeAnalysisTotal) { + if (this.codeAnalysisProcessed > this.codeAnalysisTotal) { this.codeAnalysisTotal = this.codeAnalysisProcessed + 1; } this.updateCodeAnalysisTooltip(); From 1c8132e8918e95e13177dfc3474797a2a60aca7c Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 29 Oct 2021 18:29:21 -0700 Subject: [PATCH 092/101] Fix clang-tidy doc link and enums. --- Extension/package.json | 142 +++++++++---------------- Extension/src/LanguageServer/client.ts | 3 +- 2 files changed, 52 insertions(+), 93 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 0c6b27a9b2..a88829b68c 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -479,9 +479,11 @@ "abseil-time-subtraction", "abseil-upgrade-duration-conversions", "altera-*", + "altera-id-dependent-backward-branch", "altera-kernel-name-restriction", "altera-single-work-item-barrier", "altera-struct-pack-align", + "altera-unroll-loops", "android-*", "android-cloexec-*", "android-cloexec-accept", @@ -511,10 +513,12 @@ "bugprone-copy-constructor-init", "bugprone-dangling-handle", "bugprone-dynamic-static-initializers", + "bugprone-easily-swappable-parameters", "bugprone-exception-escape", "bugprone-fold-init-type", "bugprone-forward-declaration-namespace", "bugprone-forwarding-reference-overload", + "bugprone-implicit-widening-of-multiplication-result", "bugprone-inaccurate-erase", "bugprone-incorrect-roundings", "bugprone-infinite-loop", @@ -558,6 +562,8 @@ "bugprone-too-small-loop-variable", "bugprone-undefined-memory-manipulation", "bugprone-undelegated-constructor", + "bugprone-unhandled-*", + "bugprone-unhandled-exception-at-new", "bugprone-unhandled-self-assignment", "bugprone-unused-raii", "bugprone-unused-return-value", @@ -602,75 +608,50 @@ "cert-sig30-c", "cert-str34-c", "clang-analyzer-*", - "clang-analyzer-apiModeling.*", - "clang-analyzer-apiModeling.StdCLibraryFunctions", - "clang-analyzer-apiModeling.TrustNonnull", - "clang-analyzer-apiModeling.google.GTest", - "clang-analyzer-apiModeling.llvm.*", - "clang-analyzer-apiModeling.llvm.CastValue", - "clang-analyzer-apiModeling.llvm.ReturnValue", "clang-analyzer-core.*", "clang-analyzer-core.CallAndMessage", - "clang-analyzer-core.CallAndMessageModeling", "clang-analyzer-core.DivideZero", "clang-analyzer-core.DynamicTypePropagation", "clang-analyzer-core.NonNullParamChecker", - "clang-analyzer-core.NonnilStringConstants", "clang-analyzer-core.NullDereference", - "clang-analyzer-core.StackAddrEscapeBase", "clang-analyzer-core.StackAddressEscape", "clang-analyzer-core.UndefinedBinaryOperatorResult", - "clang-analyzer-core.VLASize", - "clang-analyzer-core.builtin.*", - "clang-analyzer-core.builtin.BuiltinFunctions", - "clang-analyzer-core.builtin.NoReturnFunctions", "clang-analyzer-core.uninitialized.*", "clang-analyzer-core.uninitialized.ArraySubscript", "clang-analyzer-core.uninitialized.Assign", "clang-analyzer-core.uninitialized.Branch", "clang-analyzer-core.uninitialized.CapturedBlockVariable", "clang-analyzer-core.uninitialized.UndefReturn", + "clang-analyzer-core.VLASize", "clang-analyzer-cplusplus.*", "clang-analyzer-cplusplus.InnerPointer", "clang-analyzer-cplusplus.Move", "clang-analyzer-cplusplus.NewDelete", "clang-analyzer-cplusplus.NewDeleteLeaks", - "clang-analyzer-cplusplus.PlacementNew", - "clang-analyzer-cplusplus.PureVirtualCall", - "clang-analyzer-cplusplus.SelfAssignment", - "clang-analyzer-cplusplus.SmartPtrModeling", - "clang-analyzer-cplusplus.VirtualCallModeling", "clang-analyzer-deadcode.DeadStores", - "clang-analyzer-fuchsia.HandleChecker", "clang-analyzer-nullablity.*", - "clang-analyzer-nullability.NullPassedToNonnull", - "clang-analyzer-nullability.NullReturnedFromNonnull", "clang-analyzer-nullability.NullabilityBase", "clang-analyzer-nullability.NullableDereferenced", "clang-analyzer-nullability.NullablePassedToNonnull", "clang-analyzer-nullability.NullableReturnedFromNonnull", + "clang-analyzer-nullability.NullPassedToNonnull", + "clang-analyzer-nullability.NullReturnedFromNonnull", "clang-analyzer-optin.*", "clang-analyzer-optin.cplusplus.*", "clang-analyzer-optin.cplusplus.UninitializedObject", "clang-analyzer-optin.cplusplus.VirtualCall", "clang-analyzer-optin.mpi.MPI-Checker", "clang-analyzer-optin.osx.*", - "clang-analyzer-optin.osx.OSObjectCStyleCast", "clang-analyzer-optin.osx.cocoa.localizability.*", "clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker", "clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker", + "clang-analyzer-optin.osx.OSObjectCStyleCast", "clang-analyzer-optin.performance.*", "clang-analyzer-optin.performance.GCDAntipattern", "clang-analyzer-optin.performance.Padding", "clang-analyzer-optin.portability.UnixAPI", "clang-analyzer-osx.*", "clang-analyzer-osx.API", - "clang-analyzer-osx.MIG", - "clang-analyzer-osx.NSOrCFErrorDerefChecker", - "clang-analyzer-osx.NumberObjectConversion", - "clang-analyzer-osx.OSObjectRetainCount", - "clang-analyzer-osx.ObjCProperty", - "clang-analyzer-osx.SecKeychainAPI", "clang-analyzer-osx.cocoa.*", "clang-analyzer-osx.cocoa.AtSync", "clang-analyzer-osx.cocoa.AutoreleaseWrite", @@ -679,10 +660,10 @@ "clang-analyzer-osx.cocoa.IncompatibleMethodTypes", "clang-analyzer-osx.cocoa.Loops", "clang-analyzer-osx.cocoa.MissingSuperCall", - "clang-analyzer-osx.cocoa.NSAutoreleasePool", - "clang-analyzer-osx.cocoa.NSError", "clang-analyzer-osx.cocoa.NilArg", "clang-analyzer-osx.cocoa.NonNilReturnValue", + "clang-analyzer-osx.cocoa.NSAutoreleasePool", + "clang-analyzer-osx.cocoa.NSError", "clang-analyzer-osx.cocoa.ObjCGenerics", "clang-analyzer-osx.cocoa.RetainCount", "clang-analyzer-osx.cocoa.RetainCountBase", @@ -698,44 +679,42 @@ "clang-analyzer-osx.coreFoundation.containers.*", "clang-analyzer-osx.coreFoundation.containers.OutOfBounds", "clang-analyzer-osx.coreFoundation.containers.PointerSizedValues", + "clang-analyzer-osx.MIG", + "clang-analyzer-osx.NumberObjectConversion", + "clang-analyzer-osx.ObjCProperty", + "clang-analyzer-osx.OSObjectRetainCount", + "clang-analyzer-osx.SecKeychainAPI", "clang-analyzer-security.*", "clang-analyzer-security.FloatLoopCounter", "clang-analyzer-security.insecureAPI.*", - "clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling", - "clang-analyzer-security.insecureAPI.SecuritySyntaxChecker", - "clang-analyzer-security.insecureAPI.UncheckedReturn", "clang-analyzer-security.insecureAPI.bcmp", "clang-analyzer-security.insecureAPI.bcopy", "clang-analyzer-security.insecureAPI.bzero", - "clang-analyzer-security.insecureAPI.decodeValueOfObjCType", + "clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling", "clang-analyzer-security.insecureAPI.getpw", "clang-analyzer-security.insecureAPI.gets", "clang-analyzer-security.insecureAPI.mkstemp", "clang-analyzer-security.insecureAPI.mktemp", "clang-analyzer-security.insecureAPI.rand", "clang-analyzer-security.insecureAPI.strcpy", + "clang-analyzer-security.insecureAPI.UncheckedReturn", "clang-analyzer-security.insecureAPI.vfork", "clang-analyzer-unix.*", "clang-analyzer-unix.API", - "clang-analyzer-unix.DynamicMemoryModeling", + "clang-analyzer-unix.cstring.*", + "clang-analyzer-unix.cstring.BadSizeArg", + "clang-analyzer-unix.cstring.NullArg", "clang-analyzer-unix.Malloc", "clang-analyzer-unix.MallocSizeof", "clang-analyzer-unix.MismatchedDeallocator", "clang-analyzer-unix.Vfork", - "clang-analyzer-unix.cstring.*", - "clang-analyzer-unix.cstring.BadSizeArg", - "clang-analyzer-unix.cstring.CStringModeling", - "clang-analyzer-unix.cstring.NullArg", "clang-analyzer-valist.*", "clang-analyzer-valist.CopyToSelf", "clang-analyzer-valist.Uninitialized", "clang-analyzer-valist.Unterminated", - "clang-analyzer-valist.ValistBase", - "clang-analyzer-webkit.*", - "clang-analyzer-webkit.NoUncountedMemberChecker", - "clang-analyzer-webkit.RefCntblBaseVirtualDtor", - "clang-analyzer-webkit.UncountedLambdaCapturesChecker", + "concurrency-*", "concurrency-mt-unsafe", + "concurrency-thread-canceltype-asynchronous", "cppcoreguidelines-*", "cppcoreguidelines-avoid-*", "cppcoreguidelines-avoid-c-arrays", @@ -751,6 +730,7 @@ "cppcoreguidelines-no-malloc", "cppcoreguidelines-non-private-member-variables-in-classes", "cppcoreguidelines-owning-memory", + "cppcoreguidelines-prefer-member-initializer", "cppcoreguidelines-pro-bounds-*", "cppcoreguidelines-pro-bounds-array-to-pointer-decay", "cppcoreguidelines-pro-bounds-constant-array-index", @@ -952,7 +932,6 @@ "readability-container-size-empty", "readability-convert-member-functions-to-static", "readability-delete-null-pointer", - "readability-deleted-default", "readability-else-after-return", "readability-function-*", "readability-function-cognitive-complexity", @@ -1026,9 +1005,11 @@ "abseil-time-subtraction", "abseil-upgrade-duration-conversions", "altera-*", + "altera-id-dependent-backward-branch", "altera-kernel-name-restriction", "altera-single-work-item-barrier", "altera-struct-pack-align", + "altera-unroll-loops", "android-*", "android-cloexec-*", "android-cloexec-accept", @@ -1058,10 +1039,12 @@ "bugprone-copy-constructor-init", "bugprone-dangling-handle", "bugprone-dynamic-static-initializers", + "bugprone-easily-swappable-parameters", "bugprone-exception-escape", "bugprone-fold-init-type", "bugprone-forward-declaration-namespace", "bugprone-forwarding-reference-overload", + "bugprone-implicit-widening-of-multiplication-result", "bugprone-inaccurate-erase", "bugprone-incorrect-roundings", "bugprone-infinite-loop", @@ -1105,6 +1088,8 @@ "bugprone-too-small-loop-variable", "bugprone-undefined-memory-manipulation", "bugprone-undelegated-constructor", + "bugprone-unhandled-*", + "bugprone-unhandled-exception-at-new", "bugprone-unhandled-self-assignment", "bugprone-unused-raii", "bugprone-unused-return-value", @@ -1149,75 +1134,50 @@ "cert-sig30-c", "cert-str34-c", "clang-analyzer-*", - "clang-analyzer-apiModeling.*", - "clang-analyzer-apiModeling.StdCLibraryFunctions", - "clang-analyzer-apiModeling.TrustNonnull", - "clang-analyzer-apiModeling.google.GTest", - "clang-analyzer-apiModeling.llvm.*", - "clang-analyzer-apiModeling.llvm.CastValue", - "clang-analyzer-apiModeling.llvm.ReturnValue", "clang-analyzer-core.*", "clang-analyzer-core.CallAndMessage", - "clang-analyzer-core.CallAndMessageModeling", "clang-analyzer-core.DivideZero", "clang-analyzer-core.DynamicTypePropagation", "clang-analyzer-core.NonNullParamChecker", - "clang-analyzer-core.NonnilStringConstants", "clang-analyzer-core.NullDereference", - "clang-analyzer-core.StackAddrEscapeBase", "clang-analyzer-core.StackAddressEscape", "clang-analyzer-core.UndefinedBinaryOperatorResult", - "clang-analyzer-core.VLASize", - "clang-analyzer-core.builtin.*", - "clang-analyzer-core.builtin.BuiltinFunctions", - "clang-analyzer-core.builtin.NoReturnFunctions", "clang-analyzer-core.uninitialized.*", "clang-analyzer-core.uninitialized.ArraySubscript", "clang-analyzer-core.uninitialized.Assign", "clang-analyzer-core.uninitialized.Branch", "clang-analyzer-core.uninitialized.CapturedBlockVariable", "clang-analyzer-core.uninitialized.UndefReturn", + "clang-analyzer-core.VLASize", "clang-analyzer-cplusplus.*", "clang-analyzer-cplusplus.InnerPointer", "clang-analyzer-cplusplus.Move", "clang-analyzer-cplusplus.NewDelete", "clang-analyzer-cplusplus.NewDeleteLeaks", - "clang-analyzer-cplusplus.PlacementNew", - "clang-analyzer-cplusplus.PureVirtualCall", - "clang-analyzer-cplusplus.SelfAssignment", - "clang-analyzer-cplusplus.SmartPtrModeling", - "clang-analyzer-cplusplus.VirtualCallModeling", "clang-analyzer-deadcode.DeadStores", - "clang-analyzer-fuchsia.HandleChecker", "clang-analyzer-nullablity.*", - "clang-analyzer-nullability.NullPassedToNonnull", - "clang-analyzer-nullability.NullReturnedFromNonnull", "clang-analyzer-nullability.NullabilityBase", "clang-analyzer-nullability.NullableDereferenced", "clang-analyzer-nullability.NullablePassedToNonnull", "clang-analyzer-nullability.NullableReturnedFromNonnull", + "clang-analyzer-nullability.NullPassedToNonnull", + "clang-analyzer-nullability.NullReturnedFromNonnull", "clang-analyzer-optin.*", "clang-analyzer-optin.cplusplus.*", "clang-analyzer-optin.cplusplus.UninitializedObject", "clang-analyzer-optin.cplusplus.VirtualCall", "clang-analyzer-optin.mpi.MPI-Checker", "clang-analyzer-optin.osx.*", - "clang-analyzer-optin.osx.OSObjectCStyleCast", "clang-analyzer-optin.osx.cocoa.localizability.*", "clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker", "clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker", + "clang-analyzer-optin.osx.OSObjectCStyleCast", "clang-analyzer-optin.performance.*", "clang-analyzer-optin.performance.GCDAntipattern", "clang-analyzer-optin.performance.Padding", "clang-analyzer-optin.portability.UnixAPI", "clang-analyzer-osx.*", "clang-analyzer-osx.API", - "clang-analyzer-osx.MIG", - "clang-analyzer-osx.NSOrCFErrorDerefChecker", - "clang-analyzer-osx.NumberObjectConversion", - "clang-analyzer-osx.OSObjectRetainCount", - "clang-analyzer-osx.ObjCProperty", - "clang-analyzer-osx.SecKeychainAPI", "clang-analyzer-osx.cocoa.*", "clang-analyzer-osx.cocoa.AtSync", "clang-analyzer-osx.cocoa.AutoreleaseWrite", @@ -1226,10 +1186,10 @@ "clang-analyzer-osx.cocoa.IncompatibleMethodTypes", "clang-analyzer-osx.cocoa.Loops", "clang-analyzer-osx.cocoa.MissingSuperCall", - "clang-analyzer-osx.cocoa.NSAutoreleasePool", - "clang-analyzer-osx.cocoa.NSError", "clang-analyzer-osx.cocoa.NilArg", "clang-analyzer-osx.cocoa.NonNilReturnValue", + "clang-analyzer-osx.cocoa.NSAutoreleasePool", + "clang-analyzer-osx.cocoa.NSError", "clang-analyzer-osx.cocoa.ObjCGenerics", "clang-analyzer-osx.cocoa.RetainCount", "clang-analyzer-osx.cocoa.RetainCountBase", @@ -1245,44 +1205,42 @@ "clang-analyzer-osx.coreFoundation.containers.*", "clang-analyzer-osx.coreFoundation.containers.OutOfBounds", "clang-analyzer-osx.coreFoundation.containers.PointerSizedValues", + "clang-analyzer-osx.MIG", + "clang-analyzer-osx.NumberObjectConversion", + "clang-analyzer-osx.ObjCProperty", + "clang-analyzer-osx.OSObjectRetainCount", + "clang-analyzer-osx.SecKeychainAPI", "clang-analyzer-security.*", "clang-analyzer-security.FloatLoopCounter", "clang-analyzer-security.insecureAPI.*", - "clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling", - "clang-analyzer-security.insecureAPI.SecuritySyntaxChecker", - "clang-analyzer-security.insecureAPI.UncheckedReturn", "clang-analyzer-security.insecureAPI.bcmp", "clang-analyzer-security.insecureAPI.bcopy", "clang-analyzer-security.insecureAPI.bzero", - "clang-analyzer-security.insecureAPI.decodeValueOfObjCType", + "clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling", "clang-analyzer-security.insecureAPI.getpw", "clang-analyzer-security.insecureAPI.gets", "clang-analyzer-security.insecureAPI.mkstemp", "clang-analyzer-security.insecureAPI.mktemp", "clang-analyzer-security.insecureAPI.rand", "clang-analyzer-security.insecureAPI.strcpy", + "clang-analyzer-security.insecureAPI.UncheckedReturn", "clang-analyzer-security.insecureAPI.vfork", "clang-analyzer-unix.*", "clang-analyzer-unix.API", - "clang-analyzer-unix.DynamicMemoryModeling", + "clang-analyzer-unix.cstring.*", + "clang-analyzer-unix.cstring.BadSizeArg", + "clang-analyzer-unix.cstring.NullArg", "clang-analyzer-unix.Malloc", "clang-analyzer-unix.MallocSizeof", "clang-analyzer-unix.MismatchedDeallocator", "clang-analyzer-unix.Vfork", - "clang-analyzer-unix.cstring.*", - "clang-analyzer-unix.cstring.BadSizeArg", - "clang-analyzer-unix.cstring.CStringModeling", - "clang-analyzer-unix.cstring.NullArg", "clang-analyzer-valist.*", "clang-analyzer-valist.CopyToSelf", "clang-analyzer-valist.Uninitialized", "clang-analyzer-valist.Unterminated", - "clang-analyzer-valist.ValistBase", - "clang-analyzer-webkit.*", - "clang-analyzer-webkit.NoUncountedMemberChecker", - "clang-analyzer-webkit.RefCntblBaseVirtualDtor", - "clang-analyzer-webkit.UncountedLambdaCapturesChecker", + "concurrency-*", "concurrency-mt-unsafe", + "concurrency-thread-canceltype-asynchronous", "cppcoreguidelines-*", "cppcoreguidelines-avoid-*", "cppcoreguidelines-avoid-c-arrays", @@ -1298,6 +1256,7 @@ "cppcoreguidelines-no-malloc", "cppcoreguidelines-non-private-member-variables-in-classes", "cppcoreguidelines-owning-memory", + "cppcoreguidelines-prefer-member-initializer", "cppcoreguidelines-pro-bounds-*", "cppcoreguidelines-pro-bounds-array-to-pointer-decay", "cppcoreguidelines-pro-bounds-constant-array-index", @@ -1499,7 +1458,6 @@ "readability-container-size-empty", "readability-convert-member-functions-to-static", "readability-delete-null-pointer", - "readability-deleted-default", "readability-else-after-return", "readability-function-*", "readability-function-cognitive-complexity", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 879d24cefd..f244fb35fa 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -191,8 +191,9 @@ function publishCodeAnalysisDiagnostics(params: PublishDiagnosticsParams): void const r: vscode.Range = new vscode.Range(d.range.start.line, d.range.start.character, d.range.end.line, d.range.end.character); const diagnostic: vscode.Diagnostic = new vscode.Diagnostic(r, message, d.severity); if (typeof d.code === "string" && d.code.length !== 0 && !d.code.startsWith("clang-diagnostic-")) { + const codes: string[] = d.code.split(','); diagnostic.code = { value: d.code, - target: vscode.Uri.parse(`https://clang.llvm.org/extra/clang-tidy/checks/${d.code}.html`) }; + target: vscode.Uri.parse(`https://releases.llvm.org/13.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/${codes[0]}.html`) }; } else { diagnostic.code = d.code; } From 573c400b1f697429915e36d35326bf2520f05570 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 3 Nov 2021 10:28:06 -0700 Subject: [PATCH 093/101] Prevent willSaveWaitUntil from being delayed too long. --- Extension/src/LanguageServer/protocolFilter.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/protocolFilter.ts b/Extension/src/LanguageServer/protocolFilter.ts index 687733e61d..1aeb3ab59a 100644 --- a/Extension/src/LanguageServer/protocolFilter.ts +++ b/Extension/src/LanguageServer/protocolFilter.ts @@ -86,7 +86,9 @@ export function createProtocolFilter(clients: ClientCollection): Middleware { willSaveWaitUntil: (event, sendMessage) => { const me: Client = clients.getClientFor(event.document.uri); if (me.TrackedDocuments.has(event.document)) { - return me.requestWhenReady(() => sendMessage(event)); + // Don't use me.requestWhenReady or notifyWhenLanguageClientReady; + // otherwise, the message can be delayed too long. + sendMessage(event); } return Promise.resolve([]); }, From 55dda4cb3a8b7b8d3607e862639b6106075359d6 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 3 Nov 2021 12:43:49 -0700 Subject: [PATCH 094/101] Fix diagnostic links for the > 1 case. --- Extension/src/LanguageServer/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index f244fb35fa..19c53cd50a 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -193,7 +193,7 @@ function publishCodeAnalysisDiagnostics(params: PublishDiagnosticsParams): void if (typeof d.code === "string" && d.code.length !== 0 && !d.code.startsWith("clang-diagnostic-")) { const codes: string[] = d.code.split(','); diagnostic.code = { value: d.code, - target: vscode.Uri.parse(`https://releases.llvm.org/13.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/${codes[0]}.html`) }; + target: vscode.Uri.parse(`https://releases.llvm.org/13.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/${codes[codes.length - 1]}.html`) }; } else { diagnostic.code = d.code; } From c9666fa634298ed5197e20b82fd42fcc32f8141d Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 4 Nov 2021 13:36:02 -0700 Subject: [PATCH 095/101] Fix save failing. --- Extension/src/LanguageServer/protocolFilter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/protocolFilter.ts b/Extension/src/LanguageServer/protocolFilter.ts index 1aeb3ab59a..9093d45464 100644 --- a/Extension/src/LanguageServer/protocolFilter.ts +++ b/Extension/src/LanguageServer/protocolFilter.ts @@ -88,7 +88,7 @@ export function createProtocolFilter(clients: ClientCollection): Middleware { if (me.TrackedDocuments.has(event.document)) { // Don't use me.requestWhenReady or notifyWhenLanguageClientReady; // otherwise, the message can be delayed too long. - sendMessage(event); + return sendMessage(event); } return Promise.resolve([]); }, From 1c33f8c9a57385221e6eaa277e2120e46eba17d6 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 4 Nov 2021 18:27:41 -0700 Subject: [PATCH 096/101] Fix link alias. --- Extension/src/LanguageServer/client.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 19c53cd50a..d88ffadd40 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -192,8 +192,12 @@ function publishCodeAnalysisDiagnostics(params: PublishDiagnosticsParams): void const diagnostic: vscode.Diagnostic = new vscode.Diagnostic(r, message, d.severity); if (typeof d.code === "string" && d.code.length !== 0 && !d.code.startsWith("clang-diagnostic-")) { const codes: string[] = d.code.split(','); + let codeIndex: number = codes.length - 1; + if (codes[codeIndex] === "cert-dcl51-cpp") { // Handle aliasing + codeIndex = 0; + } diagnostic.code = { value: d.code, - target: vscode.Uri.parse(`https://releases.llvm.org/13.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/${codes[codes.length - 1]}.html`) }; + target: vscode.Uri.parse(`https://releases.llvm.org/13.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/${codes[codeIndex]}.html`) }; } else { diagnostic.code = d.code; } From 22ef54fcc29dff8c036f75f0413c15dc84ef1e62 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Fri, 5 Nov 2021 00:58:42 -0700 Subject: [PATCH 097/101] Fix bug with status bar not beng updated. --- Extension/src/LanguageServer/client.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index d88ffadd40..9d337d655c 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -2455,6 +2455,8 @@ export class DefaultClient implements Client { this.model.isParsingFiles.Value = false; } else if (message.endsWith("Analysis")) { this.model.isRunningCodeAnalysis.Value = true; + this.model.codeAnalysisTotal.Value = 1; + this.model.codeAnalysisProcessed.Value = 0; } else if (message.endsWith("Analysis done")) { this.model.isRunningCodeAnalysis.Value = false; } else if (message.includes("Squiggles Finished - File name:")) { From a62aa3a85383552ae3ed1de8561eccbedf4b15d7 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 8 Nov 2021 16:36:01 -0800 Subject: [PATCH 098/101] Fix headerFilter with .clang-tidy files. --- Extension/package.json | 6 +++++- Extension/package.nls.json | 2 +- Extension/src/LanguageServer/client.ts | 2 +- Extension/src/LanguageServer/settings.ts | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index e1c6a77f6c..389bba02bc 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -436,7 +436,11 @@ "scope": "resource" }, "C_Cpp.codeAnalysis.clangTidy.headerFilter": { - "type": "string", + "type": [ + "string", + "null" + ], + "default": null, "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.headerFilter.markdownDescription%", "scope": "resource" }, diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 714b5d9f0e..cc5b1dd411 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -49,7 +49,7 @@ "c_cpp.configuration.codeAnalysis.clangTidy.fix.warnings.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied. No fixes are applied if errors occur unless `#C_Cpp.codeAnalysis.clangTidy.fix.errors#` is also set.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fix.errors.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings and errors are automatically applied.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fix.notes.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied, along with fixes found through an associated diagnostic note.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.clangTidy.headerFilter.markdownDescription": { "message": "Regular expression matching the names of the headers to output diagnostics from. Diagnostics from the main file of each translation unit are always displayed. This option overrides the `HeaderFilterRegex` option in a `.clang-tidy` file, if any.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.headerFilter.markdownDescription": { "message": "Regular expression matching the names of the headers to output diagnostics from. Diagnostics from the main file of each translation unit are always displayed. If this option is not `null` (empty), it overrides the `HeaderFilterRegex` option in a `.clang-tidy` file, if any.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription": { "message": "Additional command line arguments to pass to `clang-tidy`. These take precedence over the equivalent `C_Cpp.codeAnalysis.clangTidy.*` settings.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.checks.enabled.markdownDescription": { "message": "List of enabled `clang-tidy` checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly disabled.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.checks.disabled.markdownDescription": { "message": "List of disabled `clang-tidy` checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any.", "comment": [ "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." ] }, diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 9d337d655c..6903719093 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1105,7 +1105,7 @@ export class DefaultClient implements Client { const settings_clangTidyFixWarnings: (boolean | undefined)[] = []; const settings_clangTidyFixErrors: (boolean | undefined)[] = []; const settings_clangTidyFixNotes: (boolean | undefined)[] = []; - const settings_clangTidyHeaderFilter: (string | undefined)[] = []; + const settings_clangTidyHeaderFilter: (string | undefined | null)[] = []; const settings_clangTidyArgs: (string[] | undefined)[] = []; const settings_clangTidyChecksEnabled: (string[] | undefined)[] = []; const settings_clangTidyChecksDisabled: (string[] | undefined)[] = []; diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 2a326bceff..5ee82e8010 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -181,7 +181,7 @@ export class CppSettings extends Settings { public get clangTidyFixWarnings(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.warnings"); } public get clangTidyFixErrors(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.errors"); } public get clangTidyFixNotes(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.notes"); } - public get clangTidyHeaderFilter(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.headerFilter"); } + public get clangTidyHeaderFilter(): string | undefined | null { return super.Section.get("codeAnalysis.clangTidy.headerFilter"); } public get clangTidyArgs(): string[] | undefined { return super.Section.get("codeAnalysis.clangTidy.args"); } public get clangTidyChecksEnabled(): string[] | undefined { return super.Section.get("codeAnalysis.clangTidy.checks.enabled"); } public get clangTidyChecksDisabled(): string[] | undefined { return super.Section.get("codeAnalysis.clangTidy.checks.disabled"); } From 9d6425e71bebc4cdf796d7973e7ee360fdd418ef Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 9 Nov 2021 10:33:27 -0800 Subject: [PATCH 099/101] Add to headerFilter description. --- Extension/package.nls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/package.nls.json b/Extension/package.nls.json index cc5b1dd411..32ece8b5d6 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -49,7 +49,7 @@ "c_cpp.configuration.codeAnalysis.clangTidy.fix.warnings.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied. No fixes are applied if errors occur unless `#C_Cpp.codeAnalysis.clangTidy.fix.errors#` is also set.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fix.errors.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings and errors are automatically applied.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fix.notes.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied, along with fixes found through an associated diagnostic note.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.clangTidy.headerFilter.markdownDescription": { "message": "Regular expression matching the names of the headers to output diagnostics from. Diagnostics from the main file of each translation unit are always displayed. If this option is not `null` (empty), it overrides the `HeaderFilterRegex` option in a `.clang-tidy` file, if any.", "comment": [ "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." ] }, + "c_cpp.configuration.codeAnalysis.clangTidy.headerFilter.markdownDescription": { "message": "Regular expression matching the names of the headers to output diagnostics from. Diagnostics from the main file of each translation unit are always displayed. The `${workspaceFolder}` variable is supported. If this option is not `null` (empty), it overrides the `HeaderFilterRegex` option in a `.clang-tidy` file, if any.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription": { "message": "Additional command line arguments to pass to `clang-tidy`. These take precedence over the equivalent `C_Cpp.codeAnalysis.clangTidy.*` settings.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.checks.enabled.markdownDescription": { "message": "List of enabled `clang-tidy` checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly disabled.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.checks.disabled.markdownDescription": { "message": "List of disabled `clang-tidy` checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any.", "comment": [ "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." ] }, From 181f49b2e631894ac19dd6daa3bd9c25a1e942d0 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 9 Nov 2021 16:37:16 -0800 Subject: [PATCH 100/101] Remove post-poned settings. --- Extension/package.json | 24 ------------------------ Extension/package.nls.json | 4 ---- Extension/src/LanguageServer/settings.ts | 8 ++++---- 3 files changed, 4 insertions(+), 32 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 389bba02bc..a38200898f 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -390,12 +390,6 @@ "default": true, "scope": "resource" }, - "C_Cpp.codeAnalysis.runOnBuild": { - "type": "boolean", - "markdownDescription": "%c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription%", - "default": false, - "scope": "resource" - }, "C_Cpp.codeAnalysis.clangTidy.enabled": { "type": "boolean", "default": false, @@ -417,24 +411,6 @@ "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription%", "scope": "resource" }, - "C_Cpp.codeAnalysis.clangTidy.fix.warnings": { - "type": "boolean", - "default": false, - "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.fix.warnings.markdownDescription%", - "scope": "resource" - }, - "C_Cpp.codeAnalysis.clangTidy.fix.errors": { - "type": "boolean", - "default": false, - "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.fix.errors.markdownDescription%", - "scope": "resource" - }, - "C_Cpp.codeAnalysis.clangTidy.fix.notes": { - "type": "boolean", - "default": false, - "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.fix.notes.markdownDescription%", - "scope": "resource" - }, "C_Cpp.codeAnalysis.clangTidy.headerFilter": { "type": [ "string", diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 32ece8b5d6..a246f5663a 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -41,14 +41,10 @@ "c_cpp.configuration.codeAnalysis.excludeBoolean.markdownDescription": { "message": "The glob pattern to match file paths against. Set to `true` or `false` to enable or disable the pattern.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.excludeWhen.markdownDescription": { "message": "Additional check on the siblings of a matching file. Use `$(basename)` as variable for the matching file name.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.runAutomatically.markdownDescription": { "message": "If `true`, code analysis will run automatically on a file after it is opened or saved.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.runOnBuild.markdownDescription": { "message": "If `true`, code analysis will run automatically after a build is completed.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.enabled.markdownDescription": { "message": "If `true`, code analysis using `clang-tidy` will be enabled and run automatically if `#C_Cpp.codeAnalysis.runAutomatically#` is `true` (the default).", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.path.markdownDescription": { "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.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.config.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`. When the value is empty, `clang-tidy` will attempt to find a file named `.clang-tidy` for each source file in its parent directories.", "comment": [ "Words 'key' and 'value' in '{key: value, ...}' should be translated, but all other 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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.fallbackConfig.markdownDescription": { "message": "Specifies a `clang-tidy` configuration in YAML/JSON format to be used as a fallback when `#C_Cpp.codeAnalysis.clangTidy.config#` is not set and no `.clang-tidy` file is found: `{Checks: '-*,clang-analyzer-*', CheckOptions: [{key: x, value: y}]}`.", "comment": [ "Words 'key' and 'value' in '{key: value, ...}' should be translated, but all other 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." ] }, - "c_cpp.configuration.codeAnalysis.clangTidy.fix.warnings.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied. No fixes are applied if errors occur unless `#C_Cpp.codeAnalysis.clangTidy.fix.errors#` is also set.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.clangTidy.fix.errors.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings and errors are automatically applied.", "comment": [ "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." ] }, - "c_cpp.configuration.codeAnalysis.clangTidy.fix.notes.markdownDescription": { "message": "If `true`, `clang-tidy` fixes for warnings are automatically applied, along with fixes found through an associated diagnostic note.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.headerFilter.markdownDescription": { "message": "Regular expression matching the names of the headers to output diagnostics from. Diagnostics from the main file of each translation unit are always displayed. The `${workspaceFolder}` variable is supported. If this option is not `null` (empty), it overrides the `HeaderFilterRegex` option in a `.clang-tidy` file, if any.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription": { "message": "Additional command line arguments to pass to `clang-tidy`. These take precedence over the equivalent `C_Cpp.codeAnalysis.clangTidy.*` settings.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.clangTidy.checks.enabled.markdownDescription": { "message": "List of enabled `clang-tidy` checks. The values are appended to the `Checks` in a `.clang-tidy` file or `#C_Cpp.codeAnalysis.clangTidy.config#`, if any. The default check `clang-analyzer-*` is always used unless it is explicitly disabled.", "comment": [ "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." ] }, diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 5ee82e8010..ec3f5eb6b1 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -174,13 +174,13 @@ export class CppSettings extends Settings { public get codeAnalysisUpdateDelay(): number | undefined | null { return super.Section.get("codeAnalysis.updateDelay"); } public get codeAnalysisExclude(): vscode.WorkspaceConfiguration | undefined { return super.Section.get("codeAnalysis.exclude"); } public get codeAnalysisRunAutomatically(): boolean | undefined { return super.Section.get("codeAnalysis.runAutomatically"); } - public get codeAnalysisRunOnBuild(): boolean | undefined { return super.Section.get("codeAnalysis.runOnBuild"); } + public get codeAnalysisRunOnBuild(): boolean | undefined { return false; } // super.Section.get("codeAnalysis.runOnBuild"); } public get clangTidyEnabled(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.enabled"); } public get clangTidyConfig(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.config"); } public get clangTidyFallbackConfig(): string | undefined { return super.Section.get("codeAnalysis.clangTidy.fallbackConfig"); } - public get clangTidyFixWarnings(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.warnings"); } - public get clangTidyFixErrors(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.errors"); } - public get clangTidyFixNotes(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.fix.notes"); } + public get clangTidyFixWarnings(): boolean | undefined { return false; } // super.Section.get("codeAnalysis.clangTidy.fix.warnings"); } + public get clangTidyFixErrors(): boolean | undefined { return false; } // super.Section.get("codeAnalysis.clangTidy.fix.errors"); } + public get clangTidyFixNotes(): boolean | undefined { return false; } // super.Section.get("codeAnalysis.clangTidy.fix.notes"); } public get clangTidyHeaderFilter(): string | undefined | null { return super.Section.get("codeAnalysis.clangTidy.headerFilter"); } public get clangTidyArgs(): string[] | undefined { return super.Section.get("codeAnalysis.clangTidy.args"); } public get clangTidyChecksEnabled(): string[] | undefined { return super.Section.get("codeAnalysis.clangTidy.checks.enabled"); } From 6eb6c55a165301a28df786d0decd2f5bb81472f7 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 15 Nov 2021 13:24:33 -0800 Subject: [PATCH 101/101] Change references.maxCachedProcesses default to 0. --- Extension/package.json | 2 +- Extension/package.nls.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index a38200898f..9672884275 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -313,7 +313,7 @@ "null" ], "markdownDescription": "%c_cpp.configuration.references.maxCachedProcesses.markdownDescription%", - "default": null, + "default": 0, "minimum": 0, "maximum": 32, "scope": "machine" diff --git a/Extension/package.nls.json b/Extension/package.nls.json index a246f5663a..f248e8e1ae 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -32,7 +32,7 @@ "c_cpp.configuration.intelliSense.maxCachedProcesses.markdownDescription": { "message": "The maximum number of IntelliSense processes to keep running. The default of `null` (empty) uses value inherited from `#C_Cpp.maxCachedProcesses#`", "comment": [ "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." ] }, "c_cpp.configuration.intelliSense.maxMemory.markdownDescription": { "message": "Older IntelliSense processes will shut down before new processes are created after this memory usage (in MB) is exceeded. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, "c_cpp.configuration.references.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for 'Find All References' and 'Rename'. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "comment": [ "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." ] }, - "c_cpp.configuration.references.maxCachedProcesses.markdownDescription": { "message": "The maximum number of processes to keep in memory for 'Find All References' and 'Rename'. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxCachedProcesses#`.", "comment": [ "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." ] }, + "c_cpp.configuration.references.maxCachedProcesses.markdownDescription": { "message": "The maximum number of processes to keep in memory for 'Find All References' and 'Rename'. The value of `null` (empty) uses the value inherited from `#C_Cpp.maxCachedProcesses#`.", "comment": [ "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." ] }, "c_cpp.configuration.references.maxMemory.markdownDescription": { "message": "Fewer 'Find All References' and 'Rename' processes will be cached and run concurrently after this memory usage (in MB) is exceeded. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.maxConcurrentThreads.markdownDescription": { "message": "The maximum number of concurrent threads to use for code analysis. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxConcurrentThreads#`.", "comment": [ "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." ] }, "c_cpp.configuration.codeAnalysis.maxMemory.markdownDescription": { "message": "Fewer code analysis processes will run concurrently after this memory usage (in MB) is exceeded. The default of `null` (empty) uses the value inherited from `#C_Cpp.maxMemory#`.", "comment": [ "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." ] },