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

Configuration UI #3479

Merged
merged 24 commits into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8a440e5
Add settings webview
michelleangela Apr 9, 2019
e8368e9
Add setting: useSettingsUI
Apr 9, 2019
58088cd
Use existing global setting (workbench.settings.editor == ui | json)
Apr 11, 2019
ac986e0
handle changes from webview
michelleangela Apr 11, 2019
c353587
Add content security policy to html
michelleangela Apr 12, 2019
0f31123
Move use of workbench settings into OtherSettings class
Apr 15, 2019
bcbfd27
Merge branch 'mimatias/configUI' of https://github.com/Microsoft/vsco…
Apr 15, 2019
602e045
sync ui and json file
michelleangela Apr 16, 2019
77bf620
Add functions for each way to open settings (UI, JSON, based on config)
Apr 16, 2019
2b3e592
Remove unnecesary command
Apr 16, 2019
ae94c64
add telemetry. handle failed parse. Add UI command to toast notificat…
michelleangela Apr 16, 2019
a3e609b
add newline
michelleangela Apr 16, 2019
140acdb
merge master
michelleangela Apr 16, 2019
2a74b01
fix value properties of HTML element
michelleangela Apr 17, 2019
62b9ddc
fix another html value
michelleangela Apr 17, 2019
a3906f2
fix formatting
michelleangela Apr 17, 2019
3e7e74c
add typedef
michelleangela Apr 17, 2019
afa1b8f
fix more formatting and ===
michelleangela Apr 17, 2019
d59236d
fix code styling. fixed some bugs.
michelleangela Apr 17, 2019
3ea7434
move configDirty flag reset
michelleangela Apr 17, 2019
da64a7b
add typedef to onWindowStateChanged
michelleangela Apr 17, 2019
6033749
small clean up
michelleangela Apr 17, 2019
76d708c
Merge branch 'master' into mimatias/configUI
michelleangela Apr 17, 2019
dfcc873
Merge branch 'master' into mimatias/configUI
michelleangela Apr 17, 2019
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
9 changes: 7 additions & 2 deletions Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,13 @@
"category": "C/C++"
},
{
"command": "C_Cpp.ConfigurationEdit",
"title": "%c_cpp.command.configurationEdit.title%",
"command": "C_Cpp.ConfigurationEditJSON",
"title": "%c_cpp.command.configurationEditJSON.title%",
"category": "C/C++"
},
{
"command": "C_Cpp.ConfigurationEditUI",
"title": "%c_cpp.command.configurationEditUI.title%",
"category": "C/C++"
},
{
Expand Down
3 changes: 2 additions & 1 deletion Extension/package.nls.it.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"c_cpp.command.configurationSelect.title": "Scegli una configurazione...",
"c_cpp.command.configurationProviderSelect.title": "Cambia provider configurazioni...",
"c_cpp.command.configurationEdit.title": "Modifica configurazioni...",
"c_cpp.command.configurationEditJSON.title": "Modifica configurazioni... (JSON)",
"c_cpp.command.configurationEditUI.title": "Modifica configurazioni... (UI)",
"c_cpp.command.goToDeclaration.title": "Vai a dichiarazione",
"c_cpp.command.peekDeclaration.title": "Visualizza dichiarazione",
"c_cpp.command.switchHeaderSource.title": "Visualizza Header/Sorgente",
Expand Down
3 changes: 2 additions & 1 deletion Extension/package.nls.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"c_cpp.command.configurationSelect.title": "Select a configuration...",
"c_cpp.command.configurationProviderSelect.title": "Change configuration provider...",
"c_cpp.command.configurationEdit.title": "Edit configurations...",
"c_cpp.command.configurationEditJSON.title": "Edit configurations... (JSON)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michelleangela I think the "..." are always supposed to be at the end of the command text, e.g. "Edit configurations (JSON)…"

"c_cpp.command.configurationEditUI.title": "Edit configurations... (UI)",
"c_cpp.command.goToDeclaration.title": "Go to Declaration",
"c_cpp.command.peekDeclaration.title": "Peek Declaration",
"c_cpp.command.switchHeaderSource.title": "Switch Header/Source",
Expand Down
3 changes: 2 additions & 1 deletion Extension/package.nls.zh-cn.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"c_cpp.command.configurationSelect.title": "选择配置...",
"c_cpp.command.configurationProviderSelect.title": "更换配置提供程序...",
"c_cpp.command.configurationEdit.title": "编辑配置...",
"c_cpp.command.configurationEditJSON.title": "编辑配置... (JSON)",
"c_cpp.command.configurationEditUI.title": "编辑配置... (UI)",
"c_cpp.command.goToDeclaration.title": "跳转到声明",
"c_cpp.command.peekDeclaration.title": "查看声明",
"c_cpp.command.switchHeaderSource.title": "切换头文件/源文件",
Expand Down
39 changes: 30 additions & 9 deletions Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ export interface Client {
handleConfigurationProviderSelectCommand(): void;
handleShowParsingCommands(): void;
handleConfigurationEditCommand(): void;
handleConfigurationEditJSONCommand(): void;
handleConfigurationEditUICommand(): void;
handleAddToIncludePathCommand(path: string): void;
onInterval(): void;
dispose(): Thenable<void>;
Expand Down Expand Up @@ -962,22 +964,31 @@ class DefaultClient implements Client {
let showIntelliSenseFallbackMessage: PersistentState<boolean> = new PersistentState<boolean>("CPP.showIntelliSenseFallbackMessage", true);
if (showIntelliSenseFallbackMessage.Value) {
ui.showConfigureIncludePathMessage(() => {
let learnMorePanel: string = "Configuration Help";
let configJSON: string = "Configure (JSON)";
let configUI: string = "Configure (UI)";
let dontShowAgain: string = "Don't Show Again";
let fallbackMsg: string = this.configuration.VcpkgInstalled ?
"Update your IntelliSense settings or use Vcpkg to install libraries to help find missing headers." :
"Configure your IntelliSense settings to help find missing headers.";
return vscode.window.showInformationMessage(fallbackMsg, learnMorePanel, dontShowAgain).then((value) => {
"Update your IntelliSense settings in JSON or UI. Or use Vcpkg to install libraries to help find missing headers." :
"Configure your IntelliSense settings in JSON or UI to help find missing headers.";
return vscode.window.showInformationMessage(fallbackMsg, configJSON, configUI, dontShowAgain).then((value) => {
switch (value) {
case learnMorePanel:
let uri: vscode.Uri = vscode.Uri.parse(`https://go.microsoft.com/fwlink/?linkid=864631`);
vscode.commands.executeCommand('vscode.open', uri);
case configJSON:
vscode.commands.getCommands(true).then((commands: string[]) => {
if (commands.indexOf("workbench.action.problems.focus") >= 0) {
vscode.commands.executeCommand("workbench.action.problems.focus");
}
});
this.handleConfigurationEditJSONCommand();
telemetry.logLanguageServerEvent("SettingsCommand", { "toast": "json" }, null);
break;
case configUI:
vscode.commands.getCommands(true).then((commands: string[]) => {
if (commands.indexOf("workbench.action.problems.focus") >= 0) {
vscode.commands.executeCommand("workbench.action.problems.focus");
}
}
});
this.handleConfigurationEditCommand();
this.handleConfigurationEditUICommand();
telemetry.logLanguageServerEvent("SettingsCommand", { "toast": "ui" }, null);
break;
case dontShowAgain:
showIntelliSenseFallbackMessage.Value = false;
Expand Down Expand Up @@ -1320,6 +1331,14 @@ class DefaultClient implements Client {
this.notifyWhenReady(() => this.configuration.handleConfigurationEditCommand(vscode.window.showTextDocument));
}

public handleConfigurationEditJSONCommand(): void {
this.notifyWhenReady(() => this.configuration.handleConfigurationEditJSONCommand(vscode.window.showTextDocument));
}

public handleConfigurationEditUICommand(): void {
this.notifyWhenReady(() => this.configuration.handleConfigurationEditUICommand(vscode.window.showTextDocument));
}

public handleAddToIncludePathCommand(path: string): void {
this.notifyWhenReady(() => this.configuration.addToIncludePathCommand(path));
}
Expand Down Expand Up @@ -1403,6 +1422,8 @@ class NullClient implements Client {
handleConfigurationProviderSelectCommand(): void {}
handleShowParsingCommands(): void {}
handleConfigurationEditCommand(): void {}
handleConfigurationEditJSONCommand(): void {}
handleConfigurationEditUICommand(): void {}
handleAddToIncludePathCommand(path: string): void {}
onInterval(): void {}
dispose(): Thenable<void> {
Expand Down
Loading