Repository navigation
Editor support: spans, the TSX projection with mappings, and a .rx language server (CP-8) - #7
Merged
Merged
Conversation
…item and attribute (CP-8) Expr and Stmt become a kind plus the byte range it was parsed from; Decl, Markup and Attr carry theirs. spans.rs checks what the spans promise (inside the source and their parent, on the line the node records, a leaf's text is its name) and ref/crate.ts runs it on all 280 programs. rxc check --json gives each diagnostic and parse error a range (line-precise, as the checker is: CN-1a). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP4zNW5bnup8XRB8md
project.rs ports ref/types/project.ts text for text and records where each name, member, literal, written type, tag and attribute it copies came from. rxc project prints the files, their mappings and the prelude. ref/crate.ts --project diffs the crate's projection against ref/'s on every accepted program and checks every mapping joins the same text (168/168, 10,337 mappings); RX_CRATE=1 npm run types checks the scenarios on it (135/135). spec/11 CP-8 records spans and the projection; decision 6 (lines) is superseded for the AST and diagnostics; decisions 7 (map only copied text) and 8 (a diagnostic's range is its line's) are taken by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP4zNW5bnup8XRB8md
parse_program_recovering leaves out a declaration that does not parse and reads a missing member name or expression as an empty one, so half-typed code still projects; ref/crate.ts checks it gives the same tree, with no errors, on every program that parses. load_modules_recovering loads with it. rxc serve answers a language server, a JSON request a line: a file's projection with UTF-16 mappings, and its diagnostics. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP4zNW5bnup8XRB8md
tooling/rx-language-server: Volar over the crate's TSX projection, through `rxc serve`. TypeScript's hover, definition, references, rename, completion and type errors map back onto .rx (exact mappings; ranges place type errors that fall between them), and the crate's parse errors and diagnostics come with their rules. test/run.js drives it over LSP on examples/shop: 16/16. tooling/vscode-rx: an IPC client that starts the server for .rx documents. spec/11: CP-8e, and decision 9 (rxc as a process per analysis, vetoable). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP4zNW5bnup8XRB8md
compiler: serve.rs holds rxc serve's requests; wasm.rs answers them as WebAssembly (wasm32-unknown-unknown, a C ABI with the host reading files). rx-language-server: loads the WebAssembly build in process (about 1 ms per analysis), or runs $RXC as before; the same answers either way, and the LSP tests pass on both. README: running it over stdio, and setup for Neovim, Helix and JetBrains (LSP4IJ). vscode-rx: build.js bundles the client, the server and rxc.wasm into dist/; npm run package makes one .vsix for every platform. README: installing, building, publishing. .github/workflows/editor.yml: builds the crate both ways, runs the LSP tests on the server and on the bundle, uploads the .vsix; a vscode-v* tag publishes to the VS Marketplace and Open VSX when their tokens are set. spec/11: decision 9 now WebAssembly in process (vetoable). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP4zNW5bnup8XRB8md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP4zNW5bnup8XRB8md
… diagnostics whole Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP4zNW5bnup8XRB8md
… document's URI Volar hands a service the root virtual code's document; its URI encodes the source's (volar-embedded-content://root/<file uri>). Decoding it with fsPath gave a path under /, which only worked where / was writable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP4zNW5bnup8XRB8md
The publish job signs in to Microsoft Entra with the job's OIDC token (azure/login, a federated credential on an identity that is a member of the publisher) and runs vsce publish --azure-credential: no stored token. Open VSX keeps a token until its CLI supports trusted publishing. The job runs in the release environment. Fixes the Open VSX step's if, which could not see a step-level env. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP4zNW5bnup8XRB8md
…n or Entra editor.yml: on main (once the variable RELEASES is on), publishes each package whose version is new and tags it. The language server goes to npm as @reactivescript/language-server by trusted publishing (OIDC, provenance); the extension to the VS Marketplace (an Entra identity if configured, else VSCE_PAT) and Open VSX (OVSX_PAT). The build packs both. rx-language-server: publishable (prepack puts rxc.wasm in src/), 0.1.0. tooling/RELEASING.md: the one-time setup and how to release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP4zNW5bnup8XRB8md
Conflicts: Cargo.toml's crate-type comment (both builds use the cdylib), emit.rs's EF-7/EF-8 call and check.rs's returns_closure/hook check ported to the span-carrying AST (ExprKind/StmtKind), spec/11's decisions renumbered (main's 7 stays; the editor's are 8, 9, 10). The projection's BUILTINS and prelude take onSettled/onFlush (ref/crate.ts --project 170/170). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP4zNW5bnup8XRB8md
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.
Requested by Ryan · project thread
This PR covers phases 2 to 4 of the editor support plan, plus packaging and releases. It now targets
main, which it has merged (#6, #10). Main's onSettled/onFlush (EF-7, EF-8) is ported to the span-carrying AST and to the projection.What's here
compiler/src/spans.rschecks them.ref/keeps lines, because it stays the grammar's spec.rxc check --json(CP-8d). Diagnostics and parse errors now come with ranges: 1-based lines, 0-based UTF-16 columns (what LSP uses), and byte offsets. A diagnostic's range covers its line's nodes (decision 9).project.rsportsref/types/project.tstext for text. It maps every piece it copies from the.rx(decision 8). It also records coarse ranges for what it writes itself, so type errors there still land on the.rx.rxc project app.rxprints it.rxc conformchecks on every program.rxc serve(serve.rs) answers a language server's requests.wasm.rsanswers the same requests from the crate built forwasm32-unknown-unknown.tooling/rx-language-serveris a Volar server that runs the WebAssembly build in process (about 1 ms per analysis), or a nativerxcwhen$RXCis set. It gives TypeScript's hover, definition, references, rename, completion and type errors on.rx, plus the crate's diagnostics with their rule IDs. The README covers Neovim, Helix and JetBrains.tooling/vscode-rxkeeps the existing grammar and adds a client.npm run packagebuilds one.vsixfor every platform..github/workflows/editor.ymlbuilds the crate both ways and runs the LSP tests on the server (WebAssembly and native) and on the extension's bundle. It also packs the.vsixand the npm package.main, and only happens once the repo variableRELEASESison. Then:@reactivescript/language-server(0.1.0) goes to npm by trusted publishing.VSCE_PAT) and to Open VSX (OVSX_PAT).tooling/RELEASING.md.Verification (after merging main)
npm --prefix ref run cratenpm --prefix ref run crate -- --projecttypes/project.ts; 264 files, 10,372 mappings, all holdingRX_CRATE=1 npm --prefix ref run typesnpm --prefix ref run crate -- --lowerRX_CRATE=1 npm --prefix ref run compiled/ssrcargo test,cargo check --features node, the wasm32 buildnode tooling/rx-language-server/test/run.jsdist/server.js; CI also runs it on nativerxcThe extension has not been tried inside VS Code itself, because the download is blocked in my sandbox.
Decisions taken by default (veto in spec/11)
.vsixcovers all platforms. This build answers only the editor's requests. It is not decision 7's missing WebAssembly fallback for compiling.Not here
🤖 Generated with Claude Code
https://claude.ai/code/session_0117BoWP4zNW5bnup8XRB8md