@rohal12/spindle-lsp 0.2.0 → 0.3.0

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
@@ -2397,8 +2397,11 @@ function parseConfig(content, format) {
2397
2397
  return { macros: {} };
2398
2398
  }
2399
2399
  const obj = raw;
2400
+ const spindle0 = obj["spindle-0"];
2401
+ const source = spindle0 && typeof spindle0 === "object" ? spindle0 : obj;
2400
2402
  return {
2401
- macros: typeof obj.macros === "object" && obj.macros !== null ? obj.macros : {}
2403
+ macros: typeof source.macros === "object" && source.macros !== null ? source.macros : {},
2404
+ enums: typeof source.enums === "object" && source.enums !== null ? source.enums : void 0
2402
2405
  };
2403
2406
  }
2404
2407
  function findConfigFile(workspaceRoot) {
@@ -2426,7 +2429,10 @@ var init_config_loader = __esm({
2426
2429
  CONFIG_FILENAMES = [
2427
2430
  "spindle.config.yaml",
2428
2431
  "spindle.config.yml",
2429
- "spindle.config.json"
2432
+ "spindle.config.json",
2433
+ "t3lt.twee-config.yaml",
2434
+ "t3lt.twee-config.yml",
2435
+ "t3lt.twee-config.json"
2430
2436
  ];
2431
2437
  EMPTY_CONFIG = { macros: {} };
2432
2438
  }
@@ -2685,7 +2691,26 @@ async function runCheck(args2) {
2685
2691
  }
2686
2692
  return 0;
2687
2693
  }
2688
- const configRoot = options.configPath ? resolve(cwd, options.configPath, "..") : cwd;
2694
+ let configRoot;
2695
+ if (options.configPath) {
2696
+ configRoot = resolve(cwd, options.configPath, "..");
2697
+ } else {
2698
+ const dirs = uniqueFiles.map((f) => resolve(f, ".."));
2699
+ configRoot = dirs.reduce((a, b) => {
2700
+ while (!b.startsWith(a)) a = resolve(a, "..");
2701
+ return a;
2702
+ });
2703
+ let search = configRoot;
2704
+ for (let i = 0; i < 10; i++) {
2705
+ if (findConfigFile(search)) {
2706
+ configRoot = search;
2707
+ break;
2708
+ }
2709
+ const parent = resolve(search, "..");
2710
+ if (parent === search) break;
2711
+ search = parent;
2712
+ }
2713
+ }
2689
2714
  const projectConfig = loadConfigFromDisk(configRoot);
2690
2715
  const workspace = new WorkspaceModel();
2691
2716
  const fileContents = /* @__PURE__ */ new Map();
@@ -4847,7 +4872,8 @@ function startServer(_args) {
4847
4872
  { globPattern: "**/*.twee" },
4848
4873
  { globPattern: "**/*.js" },
4849
4874
  { globPattern: "**/*.ts" },
4850
- { globPattern: "**/spindle.config.*" }
4875
+ { globPattern: "**/spindle.config.*" },
4876
+ { globPattern: "**/*twee-config.*" }
4851
4877
  ]
4852
4878
  });
4853
4879
  if (workspace) {