MCPcopy Create free account
hub / github.com/Dart-Code/Flutter / activate

Function activate

src/extension.ts:5–22  ·  view source on GitHub ↗
(context: vs.ExtensionContext)

Source from the content-addressed store, hash-verified

3import { dartCodeExtensionIdentifier } from "./constants";
4
5export async function activate(context: vs.ExtensionContext): Promise<void> {
6 // Ensure we have a Dart extension.
7 const dartExt = vs.extensions.getExtension(dartCodeExtensionIdentifier);
8 if (!dartExt) {
9 // This should not happen since the Flutter extension has a dependency on the Dart one
10 // but just in case, we'd like to give a useful error message.
11 throw new Error("The Dart extension is not installed, Flutter extension is unable to activate.");
12 }
13 await dartExt.activate();
14
15 if (!dartExt.exports) {
16 console.error("The Dart extension did not provide an exported API. Maybe it failed to activate or is not the latest version?");
17 return;
18 }
19
20 // Register SDK commands.
21 const sdkCommands = new SdkCommands(context, dartExt.exports);
22}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected