forked from continuedev/continue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
activate.ts
37 lines (32 loc) · 1.15 KB
/
activate.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { getTsConfigPath, migrate } from "core/util/paths";
import { Telemetry } from "core/util/posthog";
import path from "path";
import * as vscode from "vscode";
import { VsCodeExtension } from "../extension/vscodeExtension";
import registerQuickFixProvider from "../lang-server/codeActions";
import { getExtensionVersion } from "../util/util";
import { getExtensionUri } from "../util/vscode";
import { setupInlineTips } from "./inlineTips";
export async function activateExtension(context: vscode.ExtensionContext) {
// Add necessary files
getTsConfigPath();
// Register commands and providers
registerQuickFixProvider();
setupInlineTips(context);
const vscodeExtension = new VsCodeExtension(context);
migrate("showWelcome_1", () => {
vscode.commands.executeCommand(
"markdown.showPreview",
vscode.Uri.file(
path.join(getExtensionUri().fsPath, "media", "welcome.md"),
),
);
});
// Load Continue configuration
if (!context.globalState.get("hasBeenInstalled")) {
context.globalState.update("hasBeenInstalled", true);
Telemetry.capture("install", {
extensionVersion: getExtensionVersion(),
});
}
}