Skip to content

Developed setting which controls whether the definition link opens element in the peek widget.#89884

Merged
jrieken merged 2 commits intomicrosoft:masterfrom
GustavoASC:master
Feb 4, 2020
Merged

Developed setting which controls whether the definition link opens element in the peek widget.#89884
jrieken merged 2 commits intomicrosoft:masterfrom
GustavoASC:master

Conversation

@GustavoASC
Copy link
Contributor

This PR fixes #62571.

Now there is a setting to control whether the mouse click opens element definition in the peek widget, which is equivalent to Visual Studio configuration.

image

Default is false to maintain the same behavior as before (tipically opening the definition in a new window).

… the mouse click opens element definition in the peek widget.
@GustavoASC
Copy link
Contributor Author

Oh, I'd like to point this out. When this setting is true I can open 'peek' inside 'peek' with ctrl+click.
This doesn't seem to be a problem because it worked really fine for me, but I'm not sure if this is the expected behavior.

image

@GustavoASC GustavoASC requested a review from jrieken February 2, 2020 23:56
@jrieken
Copy link
Member

jrieken commented Feb 3, 2020

This doesn't seem to be a problem because it worked really fine for me, but I'm not sure if this is the expected behavior.

That's unwanted behaviour

@jrieken jrieken modified the milestones: January 2020, February 2020 Feb 3, 2020
@GustavoASC
Copy link
Contributor Author

That's unwanted behaviour

Thanks for your feedback!
I will take a look on this as soon as I have free time.

I just noticed that on issue #6857 you mentioned:

we should have a way to invoke reference search/peek def in nested editors but without nesting peek inside peek

Maybe if I solve issue #6857, the behaviour of the current PR will be solved as well.

Anyway, I'll take a look on that! 👍

description: nls.localize('peekWidgetDefaultFocus', "Controls whether to focus the inline editor or the tree in the peek widget.")
}
)),
mouseOpensDefinitionInPeek: register(new EditorBooleanOption(
Copy link
Member

Choose a reason for hiding this comment

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

Overall looking quite good. Not yet sold on the name, maybe have definitionLink or symbolLink with value set peek | goto ("goto" isn't the best option because it might peek) or for a boolean value something like definitionLinkOpensInPeek?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I created a config yesterday with values like peek | goto but since it's not always goto (it might peek) I decided to create a boolean.

I liked your idea to rename it to definitionLinkOpensInPeek.

@GustavoASC GustavoASC changed the title Developed setting 'mouseOpensDefinitionInPeek' which controls whether the mouse click opens element definition in the peek widget. Developed setting which controls whether the definition link opens element in the peek widget. Feb 3, 2020
@jrieken jrieken merged commit 7acda4b into microsoft:master Feb 4, 2020
@jrieken
Copy link
Member

jrieken commented Feb 4, 2020

Thanks!

@GustavoASC
Copy link
Contributor Author

GustavoASC commented Feb 5, 2020

@jrieken Uhm, I noticed that 'peek inside peek' already happens today even in 1.41. If we use "Peek definition" menu and after that mouse+click an element which has multiple definition, a peek widget is open recursively.

Peek 05-02-2020 12-53

Should I open an issue to solve this?
Because this problem is not related to the current PR (however we can also simulate with this new setting enabled on Code OSS Dev).

According to @stevencl comment on #6857 it's not that simple to have 'breadcrumbs' like VS.

@jrieken
Copy link
Member

jrieken commented Feb 5, 2020

Can you try with insiders? There was something I have recently fixed, tho unsure if it also covers that. Otherwise, yeah file an issue please

@GustavoASC
Copy link
Contributor Author

Tested on Insiders and works fine 👍

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
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.

Option for opening defintion in peek view with Ctrl+click

2 participants