@nifrajs/ts-plugin 4.0.2 → 5.0.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/index.cjs CHANGED
@@ -356,7 +356,7 @@ function init(modules) {
356
356
  const member = ls[key];
357
357
  writable[key] = typeof member === "function" ? (...args) => {
358
358
  const fileName = args[0];
359
- const source = typeof fileName === "string" ? programSourceFile(tsm, ls.getProgram(), fileName) : undefined;
359
+ const source = typeof fileName === "string" && import_node_path2.isAbsolute(fileName) ? programSourceFile(tsm, ls.getProgram(), fileName) : undefined;
360
360
  return member.apply(ls, [
361
361
  ...source === undefined ? args : [source.fileName, ...args.slice(1)]
362
362
  ]);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAA;AAIrC,sGAAsG;AACtG,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAoB,GAC1C,MAAM,GAAG,SAAS,CASpB;AAgMD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,OAAO,EAAE,EACd,MAAM,EAAE,EAAE,CAAC,UAAU,EACrB,QAAQ,EAAE,MAAM,GACf;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAA;CAAE,GAAG,SAAS,CAMjD;AA4CD,iBAAS,IAAI,CAAC,OAAO,EAAE;IAAE,UAAU,EAAE,OAAO,EAAE,CAAA;CAAE,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAyDxE;AAED,eAAe,IAAI,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAA;AAIrC,sGAAsG;AACtG,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAoB,GAC1C,MAAM,GAAG,SAAS,CASpB;AAgMD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,OAAO,EAAE,EACd,MAAM,EAAE,EAAE,CAAC,UAAU,EACrB,QAAQ,EAAE,MAAM,GACf;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAA;CAAE,GAAG,SAAS,CAMjD;AA4CD,iBAAS,IAAI,CAAC,OAAO,EAAE;IAAE,UAAU,EAAE,OAAO,EAAE,CAAA;CAAE,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CA0DxE;AAED,eAAe,IAAI,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nifrajs/ts-plugin",
3
- "version": "4.0.2",
3
+ "version": "5.0.0",
4
4
  "description": "TypeScript language-service plugin for nifra - go-to-definition from a route-path string literal to the routes/ file that serves it, and the frontend/backend zone rules as editor errors.",
5
5
  "keywords": [
6
6
  "bun",
@@ -47,8 +47,8 @@
47
47
  "build": "bun run build.ts"
48
48
  },
49
49
  "dependencies": {
50
- "@nifrajs/core": "4.0.2",
51
- "@nifrajs/web": "4.0.2"
50
+ "@nifrajs/core": "5.0.0",
51
+ "@nifrajs/web": "5.0.0"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "typescript": ">=5.5.0"
package/src/index.ts CHANGED
@@ -302,10 +302,11 @@ function init(modules: { typescript: typeof ts }): ts.server.PluginModule {
302
302
  // TypeScript's public methods generally take the source file name first. Map an
303
303
  // editor's short/long Windows spelling to the Program's own spelling before delegating;
304
304
  // this preserves the real service (and its diagnostics) instead of swallowing a path
305
- // mismatch as an empty result.
305
+ // mismatch as an empty result. Editors send absolute file names; a relative first
306
+ // argument is a value (a navigate-to search), and mapping it would scan every file.
306
307
  const fileName = args[0]
307
308
  const source =
308
- typeof fileName === "string"
309
+ typeof fileName === "string" && isAbsolute(fileName)
309
310
  ? programSourceFile(tsm, ls.getProgram(), fileName)
310
311
  : undefined
311
312
  return (member as (...args: unknown[]) => unknown).apply(ls, [