feat(components): let a host without a language service drop the two LSP actions - #5
Draft
pythonlearner1025 wants to merge 1 commit into
Draft
feat(components): let a host without a language service drop the two LSP actions#5pythonlearner1025 wants to merge 1 commit into
pythonlearner1025 wants to merge 1 commit into
Conversation
…LSP actions `Go to Definition` and `Find References` are registered on every Monaco viewer unconditionally, so they sit in the context menu and on F12 / Shift+F12 whatever the host can answer. A machine that runs no language service answers "Host language service does not support this file" for every identifier. Add one optional prop per level, each defaulting to today's behaviour: `SessionDetail.hideLanguageServiceActions`, `SessionFileContentView.lspAvailable` and `SessionMonacoTextViewer.lspActions`, down to `lspActions` on `SessionMonacoEditorControllerOptions`, which gates the two `addAction` calls. Gating the ACTIONS rather than the callbacks is the point: an action whose callback is `undefined` still sits in the context menu and does nothing at all, which is worse than the message it replaces. `renderViewerTabContent` is shared by the desktop and mobile branches, so one line covers both. No existing call site passes any of them. Model: claude-opus-5[1m]
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.
Go to DefinitionandFind Referencesare registered on every Monaco viewerunconditionally, so they sit in the context menu and on F12 / Shift+F12 whatever
the host can answer. A machine that runs no language service answers "Host
language service does not support this file" for every identifier.
Add one optional prop per level, each defaulting to today's behaviour:
SessionDetail.hideLanguageServiceActions,SessionFileContentView.lspAvailableand
SessionMonacoTextViewer.lspActions, down tolspActionsonSessionMonacoEditorControllerOptions, which gates the twoaddActioncalls.Gating the ACTIONS rather than the callbacks is the point: an action whose
callback is
undefinedstill sits in the context menu and does nothing at all,which is worse than the message it replaces.
renderViewerTabContentis sharedby the desktop and mobile branches, so one line covers both.
No existing call site passes any of them.
Compatibility
Every change is additive at its default. With the new prop, parameter or flag
absent, the touched components render and behave exactly as they do today, and
no existing call site in this repository passes one.
Testing
packages/componentstypecheck and the full vitest suite pass. No new test: the controller needs a live Monaco editor.Notes for the reviewer
Gating the ACTIONS rather than the callbacks is the point — an action wired to an absent callback still sits in the context menu and does nothing at all, which is worse than the message it replaces.
renderViewerTabContentis shared by desktop and mobile, so one line covers both.Review metadata
BlitzOS fork only. Delete this section before sending the PR to
LodyAI/Lody.blitz/seam-10-language-service-actions-propf3474894 (the pinned upstream commit)