Compare commits

...
4 Commits
Author SHA1 Message Date
Sean McManus 54bf446cbc Merge pull request #7658 from microsoft/1_4_1
1.4.1
2021-06-07 18:02:47 -07:00
Sean McManus ecfe50be26 Update changelog for 1.4.1. (#7657)
* Update changelog for 1.4.1.
2021-06-07 17:43:28 -07:00
Sean McManus 623029cc62 Better fix for settings UI not getting updated. (#7656)
* Better fix for settings UI not getting updated.
2021-06-07 16:23:16 -07:00
Sean McManus 4076edd843 Workaround for webViewPanel.postMessage getting dropped. (#7647)
* Workaround for webViewPanel.postMessage getting dropped.
2021-06-07 16:23:10 -07:00
5 changed files with 28 additions and 11 deletions
+3
View File
@@ -1,5 +1,8 @@
# C/C++ for Visual Studio Code Change Log
## Version 1.4.1: June 8, 2021
* Fix the configuration UI sometimes not populating initially with VS Code 1.56 or later. [#7641](https://github.com/microsoft/vscode-cpptools/issues/7641)
## Version 1.4.0: May 27, 2021
### New Features
* Add a C++ walkthrough to the "Getting Started" page. [#7273](https://github.com/microsoft/vscode-cpptools/issues/7273)
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "cpptools",
"displayName": "C/C++",
"description": "C/C++ IntelliSense, debugging, and code browsing.",
"version": "1.4.0-main",
"version": "1.4.1-main",
"publisher": "ms-vscode",
"icon": "LanguageCCPP_color_128x.png",
"readme": "README.md",
@@ -975,7 +975,11 @@ export class CppProperties {
const settings: CppSettings = new CppSettings(this.rootUri);
this.settingsPanel = new SettingsPanel();
this.settingsPanel.setKnownCompilers(this.knownCompilers, settings.preferredPathSeparator);
this.settingsPanel.SettingsPanelActivated(() => this.onSettingsPanelActivated());
this.settingsPanel.SettingsPanelActivated(() => {
if (this.settingsPanel?.initialized) {
this.onSettingsPanelActivated();
}
});
this.settingsPanel.ConfigValuesChanged(() => this.saveConfigurationUI());
this.settingsPanel.ConfigSelectionChanged(() => this.onConfigSelectionChanged());
this.settingsPanel.AddConfigRequested((e) => this.onAddConfigRequested(e));
@@ -1025,14 +1029,9 @@ export class CppProperties {
if (this.settingsPanel.selectedConfigIndex >= this.configurationJson.configurations.length) {
this.settingsPanel.selectedConfigIndex = this.CurrentConfigurationIndex;
}
setTimeout(() => {
if (this.settingsPanel && this.configurationJson) {
this.settingsPanel.updateConfigUI(configNames,
this.configurationJson.configurations[this.settingsPanel.selectedConfigIndex],
this.getErrorsForConfigUI(this.settingsPanel.selectedConfigIndex));
}
},
500); // Need some delay or the UI can randomly be blank, particularly in the remote scenario.
this.settingsPanel.updateConfigUI(configNames,
this.configurationJson.configurations[this.settingsPanel.selectedConfigIndex],
this.getErrorsForConfigUI(this.settingsPanel.selectedConfigIndex));
} else {
// Parse failed, open json file
vscode.workspace.openTextDocument(this.propertiesFile);
+13 -1
View File
@@ -73,6 +73,12 @@ export class SettingsPanel {
private static readonly viewType: string = 'settingsPanel';
private static readonly title: string = 'C/C++ Configurations';
// Used to workaround a VS Code 1.56 regression in which webViewPanel.onDidChangeViewState
// gets called before the SettingsApp constructor is finished running.
// It repros with a higher probability in cases that cause a slower load,
// such as after switching to a Chinese language pack or in the remote scenario.
public initialized: boolean = false;
constructor() {
this.disposable = vscode.Disposable.from(
this.settingsPanelActivated,
@@ -91,6 +97,8 @@ export class SettingsPanel {
return;
}
this.initialized = false;
// Create new panel
this.panel = vscode.window.createWebviewPanel(
SettingsPanel.viewType,
@@ -211,7 +219,7 @@ export class SettingsPanel {
private updateWebview(configSelection: string[], configuration: config.Configuration, errors: config.ConfigurationErrors | null): void {
this.configValues = {...configuration}; // Copy configuration values
this.isIntelliSenseModeDefined = (this.configValues.intelliSenseMode !== undefined);
if (this.panel) {
if (this.panel && this.initialized) {
this.panel.webview.postMessage({ command: 'setKnownCompilers', compilers: this.compilerPaths });
this.panel.webview.postMessage({ command: 'updateConfigSelection', selections: configSelection, selectedIndex: this.configIndexSelected });
this.panel.webview.postMessage({ command: 'updateConfig', config: this.configValues });
@@ -250,6 +258,10 @@ export class SettingsPanel {
case 'knownCompilerSelect':
this.knownCompilerSelect();
break;
case "initialized":
this.initialized = true;
this.settingsPanelActivated.fire();
break;
}
}
+3
View File
@@ -81,6 +81,9 @@ class SettingsApp {
document.getElementById(elementId.advancedSection).style.display = advancedShown ? "block" : "none";
document.getElementById(elementId.showAdvanced).classList.toggle(advancedShown ? "collapse" : "expand", true);
document.getElementById(elementId.showAdvanced).addEventListener("click", this.onShowAdvanced.bind(this));
this.vsCodeApi.postMessage({
command: "initialized"
});
}
private addEventsToInputValues(): void {