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
1 change: 1 addition & 0 deletions Extension/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Fix `#include` autocomplete with Mac framework headers. [#2251](https://github.com/Microsoft/vscode-cpptools/issues/2251)
* Fix for debugging to support empty arguments for debuggee. [#2258](https://github.com/Microsoft/vscode-cpptools/issues/2258)
* Fix `Go to Definition` bug (missing symbols outside the workspace). [#2281](https://github.com/Microsoft/vscode-cpptools/issues/2281)
* Add a setting to silence configuration provider warnings. [#2292](https://github.com/Microsoft/vscode-cpptools/issues/2292)
* Fix for debugging async Visual C++ causing debugger to hang.
* Fix `main` snippet.

Expand Down
10 changes: 10 additions & 0 deletions Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,16 @@
"description": "Defines the editor behavior for when the Enter key is pressed inside a multiline or single line comment block.",
"scope": "resource"
},
"C_Cpp.configurationWarnings": {
"type": "string",
"enum": [
"Enabled",
"Disabled"
],
"default": "Enabled",
"description": "Determines whether pop up notifications will be shown when a configuration provider extension is unable to provide a configuration for a source file.",
"scope": "resource"
},
"C_Cpp.default.includePath": {
"type": [
"array",
Expand Down
30 changes: 22 additions & 8 deletions Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { getTestHook, TestHook } from '../testHook';
import { getCustomConfigProviders, CustomConfigurationProviderCollection, CustomConfigurationProvider1 } from '../LanguageServer/customProviders';

let ui: UI;
const configProviderTimeout: number = 2000;

interface NavigationPayload {
navigation: string;
Expand Down Expand Up @@ -430,17 +431,18 @@ class DefaultClient implements Client {
let folderStr: string = (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 1) ? "the '" + this.Name + "'" : "this";
const message: string = `${provider.name} would like to configure IntelliSense for ${folderStr} folder.`;
const allow: string = "Allow";
const notNow: string = "Not Now";
const dontAskAgain: string = "Don't Ask Again";
vscode.window.showInformationMessage(message, allow, notNow, dontAskAgain).then(result => {
const dontAllow: string = "Don't Allow";
const askLater: string = "Ask Me Later";
vscode.window.showInformationMessage(message, allow, dontAllow, askLater).then(result => {
switch (result) {
case allow: {
this.configuration.updateCustomConfigurationProvider(provider.extensionId).then(() => {
telemetry.logLanguageServerEvent("customConfigurationProvider", { "providerId": provider.extensionId });
});
ask.Value = false;
break;
}
case dontAskAgain: {
case dontAllow: {
ask.Value = false;
break;
}
Expand Down Expand Up @@ -475,7 +477,7 @@ class DefaultClient implements Client {
let task: () => Thenable<SourceFileConfigurationItem[]> = () => {
return currentProvider.provideConfigurations(documentUris, tokenSource.token);
};
this.queueTaskWithTimeout(task, 1000, tokenSource).then(configs => this.sendCustomConfigurations(configs));
this.queueTaskWithTimeout(task, configProviderTimeout, tokenSource).then(configs => this.sendCustomConfigurations(configs));
});
}

Expand Down Expand Up @@ -508,17 +510,29 @@ class DefaultClient implements Client {
return Promise.reject("");
};

return this.queueTaskWithTimeout(provideConfigurationAsync, 1000, tokenSource).then(
return this.queueTaskWithTimeout(provideConfigurationAsync, configProviderTimeout, tokenSource).then(
(configs: SourceFileConfigurationItem[]) => {
if (configs && configs.length > 0) {
this.sendCustomConfigurations(configs);
}
},
() => {
if (!this.isExternalHeader(document) && !vscode.debug.activeDebugSession) {
let settings: CppSettings = new CppSettings(this.RootUri);
if (settings.configurationWarnings === "Enabled" && !this.isExternalHeader(document) && !vscode.debug.activeDebugSession) {
const dismiss: string = "Dismiss";
const disable: string = "Disable Warnings";
vscode.window.showInformationMessage(
`'${providerName}' is unable to provide IntelliSense configuration information for '${document.uri.fsPath}'. ` +
`Settings from the '${configName}' configuration will be used instead.`);
`Settings from the '${configName}' configuration will be used instead.`,
dismiss,
disable).then(response => {
switch (response) {
case disable: {
settings.toggleSetting("configurationWarnings", "Enabled", "Disabled");
break;
}
}
});
}
});
}
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 @@ -48,6 +48,7 @@ export class CppSettings extends Settings {
public get workspaceParsingPriority(): boolean { return super.Section.get<boolean>("workspaceParsingPriority"); }
public get exclusionPolicy(): boolean { return super.Section.get<boolean>("exclusionPolicy"); }
public get commentContinuationPatterns(): (string | CommentPattern)[] { return super.Section.get<(string | CommentPattern)[]>("commentContinuationPatterns"); }
public get configurationWarnings(): string { return super.Section.get<string>("configurationWarnings"); }
public get preferredPathSeparator(): string { return super.Section.get<string>("preferredPathSeparator"); }
public get defaultIncludePath(): string[] { return super.Section.get<string[]>("default.includePath"); }
public get defaultDefines(): string[] { return super.Section.get<string[]>("default.defines"); }
Expand Down