From 1985e3c925c69e56e08adf1c4b8e39e85bc64d88 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 16 Mar 2022 18:23:49 -0700 Subject: [PATCH 1/3] Add useDashP setting. --- Extension/package.json | 8 +++++++- Extension/package.nls.json | 1 + Extension/src/LanguageServer/client.ts | 3 +++ Extension/src/LanguageServer/settings.ts | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Extension/package.json b/Extension/package.json index 8514d360c3..31d96884ea 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -2,7 +2,7 @@ "name": "cpptools", "displayName": "C/C++", "description": "C/C++ IntelliSense, debugging, and code browsing.", - "version": "1.9.4-main", + "version": "1.10.0-main", "publisher": "ms-vscode", "icon": "LanguageCCPP_color_128x.png", "readme": "README.md", @@ -461,6 +461,12 @@ "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription%", "scope": "resource" }, + "C_Cpp.codeAnalysis.clangTidy.useDashP": { + "type": "boolean", + "default": false, + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.useDashP.markdownDescription%", + "scope": "resource" + }, "C_Cpp.codeAnalysis.clangTidy.checks.enabled": { "type": "array", "items": { diff --git a/Extension/package.nls.json b/Extension/package.nls.json index bf8ba3f096..619a6d9818 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -48,6 +48,7 @@ "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.headerFilter.markdownDescription": { "message": "A POSIX extended regular expression (ERE) 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 (and is used as the default fallback value if no `.clang-tidy` file exists). 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.useDashP.markdownDescription": { "message": "If `true`, the `-p=` argument is sent to `clang-tidy` directly instead of individual arguments being sent directly after being filtered by IntelliSense. This may not work if environment variables aren't set so that system includes can be found.", "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.", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 367dde96e3..91f23f0b87 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1101,6 +1101,7 @@ export class DefaultClient implements Client { const settings_clangTidyFixNotes: (boolean | undefined)[] = []; const settings_clangTidyHeaderFilter: (string | undefined | null)[] = []; const settings_clangTidyArgs: (string[] | undefined)[] = []; + const settings_clangTidyUseDashP: (boolean | undefined)[] = []; const settings_clangTidyChecksEnabled: (string[] | undefined)[] = []; const settings_clangTidyChecksDisabled: (string[] | undefined)[] = []; const settings_filesEncoding: (string | undefined)[] = []; @@ -1211,6 +1212,7 @@ export class DefaultClient implements Client { settings_clangTidyFixNotes.push(setting.clangTidyFixNotes); settings_clangTidyHeaderFilter.push(setting.clangTidyHeaderFilter); settings_clangTidyArgs.push(setting.clangTidyArgs); + settings_clangTidyUseDashP.push(setting.clangTidyUseDashP); settings_clangTidyChecksEnabled.push(setting.clangTidyChecksEnabled); settings_clangTidyChecksDisabled.push(setting.clangTidyChecksDisabled); settings_indentBraces.push(setting.vcFormatIndentBraces); @@ -1352,6 +1354,7 @@ export class DefaultClient implements Client { }, headerFilter: settings_clangTidyHeaderFilter, args: settings_clangTidyArgs, + useDashP: settings_clangTidyUseDashP, checks: { enabled: settings_clangTidyChecksEnabled, disabled: settings_clangTidyChecksDisabled diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 953d82008c..a7a67ab258 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -183,6 +183,7 @@ export class CppSettings extends Settings { 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 clangTidyUseDashP(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.useDashP"); } 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 ced33b641b0123e3ef2aba74aa4fe6f372bcfcfa Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 28 Mar 2022 14:09:45 -0700 Subject: [PATCH 2/3] Update 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 be89022edc..737b24e32a 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -48,7 +48,7 @@ "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.headerFilter.markdownDescription": { "message": "A POSIX extended regular expression (ERE) 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 (and is used as the default fallback value if no `.clang-tidy` file exists). 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.useDashP.markdownDescription": { "message": "If `true`, the `-p=` argument is sent to `clang-tidy` directly instead of individual arguments being sent directly after being filtered by IntelliSense. This may not work if environment variables aren't set so that system includes can be found.", "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.useDashP.markdownDescription": { "message": "If `true` and `compileCommands` is set, the `-p=` argument is sent to `clang-tidy` instead of individual arguments being sent. This may not work if environment variables aren't set so that system includes can be found.", "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.", From 206dee237cf2d9d5ff17010b3d3a6641148d621b Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 28 Mar 2022 16:04:36 -0700 Subject: [PATCH 3/3] Rename setting. --- Extension/package.json | 4 ++-- Extension/package.nls.json | 2 +- Extension/src/LanguageServer/client.ts | 6 +++--- Extension/src/LanguageServer/settings.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index d99df0a09b..d20e5d444a 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -461,10 +461,10 @@ "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription%", "scope": "resource" }, - "C_Cpp.codeAnalysis.clangTidy.useDashP": { + "C_Cpp.codeAnalysis.clangTidy.useBuildPath": { "type": "boolean", "default": false, - "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.useDashP.markdownDescription%", + "markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.useBuildPath.markdownDescription%", "scope": "resource" }, "C_Cpp.codeAnalysis.clangTidy.checks.enabled": { diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 737b24e32a..e14ee2cd15 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -48,7 +48,7 @@ "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.headerFilter.markdownDescription": { "message": "A POSIX extended regular expression (ERE) 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 (and is used as the default fallback value if no `.clang-tidy` file exists). 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.useDashP.markdownDescription": { "message": "If `true` and `compileCommands` is set, the `-p=` argument is sent to `clang-tidy` instead of individual arguments being sent. This may not work if environment variables aren't set so that system includes can be found.", "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.useBuildPath.markdownDescription": { "message": "If `true` and `compileCommands` is set, the `-p=` argument is passed to `clang-tidy` instead of build arguments being passed after `--`. This may not work if environment variables aren't set so that system includes can be found.", "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.", diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 91f23f0b87..db1139cb36 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1101,7 +1101,7 @@ export class DefaultClient implements Client { const settings_clangTidyFixNotes: (boolean | undefined)[] = []; const settings_clangTidyHeaderFilter: (string | undefined | null)[] = []; const settings_clangTidyArgs: (string[] | undefined)[] = []; - const settings_clangTidyUseDashP: (boolean | undefined)[] = []; + const settings_clangTidyUseBuildPath: (boolean | undefined)[] = []; const settings_clangTidyChecksEnabled: (string[] | undefined)[] = []; const settings_clangTidyChecksDisabled: (string[] | undefined)[] = []; const settings_filesEncoding: (string | undefined)[] = []; @@ -1212,7 +1212,7 @@ export class DefaultClient implements Client { settings_clangTidyFixNotes.push(setting.clangTidyFixNotes); settings_clangTidyHeaderFilter.push(setting.clangTidyHeaderFilter); settings_clangTidyArgs.push(setting.clangTidyArgs); - settings_clangTidyUseDashP.push(setting.clangTidyUseDashP); + settings_clangTidyUseBuildPath.push(setting.clangTidyUseBuildPath); settings_clangTidyChecksEnabled.push(setting.clangTidyChecksEnabled); settings_clangTidyChecksDisabled.push(setting.clangTidyChecksDisabled); settings_indentBraces.push(setting.vcFormatIndentBraces); @@ -1354,7 +1354,7 @@ export class DefaultClient implements Client { }, headerFilter: settings_clangTidyHeaderFilter, args: settings_clangTidyArgs, - useDashP: settings_clangTidyUseDashP, + useBuildPath: settings_clangTidyUseBuildPath, checks: { enabled: settings_clangTidyChecksEnabled, disabled: settings_clangTidyChecksDisabled diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index a7a67ab258..58aac2bf3a 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -183,7 +183,7 @@ export class CppSettings extends Settings { 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 clangTidyUseDashP(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.useDashP"); } + public get clangTidyUseBuildPath(): boolean | undefined { return super.Section.get("codeAnalysis.clangTidy.useBuildPath"); } 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"); }