chunk 2/13: parser LANGUAGES descriptor (single source of truth)#2
Merged
Conversation
LANGUAGES declares id/displayName/extensions/grammarPackage/callGraph/ highlightId/load per language in one place, replacing the ~7 hand-synced sites that drift today. callGraph is designed once here (ts semantic, python heuristic, cpp/rust/r none) and consumed later by getSupport and python-callgraph. highlightOverrides preserves the per-extension .js/.jsx->javascript vs .ts/.tsx->typescript split. Pure additive — no consumer imports it yet; the registry/config/scan migrations follow. Implements: 1-package-hardening/PH-D-01 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes the toggle-noop: a source file whose grammar is not installed rendered a live "watch" dot (static isSupportedFile) that silently did nothing on click (runtime registry returns null). getSupport reconciles static vs runtime and reads installHint/callGraph from the LANGUAGES descriptor. worktree bakes parsable/needsGrammar/installHint/callGraph into ITreeNode + browser FileNode; the renderer adds a muted needs-grammar marker (not a toggle) with an "Install <pkg>" hint, leaving the existing toggle path byte-identical. callGraph now rides per-file into the vis payload for python-callgraph's badge. Implements: 1-package-hardening/PH-04 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the bespoke TypeScript block and four copy-paste tryRegisterOptional blocks with one data-driven loop over LANGUAGES: no-grammar entries register eagerly via descriptor.load(); grammar-backed entries go through the missing/active try/catch (MODULE_NOT_FOUND -> missing). Adding a language no longer edits registry.ts. Active/missing summary output and duplicate guards preserved. Implements: 1-package-hardening/PH-D-02 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… drop .dart ALL_SUPPORTED_EXTENSIONS = LANGUAGES.flatMap(extensions); getLanguageFromPath looks up the descriptor (highlightOverrides[ext] ?? highlightId, default 'code', case-insensitive). Deletes the four eager adapter imports (config-load no longer pulls the adapter tree) and the .dart->'dart' ghost (no Dart adapter). The .js/.jsx->javascript vs .ts/.tsx->typescript split is preserved via the typescript descriptor's highlightOverrides. Implements: 1-package-hardening/PH-D-03 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Build the ext->grammar-package hint map from LANGUAGES.filter(grammarPackage) instead of a fourth hand-maintained map. cpp extension coverage audited (all of .c/.h/.cpp/.hpp/.cc/.cxx/.hxx present). C/C++ family display collapsing (CPP_FAMILY_EXTS, formatUnsupportedSourceHints) left hand-owned. The .r hint collapses to the single descriptor package @davisvaughan/tree-sitter-r. Implements: 1-package-hardening/PH-D-04 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…_FOLDERS The explorer kept a divergent ALWAYS_IGNORED set that omitted venvs/target/dist/ build/.arch, so the tree rendered large vendored trees the scanner skips (clickable dead files + walk cost). worktree.ts now consumes IGNORED_FOLDERS as the single source; .DS_Store (a file name, matched per-entry) and .llmem (the centralized root, one folder name ignores the whole tree) are folded into the shared set. Drops the now-stale worktree.ts row from the .artifacts allowlist (the literal moved to config.ts, already allowlisted). Implements: 1-package-hardening/PH-07 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
scripts/check-langs.ts asserts package.json optional grammar peerDeps == LANGUAGES grammar packages (bidirectional) and that the README languages table mentions each language + grammar package; wired into CI. README gains a descriptor-mirrored Languages table + node-gyp/optional-grammar toolchain note. ADDING_LANGUAGES.md / LANGUAGE_ROADMAP.md rewritten to the single-descriptor flow (one LANGUAGES entry + adapter + peerDep), dropping the stale getLanguageFromPath/registry/config edit steps. Docs honestly mark Python import-only (heuristic call graph not wired until the python-callgraph plan). Implements: 1-package-hardening/PH-D-05 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Chunk 2/13. Introduces src/parser/languages.ts as the single source of truth and drives ParserRegistry, config.ts ext/highlight maps, install hints, and webview ignore lists from it; adds registry.getSupport() 3-state affordance and the check:langs parity gate.
🤖 Generated with Claude Code