Skip to content

Fix pre rename install - #1

Open
sajonaro wants to merge 2 commits into
mainfrom
fix-pre-rename-install
Open

Fix pre rename install#1
sajonaro wants to merge 2 commits into
mainfrom
fix-pre-rename-install

Conversation

@sajonaro

Copy link
Copy Markdown
Contributor

No description provided.

…checkout

The extension appeared in the marketplace pane as `pol`, flagged "invalid
extensions detected", offering to Install Locally a thing that was not there.

An install made before "rename: pol becomes writ" is a symlink named
pol.pol-0.1.0 pointing into a directory the rename took away. VS Code scans its
extensions directory, cannot read a manifest through a dangling link, and
reports the extension as invalid — naming `pol`, which the user cannot remove
from the UI, because there is nothing behind it to uninstall. The entry in
extensions.json outlives the directory and is what keeps re-reporting it.

install.sh only ever removed writ.writ-0.1.0, so nothing cleaned this up: the
rename shipped without a migration path, and every pre-rename install stayed
broken and visible. It now purges legacy ids on INSTALL as well as uninstall —
the person hitting this is installing the new extension, not remembering an old
one — and tests `-e` OR `-L`, because `-e` is false for exactly the dangling
case being cleaned. The removal is of the link, never through it, which would
delete a live checkout.

Underneath that sat a second failure the first one hid. candidates() joined the
relative default onto workspace folders only, so the split into separate writ/
and writ-vscode/ repositories broke it: the natural thing to open is the
directory holding both, and the default then resolves against a folder with no
_build in it. The extension said "no language server" with a perfectly good one
a single directory down — the same symptom as never having built it, which
sends you off to check the wrong thing entirely. It now also tries checkouts one
level below each workspace folder, identified by dune-project rather than by
being named `writ`. One level, deliberately: this must not become a walk of the
workspace, which on a large tree would cost more than it saves.

install.sh had the same blind spot from the other side, looking only at
$here/../.. for the engine — which in the split layout is the directory
containing both repositories and never the engine itself. It now accepts
$WRIT_REPO, ../.., or ../writ. Its verify step no longer pipes into an empty
command name when there is no server to verify, which reported a shell error
about "" rather than the thing that was actually true.

TESTED, because all of this fails silently. test-resolve.js gains the split
layout, exercised against a real directory tree: that a checkout one level down
is found, that the workspace root still wins, that a sibling which is not a
checkout is not guessed at, that the nested build still beats PATH, and that a
workspace folder which does not exist is survivable rather than fatal at
activation. The legacy purge was checked by recreating the dangling symlink and
re-running the installer against it.

Also: package-lock.json still called the package politics-constructor, and the
run-path comments still named tooling/vscode/, which no longer exists.
…t of the .vsix

The grammar's comments said .afk-flow/check-grammar.py asserts the guard, effect
and rules-builtin alternations against the engine, and told the reader to keep
them as whole ( | ) alternatives so that it could. No such script is in this
repository, or in writ's.

The word lists are still right — they match `guard_words` and `builtins` in
core/syntax/rules_parser.ml, checked by hand here — but a comment promising a
check that does not run is worse than no comment at all: it is exactly why
nobody notices when the grammar drifts from the engine. The formatting rule
stays, now with the reason that is actually true: so the sets can be diffed
against that list by eye, and so a word added to the engine is visibly missing
here.

Only the "comment" fields changed. Every match regex is untouched, so nothing
about the highlighting moves.

.vscodeignore additionally keeps the tests, install.sh, the lockfile, .mailmap
and .github/ out of a .vsix — shipping the installer inside the thing it
installs is a loop that can only confuse, and the rest is repository plumbing
that is invisible in the source tree and rides along unnoticed. docs/ stays in
deliberately, because README.md embeds docs/images/writ-mark-200.png and the
marketplace page loses its mark without it, as do LICENSE, NOTICE and AUTHORS,
which ship with the work.

VERIFIED with vsce rather than reasoned about, which is how .mailmap and
.github/ were found at all — nothing else lists them. `vsce package` now yields
340 files, of which exactly fourteen are this extension's: the manifest, the
client, the grammar, the language configuration, the icon, the README and its
images, and the notices. The other 326 are node_modules and vsce's own two
generated manifests.
@sajonaro
sajonaro force-pushed the fix-pre-rename-install branch from 4619f89 to 974b2f1 Compare August 14, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant