tenseleyflow/dlm-vsc / b940a91

Browse files

Make LSP start best-effort so commands register without dlm-lsp installed

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
b940a91483d3f3eb1b3f34889cb3c0a9e0beee44
Parents
379cc2d
Tree
35acab3

1 changed file

StatusFile+-
M src/extension.ts 9 1
src/extension.tsmodified
@@ -12,7 +12,6 @@ export async function activate(context: vscode.ExtensionContext) {
1212
   const lspPath = config.get<string>("lspPath", "dlm-lsp");
1313
 
1414
   client = createLspClient(lspPath);
15
-  await client.start();
1615
 
1716
   const panelProvider = new DlmPanelProvider(context.extensionUri, client);
1817
   context.subscriptions.push(
@@ -22,6 +21,15 @@ export async function activate(context: vscode.ExtensionContext) {
2221
   );
2322
 
2423
   registerCommands(context);
24
+
25
+  try {
26
+    await client.start();
27
+  } catch (err) {
28
+    const msg = err instanceof Error ? err.message : String(err);
29
+    vscode.window.showWarningMessage(
30
+      `DLM language server failed to start (${msg}). Install with: pip install dlm-lsp`
31
+    );
32
+  }
2533
 }
2634
 
2735
 export async function deactivate() {