Skip to content

fix(resolution): resolve ES imports targeting .xsjs/.xsjslib files (#556)#594

Open
maxmilian wants to merge 1 commit into
colbymchenry:mainfrom
maxmilian:fix/556-sap-xsjs-extension
Open

fix(resolution): resolve ES imports targeting .xsjs/.xsjslib files (#556)#594
maxmilian wants to merge 1 commit into
colbymchenry:mainfrom
maxmilian:fix/556-sap-xsjs-extension

Conversation

@maxmilian

@maxmilian maxmilian commented May 31, 2026

Copy link
Copy Markdown
Contributor

What changed

The headline of #556 — indexing SAP HANA .xsjs / .xsjslib files as JavaScript — already shipped on main via #654 (the extension map + detection + extraction tests, credited to #556). This PR has been rebased and slimmed to the one piece #654 did not cover: import resolution.

Remaining gap

EXTENSION_RESOLUTION.javascript in src/resolution/import-resolver.ts did not list .xsjs / .xsjslib, so an extensionless ES import from an xsjs file —

// service.xsjs
import { buildQuery } from "./helpers";   // -> helpers.xsjslib

resolved to nothing. The cross-file call edge was dropped, so codegraph_callers / codegraph_impact reported the imported symbol as having no callers even though the import is live.

Fix

Add .xsjs, .xsjslib to the javascript entry in EXTENSION_RESOLUTION (one line). Now ./helpers resolves to helpers.xsjslib and the call edge is created.

Tests

Scope

Resolution only. The grammar/extension map is untouched here since #654 owns it now.

@maxmilian maxmilian force-pushed the fix/556-sap-xsjs-extension branch 3 times, most recently from 1564c6a to b31c3f0 Compare June 3, 2026 16:15
@maxmilian maxmilian changed the title feat(extraction): index SAP HANA .xsjs/.xsjslib as JavaScript (#556) fix(resolution): resolve ES imports targeting .xsjs/.xsjslib files (#556) Jun 3, 2026
@maxmilian maxmilian force-pushed the fix/556-sap-xsjs-extension branch 2 times, most recently from db95d38 to 9ad4224 Compare June 12, 2026 00:04
…olbymchenry#556)

The extraction half of colbymchenry#556 — indexing `.xsjs` / `.xsjslib` as JavaScript — already
landed on main via colbymchenry#654. This PR is now scoped to the remaining resolution gap:
the JS import-resolution list did not include the SAP HANA extensions, so an
extensionless `import { x } from './helpers'` in a `.xsjs` file resolved to
nothing and the cross-file call edge was dropped.

Add `.xsjs` / `.xsjslib` to the `javascript` entry in EXTENSION_RESOLUTION so
those imports resolve to their target file and `codegraph_callers` /
`codegraph_impact` see the edge. One resolution test covers the .xsjs -> .xsjslib
import; the now-redundant extraction/detection tests were dropped (covered by colbymchenry#654).
@maxmilian

Copy link
Copy Markdown
Contributor Author

Rebased onto current main.

To clarify why this is still worth landing even though #556 was closed by #654: #654 registered .xsjs/.xsjslib as JavaScript on the extraction side (grammars.ts), so those files are now parsed and indexed — but the import-resolution side was untouched. EXTENSION_RESOLUTION.javascript in import-resolver.ts still doesn't list .xsjs/.xsjslib, so an extensionless import { x } from './helpers' that targets helpers.xsjslib resolves to nothing and the cross-file call edge is dropped.

This 1-line addition closes that residual gap; the resolution test should resolve an ES import from a .xsjs file to a .xsjslib file (#556) covers it and coexists with the extraction-level .xsjs test from #654.

@maxmilian maxmilian force-pushed the fix/556-sap-xsjs-extension branch from 9ad4224 to b24f556 Compare June 17, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant