Add LSP, server-process, compiler-mode, and offset tests - #5
Merged
NullVoxPopuli merged 2 commits intoAug 26, 2026
Merged
Conversation
- test/lsp.js drives tsc --lsp with runExternalCode against the nvp-app example: hover, go-to-definition (template to component, .ts import to .gts), completions inside a template, pull diagnostics at the exact template range, and rename, whose edits must land only on length-preserving Verbatim mappings. - test/server.js spawns lib/server.js over stdio with vscode-jsonrpc and exercises initialize, openProject (identity and option diagnostics), transform (templates, passthrough, parse failure), unknown handles, and closeProject. - test/modes.js covers declaration emit (Greeting.gts emits Greeting.d.gts.ts, snapshotted) and --build: the first build transforms the component, the up-to-date build transforms nothing. - diagnostics-tests/invalid-options records how TypeScript renders the mapper's option diagnostics inside tsconfig.json; unicode.gts and crlf.gts (kept CRLF via .gitattributes) pin UTF-16 position handling. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
NullVoxPopuli-ai-agent
force-pushed
the
more-tests
branch
from
August 26, 2026 02:14
cdbe4f2 to
adf5e22
Compare
Replaces the hand-rolled JSON-RPC client with vscode-jsonrpc's connection (already a runtime dependency) and the typed request definitions from vscode-languageserver-protocol, which also type the results. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
NullVoxPopuli
approved these changes
Aug 26, 2026
Merged
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.
Covers the three surfaces the suite did not exercise before. All of the editor bugs found so far were invisible to the CLI-only tests.
LSP end to end (
test/lsp.js): spawnstsc --lsp --stdiowithrunExternalCodeagainstexamples/nvp-appand asserts on real requests: hover on<Counter>in a template, go-to-definition from a template intocounter.gtsand from a.tsimport into a.gtsmodule, completions after{{yield this.listing the component members, pull diagnostics at the exact template range, and rename. Rename is the strictest check: TypeScript writes edits only through length-preserving Verbatim mappings, so every edit range must cover exactly the identifier (it does: the import specifier becomesCounter as Tallyand the opening tag is renamed; the closing tag has no counterpart in the transformed output).The server process (
test/server.js):lib/server.jshad no tests; the unit tests call the handlers in-process. This spawns it over stdio withvscode-jsonrpcand runs initialize, openProject (config identity, option diagnostics), transform (template, passthrough, unparseable file), an unknown project handle (JSON-RPC error), and closeProject.Compiler modes (
test/modes.js,diagnostics-tests/):Greeting.gtsemitsGreeting.d.gts.tswith the TOC signature (snapshotted). Note TS 7 requires an explicitrootDir, and the emittedindex.d.tskeeps the./Greeting.gtsspecifier.--build: the first build transforms the component once; the second, up-to-date build transforms nothing (it still sendsopenProjectbecause the mapper declaresdynamicConfig, as specified).contentMappers[].options: TypeScript renders the mapper'soptionDiagnosticsat the offending values insidetsconfig.json(tsconfig.json(13,30): error glint0: 'additionalGlobals' must be an array of strings.).Offsets:
unicode.gts(emoji and non-ASCII before the error) andcrlf.gts(kept CRLF via.gitattributes) pin UTF-16 position handling; both report at the correct column.Counts: unit 20 → includes 7 server tests; typecheck suite 16 (five test-packages, three diagnostics projects, two mode tests, six LSP tests).
test:unit/test:typecheckscripts updated; CI unchanged.🤖 Generated with Claude Code