char/avril

(wip) why'd you have to go and make things so complicaaaaated?

git clone https://git.t4t.associates/char/avril

Charlotte Somdeslop: factor module prep/transpilatione/etc into loader.rsab5df08

main
3 files

files

README.md4.7 KiB
bridge.patch50.7 KiB
build.sh1.2 KiB

Pinned native TypeScript patch

bridge.patch targets Microsoft/TypeScript commit b5c34ba0c61a756c8abaf133236dddf982c27f45. It exposes the native language service through the existing --api --async transport, retaining API-owned synthetic programs, snapshots, static module resolutions and filesystem controls. There is no second project-discovery lifecycle.

Build and maintenance

See installation. build.sh CHECKOUT [OUTPUT] verifies the exact revision and checks patch applicability before applying it. It never resets or cleans a checkout. It stamps the pinned distribution version with upstream's supported linker variable and embeds upstream library resources. Go downloads the toolchain selected by the upstream module when necessary. The executable must be trusted; callbacks are not an OS sandbox.

Keep changes here as an upstream patch, not a checked-in compiler copy. On an upgrade, apply to the new exact revision, run the native API/IPC/auto-import tests and Avril's real-backend workspace tests, then update the pin and build version together. The added Go regression tests are part of the patch.

Protocol v1

Language-service converters use UTF-16 without changing the ordinary API's UTF-8 snapshot convention. Rust maps locations, edits and document links, binds opaque continuations to generations, and rejects read-only edit sets atomically. Native completion and code-lens data must not be forwarded from an editor without that binding. Native code actions are eager; resolving one is a validated round-trip of its already-materialized edit.

Surface and limits

The patch exposes native hover, signature help, completion/resolve, definition/type definition/implementation, references, rename/prepare, highlights, document/workspace symbols, folding, selection, full/range semantic tokens, inlay hints, linked editing, call hierarchy, code lenses/resolve, diagnostics, formatting (document/range/on-type), and native code actions (including organize imports and fixes).

This does not turn the pinned native implementation into all of classic tsserver. Its full refactor catalog and type hierarchy are not implemented upstream. File moves/import updates and arbitrary execute-command requests are not exposed. No unsupported provider is advertised. See the frontend limits for acquisition, indexing and incremental-session limitations.

Native regression tests

In the patched checkout's tsc/ directory:

go test ./internal/api ./internal/ipc ./internal/ls/autoimport

The added tests exercise synthetic API snapshots (not discovered projects), graph-scoped completion/resolve and denial, preferences, UTF-16, explicitly scoped cross-program references/rename/call hierarchy, library membership, and request cancellation without disconnecting the API transport. Avril's CLI integration tests cover original URI mapping, immutable dependency edits, resolver authority, stale data and live graph refreshes end to end.