If the base major mode doesn't exist, let's assume we want no
fallthrough for this major mode (in the event the grammar isn't ready)
and simply push forward anyway, even if a missing grammar results in a
broken state.
This will particularly affect major modes like `typescript-mode` (which
simply won't be installed if +tree-sitter is enabled) and
`go-{mod,work}-ts-mode` (for which no base major modes exist).
The difference (generally) between most base and ts-modes is
performance, not features, so "gracefully failing back to the base mode"
makes sense UX-wise, but `typescript-mode` notably inferior to
`typescript-ts-mode` (particularly in its TSX support). Beginners may
misidentify its shortcomings as bugs, so it's better to simply error out
early so the user can be made aware of the problem sooner and less
ambiguously.
In Emacs <=30, top-level `treesit-ready-p` calls in various *-ts-mode
packages (like lua-ts-mode or ruby-ts-mode) are commonplace, and they
throw up a warning popup if the grammar isn't available at load time.
This is intrusive. Instead, this forces it to log to *Messages* instead
before falling back to the normal major mode.
Fortunately, these top-level `treesit-ready-p` calls have been removed
in most *-ts-mode packages in 31+, but this still impacts users on <=30
or using third party *-ts-modes that haven't adapted.
However, this doesn't suppress the warning when opening a *-ts-mode.el
file (thanks to the byte-compiler).
I removed the grammar recipes in 3b58741 to avoid redundancy with the
upstream recipes, but didn't realize that those upstream recipes weren't
added until Emacs 31, so users on 30 and older would get errors when
trying to install any missing grammars.
This also establishes a hard dependency between :lang (php +tree-sitter)
and :lang ({javascript,web} +tree-sitter).
Amend: 3b58741522
BREAKING CHANGE: This commit removes a number of core packages and
features from this module and only replaces a handful of them, so that
we can lean more on LSP and tree-sitter. To be specific:
- We used to rely on `rjsx-mode` (derived from js2-mode) for total
JS/JSX support (though imperfect; Emacs was starved for options at the
time). This has now been replaced with `js-ts-mode` (built-in after
Emacs 29), falling back to `js-mode` (very rudimentary, but a decent
fallback).
- This also meant the removal of `js2-mode`, which `skewer-mode`,
`js2-refactor`, and `xref-js2` depended on, so those were removed
too, and have *somewhat* been replaced with LSP integration (offers
jump-to-definition/references and *some* refactoring actions, but no
replacement for skewer's functionality).
- Typescript support no longer relies on the jury-rigged, web-mode-derived
major mode (because TSX support in the upstream `typescript-mode`
isn't great). We now use `typescript-ts-mode` (built-in into Emacs
29.1+), falling back to `typescript-mode`.
- JSX/TSX support now *requires* tree-sitter (and Emacs 29.1+), where
`tsx-ts-mode` is available and outshines all the alternatives (at the
time of writing).
Due to the absolute chaos that is webdev, this module sacrifices some of
the graceful-degradation I've implemented for other modules and creates
a hard requirement on tree-sitter and Emacs 29.1+ for JSX/TSX. It still
tries to degrade gracefully for plain JS and TS, but the module's doctor
and docs will actively recommend tree-sitter.
Close: #5278Fix: #6172Fix: #7042Close: #8447
Co-authored-by: ribaricplusplus <ribaricplusplus@users.noreply.github.com>
This is temporary until a better solution is found.
This advice does nothing for lsp-mode without the accompanying
`jsonrpc--json-read` advice eglot-booster uses. Needs more testing to
make sure it's worth the trouble on Emacs 30+ and is compatible with
`lsp-use-plists`.
Ref: #8463
Amend: 1ede94c88a
If a buffer had multiple LSP servers active,
`+lsp-defer-server-shutdown-a` would only shut down the first. This
adjusts it to not only defer shutdown of all servers, but also ensures
`+lsp-optimization-mode` is only disabled when there are no lsp-mode
sessions left.
Fix: #5409
Forge depends on ghub, and ghub requires 29.1+, so Forge has dropped
backwards compatibility (plus, code-review depends on Forge).
Also adds a doctor check for this constraint.
Fix: #8419
Ref: magit/forge@35224e5dd4
Leave it to users to implement this, if they want this, but not only
might it cause confusion, but users may want a clean slate every time
they launch a new debugging session in the same project.
Fix: #8407
magit/transient@HEAD -> magit/transient@25b994a565
Seems to be a source of many issues the past month or so. About time we
pin it by stable release.
Fix: #8394
Not a complete fix, because +vc-gutter-update-h isn't aggressive or
responsive enough to changes in VC in buffers that haven't changed, but
I'll address that later.