Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions Extension/c_cpp_properties.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@
"version": {
"type": "integer",
"description": "Version of the configuration file. This property is managed by the extension. Please do not change it."
},
"enableConfigurationSquiggles": {
"type": "boolean",
"default": true,
"description": "Controls whether the extension will report errors detected in c_cpp_properties.json."
}
},
"properties": {
Expand All @@ -153,6 +158,9 @@
},
"version": {
"$ref": "#/definitions/version"
},
"enableConfigurationSquiggles": {
"$ref": "#/definitions/enableConfigurationSquiggles"
}
},
"required": [
Expand Down
11 changes: 10 additions & 1 deletion Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,15 @@
"description": "The value to use for the system include path. If set, it overrides the system include path acquired via \"compilerPath\" and \"compileCommands\" settings.",
"scope": "resource"
},
"C_Cpp.default.enableConfigurationSquiggles": {
"type": [
"boolean",
"null"
],
"default": null,
"description": "Controls whether the extension will report errors detected in c_cpp_properties.json.",
"scope": "resource"
},
"C_Cpp.updateChannel": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -1613,4 +1622,4 @@
"binaries": []
}
]
}
}
14 changes: 13 additions & 1 deletion Extension/src/LanguageServer/configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface ConfigurationJson {
configurations: Configuration[];
env?: {[key: string]: string | string[]};
version: number;
enableConfigurationSquiggles?: boolean;
}

export interface Configuration {
Expand Down Expand Up @@ -699,7 +700,18 @@ export class CppProperties {
}
}

this.handleSquiggles();
if (this.configurationJson.enableConfigurationSquiggles === false) {
this.diagnosticCollection.clear();
} else if (this.configurationJson.enableConfigurationSquiggles === true) {
this.handleSquiggles();
} else {
const settings: CppSettings = new CppSettings(this.rootUri);
if (settings.defaultEnableConfigurationSquiggles === false) {
this.diagnosticCollection.clear();
} else {
this.handleSquiggles();
}
}
} catch (err) {
vscode.window.showErrorMessage(`Failed to parse "${this.propertiesFile.fsPath}": ${err.message}`);
throw err;
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 @@ -72,6 +72,7 @@ export class CppSettings extends Settings {
public get defaultDatabaseFilename(): string { return super.Section.get<string>("default.browse.databaseFilename"); }
public get defaultLimitSymbolsToIncludedHeaders(): boolean { return super.Section.get<boolean>("default.browse.limitSymbolsToIncludedHeaders"); }
public get defaultSystemIncludePath(): string[] { return super.Section.get<string[]>("default.systemIncludePath"); }
public get defaultEnableConfigurationSquiggles(): boolean { return super.Section.get<boolean>("default.enableConfigurationSquiggles"); }

public toggleSetting(name: string, value1: string, value2: string): void {
let value: string = super.Section.get<string>(name);
Expand Down