Repository navigation
Conversation
Sorbet detection only checks for sorbet-static in the bundle, so workspaces that depend on Sorbet without running the Sorbet LSP lose definition, references, rename and workspace symbols. Accept a `bypassTypechecker` initialization option so any editor can opt out, keep the RUBY_LSP_BYPASS_TYPECHECKER env var used by the VS Code extension, and log when the bypass is active. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2Kable
force-pushed
the
typechecker-initialization-option
branch
from
November 16, 2026 18:47
77e5f74 to
4f59cdd
Compare
This branch has not been deployed
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.
Motivation
The Ruby LSP treats a project as a Sorbet project whenever
sorbet-staticis anywhere in the lockfile. When that happens, it leaves constant features (definition, references, rename, workspace symbols, and so on) to the Sorbet LSP, even if the Sorbet LSP doesn't run for that workspace.This comes up often in monoliths that have
sorbet-runtimeand Tapioca at the root while Sorbet only type checks a sub-application. Opening the root workspace gives a degraded experience: the Ruby LSP defers to a Sorbet LSP that isn't there.Today the only way out is the
RUBY_LSP_BYPASS_TYPECHECKERenv var, which VS Code exposes asrubyLsp.bypassTypechecker. That setting's description says it's "only intended to be used while working on the Ruby LSP itself", and editors other than VS Code have no initialization option for it.Implementation
bypassTypechecker(defaultfalse), matching the existing VS Code setting.falsekeeps the current detection (sorbet-staticin dependencies).trueturns detection off, like the env var does. Both checks live indetect_typechecker.RUBY_LSP_BYPASS_TYPECHECKERstill works.sorbet-staticis detected but the workspace has nosorbet/config, the server logs a hint (awindow/logMessageduring initialization) that points to the option. Behavior doesn't change.rubyLsp.bypassTypecheckeris now also sent asbypassTypecheckerininitializationOptions. The env var wiring stays so older servers keep working. The setting description now describes a supported use case.jekyll/editors.markdownlists the new option and explains it.The default behavior doesn't change, so this is backward compatible. The option is a boolean for now to match the existing setting. It could become a string enum (e.g.
typechecker: "auto" | "none") later if other type checkers need to be supported; the name and shape are open to maintainer feedback.Automated Tests
Added unit tests in
test/global_state_test.rbfor:sorbet-staticbypassTypechecker: truesorbet/configexistsManual Tests
sorbet-staticin itsGemfile.lockbut nosorbet/config.rubyLsp.bypassTypecheckerand restart the server. The output shows the "Type checker integration disabled by user" message, and go to definition and references on constants are now served by the Ruby LSP.🤖 Generated with Claude Code