You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
JavaScript Jump To Definition Ctrl+J/Cmd+J not mentioned in Right-Click MenuΒ #3860
@adrocknaphobia One issue here is that the menu contents aren't yet selective based on file type. So this would show up in all files, even though it does nothing if you're not in JS code. Should we hold off until we have a better story for truly context-sensitive menus?
Another related point -- Jump to Definition is currently hardcoded to go directly to the JS extension. It's not pluggable in a language-related way, so e.g. a PHP or TypeScript extension would have to add its own separate menu item with the same functionality. We should consider converting the menu item into a more generic extensible hook at some point.
The menu contents need to be selective based on file type, so we'll hold off on the right click menu - but the hook for other languages sounds useful to address as it shouldn't be tied to JS exclusively.
Both the right-click context menu addition and the Jump-To-Definition navigation menu issue can probably be solved at the same time, using the same technique used by QuickEdit, i.e., registering separate provider functions to handle the various cases.
I have just made a pull request which has Jump-To-Definition added to the right-click menu. It's only one line of code, so we can comment it out at will.
To elaborate: to do this right, we'd want to check the file type (or selection type) every time we displayed the right-click menu, for jump-to-definition, quick edit, etc. We might also want to do the same for the top-level navigate menu. Is this what we plan to do?
Activity
jeffkenton commentedon May 20, 2013
I'm looking a this one. (There's some problem actually assigning it to me, but it's mine.)
peterflynn commentedon May 20, 2013
Reviewed.
@adrocknaphobia One issue here is that the menu contents aren't yet selective based on file type. So this would show up in all files, even though it does nothing if you're not in JS code. Should we hold off until we have a better story for truly context-sensitive menus?
Another related point -- Jump to Definition is currently hardcoded to go directly to the JS extension. It's not pluggable in a language-related way, so e.g. a PHP or TypeScript extension would have to add its own separate menu item with the same functionality. We should consider converting the menu item into a more generic extensible hook at some point.
petetronic commentedon May 20, 2013
The menu contents need to be selective based on file type, so we'll hold off on the right click menu - but the hook for other languages sounds useful to address as it shouldn't be tied to JS exclusively.
jeffkenton commentedon May 20, 2013
Both the right-click context menu addition and the Jump-To-Definition navigation menu issue can probably be solved at the same time, using the same technique used by QuickEdit, i.e., registering separate provider functions to handle the various cases.
jeffkenton commentedon May 29, 2013
I have just made a pull request which has Jump-To-Definition added to the right-click menu. It's only one line of code, so we can comment it out at will.
To elaborate: to do this right, we'd want to check the file type (or selection type) every time we displayed the right-click menu, for jump-to-definition, quick edit, etc. We might also want to do the same for the top-level navigate menu. Is this what we plan to do?
redmunds commentedon Mar 17, 2014
This issue is unassigned, so marking "Needs Review".
disshishkov commentedon May 20, 2014
Guys, there is way to change hotkey from ctrl + j to f12?
dangoor commentedon May 20, 2014
@disshishkov I haven't tried it, but there's a "Brackets Key Remapper" extension (see the extension manager in Brackets)
disshishkov commentedon May 21, 2014
Thank you @dangoor , the mentioned by you extension works great