* @param {vscode.ExtensionContext} context * @returns {Promise }
(context)
| 14 | * @returns {Promise<void>} |
| 15 | */ |
| 16 | async function activate(context) { |
| 17 | const traceOutputChannel = vscode.window.createOutputChannel("csskit Language Server Trace"); |
| 18 | const storageDir = context.globalStorageUri.fsPath; |
| 19 | await fsp.mkdir(storageDir, { recursive: true }); |
| 20 | |
| 21 | const binaryPath = await ensureBinary(storageDir); |
| 22 | |
| 23 | const client = new LanguageClient( |
| 24 | "csskit", |
| 25 | "csskit Language Server", |
| 26 | { |
| 27 | run: { |
| 28 | command: binaryPath, |
| 29 | args: ["lsp"], |
| 30 | }, |
| 31 | debug: { |
| 32 | command: binaryPath, |
| 33 | args: ["--debug", "lsp"], |
| 34 | }, |
| 35 | }, |
| 36 | { |
| 37 | documentSelector: [{ scheme: "file", language: "css" }], |
| 38 | diagnosticCollectionName: "csskit", |
| 39 | traceOutputChannel, |
| 40 | }, |
| 41 | ); |
| 42 | context.subscriptions.push(client.start()); |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * @returns {{ platform: string, arch: string, exe: string }} |
nothing calls this directly
no test coverage detected