Discoverable context menu for disabling CodeLens#317267
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
Co-authored-by: dmitrivMS <9581278+dmitrivMS@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue with disabling CodeLens not being discoverable
Discoverable context menu for disabling CodeLens
May 19, 2026
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.
CodeLens has no in-UI affordance to identify or disable it — right-clicking a CodeLens currently invokes its command (often opening another file), and the only way to turn it off is the undocumented
editor.codeLenssetting.Changes
MenuId.EditorCodeLensContext— context menu shown when right-clicking a CodeLens widget, following theStickyScrollContextpattern.codelensController.tse.event.leftButtonso right-click no longer fires the lens command.onContextMenuhandler that detects clicks inside.codelens-decorationand pops the new menu.editor.action.toggleCodeLens(Action2, toggled againstconfig.editor.codeLens), contributed to the Command Palette, View → Appearance menubar (group4_editor, next to Sticky Scroll), and the new context menu.codelens.showLensesInCurrentLineaction in the same context menu, gated byEditorContextKeys.hasCodeLensProvider.Notes
editor.codeLenssetting; per-provider disable is out of scope.ContextMenuControlleralreadypreventDefaults onCONTENT_WIDGETtargets, so there is no native-menu conflict.