Repository navigation
Conversation
Without writ-lsp the extension highlights and does nothing else, and the only fix it offered was an opam pin typed into a terminal: an OCaml toolchain and minutes of building, for someone who wanted an editor. writ already publishes a release tarball per Linux architecture, with a .sha256 beside it, and the tarball holds everything the extension needs: writ-lsp, the `writ` the verbs run, and the stdlib at share/writ/lib, where the resolver looks relative to the binary. src/download.js fetches the tarball for this platform, verifies its checksum and unpacks it into the extension's global storage, renaming it into place in one step so an interrupted download never counts as an install. It takes the release tagged with this extension's version, or the latest release when that version was never released; the panel's version verdict then says so. A download is the LAST candidate in locate.candidates, after PATH: a writ installed by hand is a choice someone made, and a download is the fallback for having none. For the same reason the panel offers the button only with no server at all, or when the server in use is itself a download. Anywhere else it would fetch an engine that never runs, so those cases get the opam route. The button appears in the panel, in the "no language server" error, and as Writ: Download writ in the Command Palette. After a download the client is restarted through the same reload a changed setting uses, now one function in extension.js. Platforms with no tarball (macOS, Windows) are told to use opam. test/download.test.js covers the tarball names, checksum parsing, what counts as an install and their order, the search-order placement, and when the panel offers the button. WRIT_DOWNLOAD_LIVE=1 also downloads the real release and runs it. Co-Authored-By: Claude Opus 5.5 <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.
Why
Without
writ-lspthe extension only highlights syntax. The one fix it offered was an opam pin typed into a terminal, which needs an OCaml toolchain and minutes of building just to get an editor working. writ already publishes a release tarball for each Linux architecture, with a checksum beside it. That tarball holds everything the extension needs:writ-lsp, thewritCLI the verbs run, and the standard library where the resolver looks for it.What
A Download writ button appears in three places:
Clicking it does this:
.sha256. On a mismatch the download is deleted, not unpacked.PATH, and uninstalling the extension removes it.extension.js.A hand-installed writ always wins. A download is the last place the extension looks, after
PATH. For the same reason, the panel offers the button only when there's no server at all, or when the server in use is itself a download. Anywhere else the download would never run, so those cases get the opam option instead.macOS and Windows have no release tarball yet, so they are pointed to opam.
Verified
test/download.test.jsadds 25 offline checks for tarball names, checksum parsing, what counts as an install and in what order, search-order placement, and when the panel offers the button. Putting a download ahead ofPATHon purpose makes two of them fail.WRIT_DOWNLOAD_LIVE=1, the test downloads the real v0.2.0 release and runs it. All 28 checks succeed.Worth knowing
scripts/version.sh --from-writbefore the next extension release makes the two match exactly.🤖 Generated with Claude Code