@rohal12/spindle-lsp 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js CHANGED
@@ -4884,7 +4884,7 @@ function startServer(_args) {
4884
4884
  capabilities: buildCapabilities(activePlugins)
4885
4885
  };
4886
4886
  });
4887
- connection.onInitialized(async () => {
4887
+ connection.onInitialized(() => {
4888
4888
  connection.client.register(DidChangeWatchedFilesNotification.type, {
4889
4889
  watchers: [
4890
4890
  { globPattern: "**/*.tw" },
@@ -4894,12 +4894,19 @@ function startServer(_args) {
4894
4894
  { globPattern: "**/spindle.config.*" },
4895
4895
  { globPattern: "**/*twee-config.*" }
4896
4896
  ]
4897
+ }).catch(() => {
4897
4898
  });
4898
4899
  if (workspace) {
4899
- const fileContents = await scanWorkspaceFiles(workspaceRoot);
4900
- console.error("[spindle-lsp] onInitialized: scanned", fileContents.size, "files from root:", workspaceRoot ?? "undefined");
4901
- workspace.initialize(fileContents);
4902
- console.error("[spindle-lsp] workspace initialized, macros:", workspace.macros.getAllMacros().length, "warnings:", workspace.macros.warnings);
4900
+ setImmediate(async () => {
4901
+ try {
4902
+ const fileContents = await scanWorkspaceFiles(workspaceRoot);
4903
+ console.error("[spindle-lsp] scanned", fileContents.size, "files from root:", workspaceRoot ?? "undefined");
4904
+ workspace.initialize(fileContents);
4905
+ console.error("[spindle-lsp] workspace initialized, macros:", workspace.macros.getAllMacros().length);
4906
+ } catch (err) {
4907
+ console.error("[spindle-lsp] workspace scan failed:", err);
4908
+ }
4909
+ });
4903
4910
  }
4904
4911
  });
4905
4912
  connection.onDidOpenTextDocument(({ textDocument }) => {