in client/src/client.ts [311:353]
function registerNotificationHandlers(client: lsp.LanguageClient): vscode.Disposable {
const disposables: vscode.Disposable[] = [];
disposables.push(client.onNotification(ProjectLoadingStart, () => {
vscode.window.withProgress(
{
location: vscode.ProgressLocation.Window,
title: 'Initializing Angular language features',
},
() => new Promise<void>((resolve) => {
client.onNotification(ProjectLoadingFinish, resolve);
}),
);
}));
disposables.push(client.onNotification(SuggestStrictMode, async (params: SuggestStrictModeParams) => {
const config = vscode.workspace.getConfiguration();
if (config.get('angular.enable-strict-mode-prompt') === false) {
return;
}
const openTsConfig = 'Open tsconfig.json';
// Markdown is not generally supported in `showInformationMessage()`,
// but links are supported. See
// https://github.com/microsoft/vscode/issues/20595#issuecomment-281099832
const doNotPromptAgain = 'Do not show again for this workspace';
const selection = await vscode.window.showInformationMessage(
'Some language features are not available. To access all features, enable ' +
'[strictTemplates](https://angular.io/guide/angular-compiler-options#stricttemplates) in ' +
'[angularCompilerOptions](https://angular.io/guide/angular-compiler-options).',
openTsConfig,
doNotPromptAgain,
);
if (selection === openTsConfig) {
const document = await vscode.workspace.openTextDocument(params.configFilePath);
vscode.window.showTextDocument(document);
} else if (selection === doNotPromptAgain) {
config.update(
'angular.enable-strict-mode-prompt', false, vscode.ConfigurationTarget.Workspace);
}
}));
return vscode.Disposable.from(...disposables);
}