-
Notifications
You must be signed in to change notification settings - Fork 582
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
Update GHPRI link sharing contributions #4584
Conversation
…/context/share` menus
editor/lineNumber/context
menuThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR, I just have a few questions!
…bled and active text editor
… selection does not contain the specified line number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! If the answer to #4584 (comment) is yes then feel free to merge!
{ | ||
"command": "issue.copyGithubDevLink", | ||
"when": "github:hasGitHubRemotes && remoteName == codespaces || github:hasGitHubRemotes && embedderIdentifier == github.dev", | ||
"group": "1_cutcopypaste@0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: since this one is 1_cutcopypaste@0
I would put it first.
}, | ||
{ | ||
"command": "issue.copyGithubHeadLink", | ||
"when": "github:hasGitHubRemotes && activeEditor == workbench.editors.files.textFileEditor && config.editor.lineNumbers == on", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are all the config.editor.lineNumbers == on
conditions needed? I would expect this to be controlled by VS Code core.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it would make sense for core to handle hiding these commands, since the editor/lineNumber/context menu could also eventually include other extension-contributed items that we'd want to show regardless of line number enablement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This behavior also isn't final since I've already gotten feedback that it's unexpected that these commands would go away based on line numbers being toggled off to reduce visual noise.
For microsoft/vscode#175676
This PR enables GHPRI copy link commands to show up in a new context menu that is anchored to editor line numbers. When a command contributed to the editor line number context menu is invoked, extensions will receive both the URI and line number that the copy link command was invoked for. I've modified the link generation code to observe that line number when it's available, instead of using the current selection as it does when invoked from the editor context menu or the command palette.
editorLineNumberContext.mp4
Additionally this PR
contribShareMenu
proposed menus vscode#176316