Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

control+click to jump to method declaration #9456

Open
xorcus opened this issue Oct 6, 2014 · 35 comments
Open

control+click to jump to method declaration #9456

xorcus opened this issue Oct 6, 2014 · 35 comments

Comments

@xorcus
Copy link

xorcus commented Oct 6, 2014

it would be very convenient for navigating through the source file if one could ctrl+click on a method/property name, and jump to the corresponding declaration (related to identification of auto-complete options, just need to keep the source location)

[edit] note that Quick Edit feature is useful for editing, but may be insufficient, because the focus here is on navigation. After navigating there, it would be nice to ctrl+click again, and follow a path through the code. Not necessarily editing the target right away

@Mark-Simulacrum
Copy link
Contributor

I'd like to note that Intellij IDEA does this for code.

@peterflynn
Copy link
Member

We do have this for JavaScript -- you can use Ctrl-J (Jump to Definition).

We don't do it when you Ctrl-click since that's used for multiple cursors. We could potentially offer a different shortcut like Alt-click though -- leaving open to consider that.

@sbruchmann
Copy link

@peterflynn Alt-click is used to create a rectangular selection IIRC.

@Mark-Simulacrum
Copy link
Contributor

@sbruchmann @peterflynn Should I open an issue about alt-click not being usable on Ubuntu to do rectangular selections since that is the keyboard/mouse shortcut to move windows?

@peterflynn
Copy link
Member

@Mark-Simulacrum Please do -- sounds like we need to pick a different modifier key for Linux.

@Mark-Simulacrum
Copy link
Contributor

Open #9461 to report Alt-Click behavior discussed above.

@rtconner
Copy link

rtconner commented May 5, 2015

+1

@nethip
Copy link
Contributor

nethip commented May 6, 2015

@rtconner While we prioritize this issue, just to keep you unblocked, did you try the workaround mentioned here. #9461 (comment)

@rtconner
Copy link

rtconner commented May 6, 2015

@nethip I'm on windows, not ubuntu :/

@victorbadila
Copy link

+1 very much want ctrl + click -> go to definition

@vincenzovitale
Copy link

+100

Have been trying to push bracket in a few teams I work with and this is the main missing feature almost all of the engineers have complained about.

@verybigelephants
Copy link

+1 i have decided not to use brackets when trying out new IDEs because it lacks this feature for example

this and code completion for methods defined in the whole project folder

@xorcus
Copy link
Author

xorcus commented Dec 25, 2015

github's Atom editor seems to be a good alternative to brackets

@verybigelephants
Copy link

don't get me even started on the terrible atom. that sluggish pluginated buggy monster is an atrocity! i have tried a large quantity of ides/editors recently because i'm trying to switch to a new one and i must say, atom was one of the most uncomfortable ones

/offtopic by the way

@abose
Copy link
Contributor

abose commented Jan 28, 2016

+1 for ctrl+clic to jump to defenition as in most other IDE's. We could extend the alt key behavior to include the current ctrl based multi select workflows.
Tagging @swmitra @petetnt @zaggino @ryanstewart

@zaggino
Copy link
Contributor

zaggino commented Jan 28, 2016

that'd be a great feature to have - but it might be a bit hard to locate the function definition in more complex cases

@petetnt
Copy link
Collaborator

petetnt commented Jan 28, 2016

+1 from me too. I can take a crack at it if someone else doesn't do it first, I am pretty stuck with work etc. for the next month but I could easily do it in early March.

@mnq-naqui
Copy link

That feature(CTRL+click) should must and should. It is very convenient and useful. Alrady supported by webstorm

@SachinPachari
Copy link

So if no one is working on it ? Can i take a shot at this ?

@zaggino
Copy link
Contributor

zaggino commented Aug 24, 2016

I don't think there's a PR for this yet @SachinPachari so go ahead.

@SachinPachari
Copy link

Ok, since we have all these issues with the 'ctrl+click' conflicting with the existing double cursor feature. Can this feature be in context menu (right-click in editor) ?

@petetnt
Copy link
Collaborator

petetnt commented Aug 24, 2016

I am fine with alt+click (or similar too). Additional context menu item would be nice too.

@SachinPachari
Copy link

I made the whole thing as an extension. i hope its ok.

  • The user can use "Atl - click" and context menu to navigate to the method declaration/definition.
  • the user can use the context menu "Go back" to navigate back the origin.

Go To Definition

Cheers.

@ficristo
Copy link
Collaborator

I'm sorry, but I realized only now (I totally forgot) that Alt+Click is used for rectangular selections.
We cannot use it in core.

@SachinPachari
Copy link

Do we have any other combination that i can try ?

@SachinPachari
Copy link

I did some checking, can we try 'Ctrl-Alt-click' ?

@petetnt
Copy link
Collaborator

petetnt commented Aug 30, 2016

ctrl+alt+click is fine too, but the best case scenario would be aligning with other editors (IDEA, VSCode, Atom...). If CTRL+click is the de-facto way, we could enable the jump on jump-able items only (for example holding CTRL and hovering over a method name could underline the method name, showing the user that one would jump to def instead of creating a new cursor).

@SachinPachari
Copy link

CTRL+click would be my first choice. But it looks like its affecting the multi-cursor feature.
Check this branch
Ctrl - Click

@SachinPachari
Copy link

@petetnt , I was facing lots of issues using the 'Ctrl+click', since i was using selecting to mark/highlight the text.
Now i have removed the selection and currently using the markText to mark/highlight the text.

@putchi
Copy link

putchi commented Dec 30, 2016

Is someone already started working on this improvement?
It could be very useful clicking CMD/Ctrl + Click to go to function 👍
+1

@SachinPachari
Copy link

@putchi i managed to add it as an extension. check the below link
https://github.com/SachinPachari/gotodefinition-brackets

@putchi
Copy link

putchi commented Dec 30, 2016

@SachinPachari thanks, but i checked it out and it doesn't work with mac OS. could you make changes to this plugin? maybe even make it "CMD + click" to go to definition?

thanks in advance

@redmunds
Copy link
Contributor

redmunds commented Dec 31, 2016

@putchi Cmd+click is already used by Mac for context menu, so I don't think that shortcut can be used.

UPDATE: Oops, context menu is Control+click. Brackets extension API for shortcuts is only for keyboard shortcuts, so you'll have to edit the extension handle Cmd+click

@SachinPachari
Copy link

@putchi finally found a Mac, and i saw the issue u mentioned.
Fixed the problem. get the latest extension from the brackets extension market or at https://github.com/SachinPachari/gotodefinition-brackets

@putchi
Copy link

putchi commented Jan 10, 2017

@SachinPachari thanks!
I will check it out :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests