ide: grammars for file types of another name; a refused install leaves no directory behind
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
3 files changed
+38
No files matched your search
@@ -85,6 +85,13 @@ itself where its source is at hand.
|
||||
- Everything is built in a staging directory and started there once before it replaces what is installed; a failure leaves things exactly as they were. `--dry-run` prints every action.
|
||||
- `scripts/test-ide.sh` tests it; `scripts/package-ide.sh` writes the release files (`install.sh`, `llembas-ide-<version>.tar.gz`, `SHA256SUMS`).
|
||||
|
||||
### Fixed (LLeMbas IDE)
|
||||
|
||||
- Shell scripts and TSX files are coloured by their compiled grammars: a file type whose name is
|
||||
not its grammar's (`sh`, `typescriptreact`, `javascriptreact`, `jsonc`) had none started for it.
|
||||
- An install that is refused leaves nothing behind, not even the empty directories above its
|
||||
prefix, and a release address that is not `https://` is refused in words.
|
||||
|
||||
## [1.0.0-beta.5] — 2026-11-27
|
||||
|
||||
### Fixed (VS Code / VSCodium)
|
||||
|
||||
@@ -6,6 +6,16 @@ local M = {}
|
||||
|
||||
M.compiled = false
|
||||
|
||||
--- A grammar, and the file types it colours beside the one of its own name.
|
||||
M.filetypes = {
|
||||
bash = { "sh" },
|
||||
tsx = { "typescriptreact" },
|
||||
javascript = { "javascriptreact" },
|
||||
vimdoc = { "help" },
|
||||
json = { "jsonc" },
|
||||
html = { "xhtml" },
|
||||
}
|
||||
|
||||
local function parsers_dir()
|
||||
local dir = require("llembas_ide").prefix .. "/site/pack/llembas/start/llembas-parsers/parser"
|
||||
return vim.fn.isdirectory(dir) == 1 and dir or nil
|
||||
@@ -19,6 +29,13 @@ function M.setup()
|
||||
local ok = pcall(vim.cmd.packadd, "nvim-treesitter")
|
||||
if ok and pcall(require, "nvim-treesitter.query_predicates") then
|
||||
M.compiled = true
|
||||
-- File types whose name is not their grammar's. nvim-treesitter names these when it starts
|
||||
-- up; its start-up is off here, so they are named here, for the grammars that are compiled.
|
||||
local has = {}
|
||||
for _, lang in ipairs(M.languages()) do has[lang] = true end
|
||||
for lang, fts in pairs(M.filetypes) do
|
||||
if has[lang] then pcall(vim.treesitter.language.register, lang, fts) end
|
||||
end
|
||||
else
|
||||
table.insert(require("llembas_ide").problems, "treesitter: grammars are compiled but nvim-treesitter's queries are missing")
|
||||
end
|
||||
|
||||
@@ -73,6 +73,7 @@ DRY=0
|
||||
TMP=""
|
||||
STAGE=""
|
||||
OLD=""
|
||||
MADE=""
|
||||
SWAPPED=()
|
||||
PLACED=()
|
||||
DONE=0
|
||||
@@ -122,6 +123,11 @@ cleanup() {
|
||||
# A prefix this run made and left empty goes again.
|
||||
if [ -n "$PREFIX" ] && [ -d "$PREFIX" ] && [ "$DONE" != 1 ]; then
|
||||
rmdir "$PREFIX/site/pack" "$PREFIX/site" "$PREFIX" 2>/dev/null || true
|
||||
if [ ! -d "$PREFIX" ] && [ -n "${MADE:-}" ]; then
|
||||
while IFS= read -r made; do
|
||||
[ -z "$made" ] || rmdir "$made" 2>/dev/null || break
|
||||
done <<<"$MADE"
|
||||
fi
|
||||
fi
|
||||
exit "$status"
|
||||
}
|
||||
@@ -587,6 +593,14 @@ install_from() {
|
||||
say "LLeMbas IDE $version (dry run: nothing is downloaded or written)"
|
||||
else
|
||||
say "LLeMbas IDE $version"
|
||||
# The directories above the prefix that are not there yet: made now, and taken away again,
|
||||
# deepest first, if this run ends with nothing installed.
|
||||
MADE=""
|
||||
up="$(dirname "$PREFIX")"
|
||||
while [ ! -d "$up" ] && [ "$up" != / ] && [ "$up" != . ]; do
|
||||
MADE="$MADE$up"$'\n'
|
||||
up="$(dirname "$up")"
|
||||
done
|
||||
mkdir -p "$PREFIX"
|
||||
TMP="$(mktemp -d)"
|
||||
STAGE="$(mktemp -d "$PREFIX/.staging.XXXXXX")"
|
||||
|
||||
Reference in new issue
Block a user