Repository navigation
fix(editor): deno runtime detection - #3111
Merged
Merged
Conversation
atk
force-pushed
the
fix/editor/deno-runtime-detection
branch
from
August 31, 2026 10:58
62aded4 to
d61a928
Compare
Owner
|
Heads up so this isn't duplicated work: #3159 includes the runtime check from this PR, built on @atk's diagnosis in #2981 (the Two differences from the version here:
@atk, the decision on how to land this is the maintainer's, not mine: #3159 can be rebased onto your commit if you'd prefer the authorship to sit here, or this PR closed in favour of it. Either is fine by me — thanks for tracking the cause down. Generated by Claude Code |
Owner
|
I'll merge this one and add a follow-up to move this all out of the rust core and into a plugin |
sinelaw
force-pushed
the
fix/editor/deno-runtime-detection
branch
from
September 3, 2026 06:00
d61a928 to
13d3362
Compare
sinelaw
force-pushed
the
fix/editor/deno-runtime-detection
branch
from
September 3, 2026 06:02
13d3362 to
8a7602d
Compare
sinelaw
pushed a commit
that referenced
this pull request
Sep 3, 2026
#2981 is being taken by #3111 and then reworked so the detection is not hard-coded in the editor core at all, so it does not belong here. This removes the whole #2981 half: the `deno_lsp_override` extraction and its bounded authority probe, the `command_exists_via_authority_within` helper that existed only for it, the `server_command` on `AsyncMessage::LspError` and the install-help changes in `lsp_help.ts` that go with it, plus the changelog entry and the unit tests for the detection. `configure_lsp_servers` is back to master's version verbatim. What remains is #2197 (LSP request timeouts stop being silent) and #722 (inlay hints stop drifting on an edit at their anchor). Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SHsuKyMdSZ7soeFzDziRNw
Owner
|
🙏 |
sinelaw
pushed a commit
that referenced
this pull request
Sep 3, 2026
#3111 landed as a squash, so the two commits this branch carried from it no longer match master's history. The Deno block master reintroduces is the one this branch moves into `plugins/deno_lsp.ts`; the runtime check it added is preserved there. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SHsuKyMdSZ7soeFzDziRNw
sinelaw
pushed a commit
that referenced
this pull request
Sep 3, 2026
`std::env` and `Path` came back with the merge of #3111; nothing in `window/mod.rs` uses them now that the detection lives in the plugin. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SHsuKyMdSZ7soeFzDziRNw
sinelaw
pushed a commit
that referenced
this pull request
Sep 3, 2026
#3111 (now on master) added the runtime check this keeps. What changes here is where the convention lives. `configure_lsp_servers` hard-coded one project convention — a root with a `deno.json` or `deno.jsonc` is served by `deno lsp` — into window construction. That is a claim about projects, not about the editor: it cannot be turned off, inspected or replaced without a rebuild, every further convention costs another branch in the same function, and the check had to be written twice (marker file, then runtime) inside code whose job is wiring a manager. It is now `plugins/deno_lsp.ts`, which: * switches JavaScript and TypeScript to `deno lsp` when the active window's root has a `deno.json`/`deno.jsonc` **and** `deno` is on PATH, * puts back what was configured before when a window without one becomes active — captured from the live config before the first override, so the user's own entry comes back rather than a guess at it, * caches its decision per root, so re-evaluating on window and buffer changes costs nothing. `configure_lsp_servers` loses the block, its `root` parameter (nothing else used it) and the `Path`/`env` imports that came with #3111's check. Two differences from the core version, both noted in the plugin: `registerLspServer` applies to the active window and the runtime config rather than per window root, which is why the choice is re-evaluated when the active window changes; and the choice lands when the plugin loads, so a server already spawned keeps its command until restarted — in the default configuration JS/TS are `auto_start: false`, so nothing has started that early. Tests drive the real plugin through the harness: a Deno project with the runtime installed switches (and JavaScript switches with TypeScript), a Deno project without it keeps the configured server (#2981), and a project with no marker file is untouched. They pin the process globals, since `PATH` is one and these run as threads of one binary. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SHsuKyMdSZ7soeFzDziRNw
sinelaw
pushed a commit
that referenced
this pull request
Sep 3, 2026
`configure_lsp_servers` hard-coded one project convention — a root with a `deno.json` or `deno.jsonc` is served by `deno lsp` — into window construction. That is a claim about projects, not about the editor: it cannot be turned off, inspected or replaced without a rebuild, and every further convention costs another branch in code whose job is wiring a manager. #3111 had to add its runtime check inside that same block. It is now `plugins/deno_lsp.ts`, which switches JavaScript and TypeScript to `deno lsp` when the active window's root has the marker file and `deno` is on PATH, puts back what was configured before when a window without one becomes active, and caches its decision per root. `configure_lsp_servers` loses the block, its `root` parameter and the `Path`/`env` imports. Two differences from the core version, both noted in the plugin: the choice follows the active window rather than being fixed per window root, and it lands when the plugin loads, so an already-spawned server keeps its command until restarted (JS/TS are `auto_start: false` by default). Tests drive the real plugin through the harness: a Deno project with the runtime installed switches (and JavaScript switches with TypeScript), a Deno project without it keeps the configured server (#2981), and a project with no marker file is untouched. They pin the process globals, since `PATH` is one and these run as threads of one binary. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SHsuKyMdSZ7soeFzDziRNw
sinelaw
pushed a commit
that referenced
this pull request
Sep 3, 2026
`configure_lsp_servers` hard-coded one project convention — a root with a `deno.json` or `deno.jsonc` is served by `deno lsp` — into window construction. That is a claim about projects, not about the editor: it cannot be turned off, inspected or replaced without a rebuild, and every further convention costs another branch in code whose job is wiring a manager. #3111 had to add its runtime check inside that same block. It is now `plugins/deno_lsp.ts`, which switches JavaScript and TypeScript to `deno lsp` when the active window's root has the marker file and `deno` is on PATH, puts back what was configured before when a window without one becomes active, and caches its decision per root. `configure_lsp_servers` loses the block, its `root` parameter and the `Path`/`env` imports. A language the user turned off is left alone in both directions: the "Disable" rows persist `enabled: false`, and `registerLspServer` can only register an enabled server, so touching such a language would turn it back on. The core version replaced the entry regardless. Two differences from the core version, both noted in the plugin: the choice follows the active window rather than being fixed per window root, and it lands when the plugin loads, so an already-spawned server keeps its command until restarted (JS/TS are `auto_start: false` by default). Tests drive the real plugin through the harness: a Deno project with the runtime installed switches both languages, one without it keeps the configured server (#2981), a project with no marker file is untouched, a disabled language is neither switched nor re-enabled, and leaving a Deno project for a plain one restores the configured server. They pin the process globals, since `PATH` is one and these run as threads of one binary. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01SHsuKyMdSZ7soeFzDziRNw
sinelaw
added a commit
that referenced
this pull request
Sep 3, 2026
) `configure_lsp_servers` hard-coded one project convention — a root with a `deno.json` or `deno.jsonc` is served by `deno lsp` — into window construction. That is a claim about projects, not about the editor: it cannot be turned off, inspected or replaced without a rebuild, and every further convention costs another branch in code whose job is wiring a manager. #3111 had to add its runtime check inside that same block. It is now `plugins/deno_lsp.ts`, which switches JavaScript and TypeScript to `deno lsp` when the active window's root has the marker file and `deno` is on PATH, puts back what was configured before when a window without one becomes active, and caches its decision per root. `configure_lsp_servers` loses the block, its `root` parameter and the `Path`/`env` imports. A language the user turned off is left alone in both directions: the "Disable" rows persist `enabled: false`, and `registerLspServer` can only register an enabled server, so touching such a language would turn it back on. The core version replaced the entry regardless. Two differences from the core version, both noted in the plugin: the choice follows the active window rather than being fixed per window root, and it lands when the plugin loads, so an already-spawned server keeps its command until restarted (JS/TS are `auto_start: false` by default). Tests drive the real plugin through the harness: a Deno project with the runtime installed switches both languages, one without it keeps the configured server (#2981), a project with no marker file is untouched, a disabled language is neither switched nor re-enabled, and leaving a Deno project for a plain one restores the configured server. They pin the process globals, since `PATH` is one and these run as threads of one binary. Claude-Session: https://claude.ai/code/session_01SHsuKyMdSZ7soeFzDziRNw Co-authored-by: Claude <[email protected]>
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.
Fixes #2981
After rummaging through the code, I realized that any deno.json(c) in the project would cause fresh to switch LSP to deno whether a runtime was available or not. This code checks if a runtime is in path and only then makes the switch.