feat(extraction): index SAP HANA .xsjs/.xsjslib as JavaScript (#556)#594
Open
maxmilian wants to merge 1 commit into
Open
feat(extraction): index SAP HANA .xsjs/.xsjslib as JavaScript (#556)#594maxmilian wants to merge 1 commit into
maxmilian wants to merge 1 commit into
Conversation
d62e14a to
70eaf94
Compare
…chenry#556) SAP HANA 1.0 XS classic `.xsjs` services and `.xsjslib` libraries are plain JavaScript but were skipped because their extensions weren't mapped. Map both to the JavaScript grammar via EXTENSION_MAP (the single source of truth for both index selection and grammar choice), so their symbols are extracted and surface in search/callers/callees/trace. Also add the two extensions to the JS import-path resolution list so an ES-style `import './helper'` from a .xsjs file can resolve to a .xsjslib/.xsjs file. Tests: extension detection + an end-to-end index (with SAP `$.import` / `$.db` globals present) proving functions are extracted from .xsjs/.xsjslib, not just file-level tracking. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
70eaf94 to
1564c6a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #556. SAP HANA 1.0 XS classic
.xsjs(services) and.xsjslib(libraries) are plain JavaScript (SAP docs), but their extensions weren't mapped, so CodeGraph skipped them entirely.Fix
.xsjsand.xsjslib→javascriptinEXTENSION_MAP. That map is the single source of truth for both "should we index this file" (isSourceFilederives from it) and grammar selection, so this one change makes the files index and parse with the JS grammar — their functions then surface in search / callers / callees / trace.import './helper'from a.xsjs/.xsjslibfile resolves to the right on-disk file (removes the asymmetry of indexing the files but not resolving imports between them).Tests (
__tests__/extraction.test.ts).xsjs/.xsjslib→javascript..xsjs(containing SAP$.import/$.dbglobals) and a.xsjslibfile tracks both as JavaScript and extracts their function symbols — proving the JS grammar runs and tolerates SAP runtime globals, not just file-level tracking.Full suite green locally (
npm test).Scope
Extension + import-path mapping only — no SAP-specific runtime modeling (
$.import,$.db, …); those are ordinary member-access/call expressions to the JS grammar (parsed fine, simply unresolved).$.import(...)-based module loading is not turned into edges; that would be SAP-specific resolution beyond this change.