MCPcopy Create free account
hub / github.com/angular/angular / activate

Function activate

vscode-ng-language-service/client/src/extension.ts:15–48  ·  view source on GitHub ↗
(context: vscode.ExtensionContext)

Source from the content-addressed store, hash-verified

13import {shouldRestartOnConfigurationChange} from './config_change';
14
15export function activate(context: vscode.ExtensionContext) {
16 const client = new AngularLanguageClient(context);
17 context.subscriptions.push(client);
18
19 const startServer = async () => {
20 registerCommands(client, context);
21
22 // Restart the server on configuration changes that affect startup/session state.
23 const disposable = vscode.workspace.onDidChangeConfiguration(
24 async (e: vscode.ConfigurationChangeEvent) => {
25 if (!shouldRestartOnConfigurationChange(e)) {
26 return;
27 }
28 await client.stop();
29 await client.start();
30 },
31 );
32 context.subscriptions.push(disposable);
33
34 await client.start();
35 };
36
37 // If the workspace is untrusted, operate in limited mode:
38 // Do NOT start the language server or register commands.
39 if (!vscode.workspace.isTrusted) {
40 const trustDisposable = vscode.workspace.onDidGrantWorkspaceTrust(async () => {
41 await startServer();
42 });
43 context.subscriptions.push(trustDisposable);
44 return;
45 }
46
47 startServer();
48}

Callers

nothing calls this directly

Calls 2

startServerFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected