Claude/ci feature feasibility kcr1ox - #15
Merged
Merged
Conversation
Proposes LSP support as an opt-in, non-blocking, additive-only upgrade layer on top of the existing tree-sitter + Conservative/StackGraph resolvers, rather than a wholesale replacement — preserves the current latency budget, robustness on unbuilt/mid-edit code, and zero-dependency install story. Includes a concrete Go/gopls pilot plan with go/no-go criteria before extending to other languages. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011WM8tSCKenMmkoDYLCmoRe
Adds FormalResolver::load_typescript, wired into both the full and incremental indexing pipelines alongside the existing Python formal tier. Closes most of the "5/6 Tier-0 languages are heuristic-only" gap identified while researching ADR-0004's LSP proposal — this was flagged there as the cheaper win to do first. tree-sitter-stack-graphs-typescript 0.4.0 pins tree-sitter-typescript =0.23.2, which is exactly what the workspace already resolves to — zero dependency conflict. .tsx is handled as a distinct grammar/config (TsxVariant), dispatched by file extension inside resolve_file, since ci's own language string treats .ts/.tsx as one "typescript" language. Unlike Python (DEBT-005), upstream's builtins.ts is non-empty and resolves real ECMAScript globals out of the box — verified by test (Array/isArray resolve; console does not, correctly, since it's a host global, not core ECMAScript) rather than assumed from file size. JavaScript and Java are intentionally not included here: both ship empty builtins like Python originally did, but investigation (recorded in ADR-0002's update) found the builtins-resolution mechanism differs significantly per language — JS wires primitives inline per-file rather than through the <builtins> fallback file Python/TS use, and Java's stack-graphs.tsg has no builtins concept at all. Porting PYTHON_BUILTINS_STUB blind would not have worked for either. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011WM8tSCKenMmkoDYLCmoRe
ci previously only walked `import_statement` nodes for JavaScript and
TypeScript, so `const foo = require('./foo')` never populated
import_map/import_edges — calls through it stayed at textual
confidence instead of resolved, and it never showed up as a file
dependency. require() is a call expression, not an import_statement,
so it needed a separate extraction path (parse_js_require) fed by
variable_declarator text instead, tried after the existing ESM import
parse fails.
Only literal string arguments resolve — require(computedPath) is left
unattributed rather than guessed at, consistent with the rest of this
module's "unrecognised form yields no binding" philosophy. Handles
both `const x = require('m')` and `const { a, b: c } = require('m')`
destructuring.
Still common in real Node.js code (older packages, TS compiled to
CommonJS) — found while researching Stack Graphs formal resolution
for JavaScript, which turned out to need much more (new .tsg rule
authoring, see ADR-0002's update) for comparatively less payoff than
this at the resolved tier.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011WM8tSCKenMmkoDYLCmoRe
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.
No description provided.