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

cmd+click behavior for Goto Definition and a Document Link #147447

Open
Tracked by #673
dbanck opened this issue Apr 14, 2022 · 2 comments
Open
Tracked by #673

cmd+click behavior for Goto Definition and a Document Link #147447

dbanck opened this issue Apr 14, 2022 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-symbols definitions, declarations, references workbench-link Link protection in workbench

Comments

@dbanck
Copy link

dbanck commented Apr 14, 2022

Hi 👋

While implementing two features for the vscode-terraform extension, we've encountered some unexpected behavior when using cmd+click on a range of text.

Our language server based implementation returns a link via textDocument/documentLink and a valid textDocument/definition for the same text range.

Link

In our case, we link to the documentation for a module fetched from a remote source. This works as expected and opens a browser when clicking on the link.

2022-04-14 13 12 54

Goto Definition

We implemented goto definition for a module source, which takes a user to the local implementation of a module. This works as expected and opens the local file in a new editor tab.

2022-04-14 13 11 50

Combination of both features

Each feature works as expected on its own, either using the context menu / hover or cmd+link on the text range.

When both features are available for a text range, cmd+click will execute goto definition and open the link. This results in a browser window opening the link while VS Code opens the local file in a new editor tab in the background.

2022-04-14 13 13 51

Is this the intended behavior? It feels off, and I would expect that one of the features "wins" when using cmd+click while both are still usable via the context menu / hover.

@st0012
Copy link

st0012 commented Sep 28, 2022

👋 We also have a similar problem when implementing a document link feature in ruby-lsp. In our case, the conflict happens with another LSP (Sorbet LSP)'s GoToDefinition support, which is commonly used along with ruby-lsp.

I feel this is associated with VSCode's lack of customisation around mouse clicks.

@jrieken jrieken added bug Issue identified by VS Code Team member as probable bug editor-symbols definitions, declarations, references workbench-link Link protection in workbench labels Dec 6, 2022
@jrieken jrieken added this to the January 2023 milestone Dec 16, 2022
@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Dec 16, 2022
jrieken added a commit that referenced this issue Dec 20, 2022
…has the ability to prompt the user to select on"

This reverts commit 65499e5.

fixes #169593, re-opens #147447
@jrieken jrieken reopened this Dec 20, 2022
@vscodenpa vscodenpa removed the insiders-released Patch has been released in VS Code Insiders label Dec 20, 2022
@jrieken
Copy link
Member

jrieken commented Dec 20, 2022

Reopening because this caused a bad regression (see #169593)

@jrieken jrieken removed this from the January 2023 milestone Dec 20, 2022
jrieken added a commit that referenced this issue Dec 20, 2022
…has the ability to prompt the user to select on" (#169667)

This reverts commit 65499e5.

fixes #169593, re-opens #147447
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug editor-symbols definitions, declarations, references workbench-link Link protection in workbench
Projects
None yet
Development

No branches or pull requests

5 participants