Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clangTidy.useBuildPath setting #9104

Merged
merged 6 commits into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,12 @@
"markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.args.markdownDescription%",
"scope": "resource"
},
"C_Cpp.codeAnalysis.clangTidy.useBuildPath": {
"type": "boolean",
"default": false,
"markdownDescription": "%c_cpp.configuration.codeAnalysis.clangTidy.useBuildPath.markdownDescription%",
"scope": "resource"
},
"C_Cpp.codeAnalysis.clangTidy.checks.enabled": {
"type": "array",
"items": {
Expand Down
1 change: 1 addition & 0 deletions Extension/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.useBuildPath.markdownDescription": { "message": "If `true` and `compileCommands` is set, the `-p=<build-path>` 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.",
Expand Down
3 changes: 3 additions & 0 deletions Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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_clangTidyUseBuildPath: (boolean | undefined)[] = [];
const settings_clangTidyChecksEnabled: (string[] | undefined)[] = [];
const settings_clangTidyChecksDisabled: (string[] | undefined)[] = [];
const settings_filesEncoding: (string | undefined)[] = [];
Expand Down Expand Up @@ -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_clangTidyUseBuildPath.push(setting.clangTidyUseBuildPath);
settings_clangTidyChecksEnabled.push(setting.clangTidyChecksEnabled);
settings_clangTidyChecksDisabled.push(setting.clangTidyChecksDisabled);
settings_indentBraces.push(setting.vcFormatIndentBraces);
Expand Down Expand Up @@ -1352,6 +1354,7 @@ export class DefaultClient implements Client {
},
headerFilter: settings_clangTidyHeaderFilter,
args: settings_clangTidyArgs,
useBuildPath: settings_clangTidyUseBuildPath,
checks: {
enabled: settings_clangTidyChecksEnabled,
disabled: settings_clangTidyChecksDisabled
Expand Down
1 change: 1 addition & 0 deletions Extension/src/LanguageServer/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export class CppSettings extends Settings {
public get clangTidyFixNotes(): boolean | undefined { return false; } // super.Section.get<boolean>("codeAnalysis.clangTidy.fix.notes"); }
public get clangTidyHeaderFilter(): string | undefined | null { return super.Section.get<string | null>("codeAnalysis.clangTidy.headerFilter"); }
public get clangTidyArgs(): string[] | undefined { return super.Section.get<string[]>("codeAnalysis.clangTidy.args"); }
public get clangTidyUseBuildPath(): boolean | undefined { return super.Section.get<boolean>("codeAnalysis.clangTidy.useBuildPath"); }
public get clangTidyChecksEnabled(): string[] | undefined { return super.Section.get<string[]>("codeAnalysis.clangTidy.checks.enabled"); }
public get clangTidyChecksDisabled(): string[] | undefined { return super.Section.get<string[]>("codeAnalysis.clangTidy.checks.disabled"); }
public get clangFormatStyle(): string | undefined { return super.Section.get<string>("clang_format_style"); }
Expand Down