Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce proposed editor line number context menu #175840

Merged
merged 1 commit into from Mar 2, 2023

Conversation

joyceerhl
Copy link
Contributor

@joyceerhl joyceerhl commented Mar 2, 2023

@joyceerhl joyceerhl enabled auto-merge (squash) March 2, 2023 06:51
@joyceerhl joyceerhl self-assigned this Mar 2, 2023
@VSCodeTriageBot VSCodeTriageBot added this to the March 2023 milestone Mar 2, 2023
import { IBreakpointEditorContribution, BREAKPOINT_EDITOR_CONTRIBUTION_ID } from 'vs/workbench/contrib/debug/common/debug';

class EditorLineNumberContextMenu extends Disposable implements IEditorContribution {
private readonly menu = this._register(this.menuService.createMenu(MenuId.EditorLineNumberContext, this.contextKeyService));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a context menu it is actually favourable to create and dispose it on demand, e.g. this.editor.onContextMenu, because menu comes with the cost of being context key listeners - of which there are plenty and which fire a lot

key: 'editor/lineNumber/context',
id: MenuId.EditorLineNumberContext,
description: localize('editorLineNumberContext', "The contributed editor line number context menu"),
proposed: 'contribShareMenu'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a dedicated proposal or is the re-use of shareMenu intentional?

Copy link
Contributor Author

@joyceerhl joyceerhl Mar 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's intentional for now because the only extension-contributed actions I foresee coming into this menu are Copy GitHub Permalink and Copy vscode.dev Link initially--but it will probably make sense to make this a standalone proposal soon. Done in main

@joyceerhl joyceerhl merged commit aa8367e into main Mar 2, 2023
@joyceerhl joyceerhl deleted the dev/joyceerhl/living-hookworm branch March 2, 2023 07:40
joyceerhl added a commit that referenced this pull request Mar 2, 2023
Minimizes listener creation for context key service, #175840 (comment)
@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants