in src/formatter-settings/index.ts [208:234]
private async parseProfileAndUpdate(document: vscode.TextDocument): Promise<boolean> {
const content: ProfileContent = parseProfile(document);
if (!content.isValid) {
vscode.window.showErrorMessage("The current profile is invalid, please check it in the Settings and try again.", "Open Settings").then((anwser) => {
if (anwser === "Open Settings") {
openFormatterSettings();
}
});
return false;
}
this.diagnosticCollection.set(document.uri, content.diagnostics);
if (this.webviewPanel) {
this.profileElements = content.profileElements || this.profileElements;
this.profileSettings = content.profileSettings || this.profileSettings;
this.lastElement = content.lastElement || this.lastElement;
this.settingsVersion = content.settingsVersion;
if (content.supportedProfileSettings) {
this.webviewPanel.webview.postMessage({
command: "loadProfileSetting",
setting: Array.from(content.supportedProfileSettings.values()),
});
}
await this.updateVSCodeSettings();
this.format();
}
return true;
}