DONE: Shift+F2 to find a function or subroutine automatically

Make a request or discuss new features.
Post Reply
User avatar
yereverluvinuncleber
Posts: 297
Joined: 20 Apr 2018 09:49

DONE: Shift+F2 to find a function or subroutine automatically

Post by yereverluvinuncleber »

Forgive me as always if I am asking for something that already exists somewhere with RJTextEd.

I am currently finishing one major part of my VB6 project and then dropping out on occasion to use RJTextEd when I have a bug to resolve in one of my other projects. One useful facility that the VB6 IDE provides is the ability to double-click on a function or subroutine's name

Image

then use the key combination Shift + F2, this takes you to the function or sub routine immediately. It does it regardless of the location of the routine as long as it is in a file that is open as part of the project.

Image

I have looked for something similar in RJTextEd but have not found something that works for me. When I double-click upon a function name I have the right click choice of:

Find Declaration,
Find Implementation
Find in Project.

The top two seem to do nothing when javascript is the default language, the only one that comes close to the functionality I am looking for is the "Find in Project" that does at least perform a global search for all such string occurrences.

In the VB6 IDE a simple Shift + F2 is enough to take you straight to the highlighted function. It would be extremely useful to have such a working facility in RJTextEd and the utility of the key combination would make transition between the two code editors seamless. It would also enhance RJTextEd.
"Noli pati a scelestis opprimi"... or is it "non lacessit illegitimae te carborundum"?

You can find me on Deviantart https://www.deviantart.com/yereverluvinuncleber/gallery/

User avatar
yereverluvinuncleber
Posts: 297
Joined: 20 Apr 2018 09:49

Re: REQUEST: Shift+F2 to find a function or subroutine automatically

Post by yereverluvinuncleber »

Gentle bump!
"Noli pati a scelestis opprimi"... or is it "non lacessit illegitimae te carborundum"?

You can find me on Deviantart https://www.deviantart.com/yereverluvinuncleber/gallery/

User avatar
Rickard Johansson
Site Admin
Posts: 6167
Joined: 19 Jul 2006 14:29

Re: REQUEST: Shift+F2 to find a function or subroutine automatically

Post by Rickard Johansson »

Renamed the context menu item "Find implementation" and made some improvements. "Find declaration" is only visible in Cpp and Pascal files.

C++ or Pascal
Two menu items.
* "Find declaration"
* "Find function, method or implementation"

Otherwise
One menu item.
* "Find function or method"

Done in v14.0. Thanks!

User avatar
yereverluvinuncleber
Posts: 297
Joined: 20 Apr 2018 09:49

Re: DONE: Shift+F2 to find a function or subroutine automatically

Post by yereverluvinuncleber »

Will test!
"Noli pati a scelestis opprimi"... or is it "non lacessit illegitimae te carborundum"?

You can find me on Deviantart https://www.deviantart.com/yereverluvinuncleber/gallery/

User avatar
yereverluvinuncleber
Posts: 297
Joined: 20 Apr 2018 09:49

Re: DONE: Shift+F2 to find a function or subroutine automatically

Post by yereverluvinuncleber »

Hoping to assign shift + f2 when a function call has been highlighted, wanting it to jump straight to the function itself. I am sure this used to work as I 'feel' that I used it in test and in anger but that may be just my memory.

Regardless, I cannot get it to work now.

setTooltip(); //this is the function call

Using javascript as the language filter, I was looking for :

right click - find - find implementation or method

- but it is greyed out for javascript.

Key Def.s.
Environment - Keyboard - FindImplementationAction (find the source implementation) -> SHIFT+F2

I want it to jump directly to this function implementation in my code:

//==============================================================
// this function sets the tooltips
//==============================================================
function setTooltip() {
//blah blah;
// .
// .
// .
}
//=====================
//End function
//=====================

Assuming I have it set up correctly, it seems not to be working. I believe it is because that functionality is not enabled for javascript? Just a guess.

I do need it! I would love something like this to be implementable for all languages or at least the major ones and not just C variants.

It is SO useful to have the function call in front of you in code and just being to highlight it and SHIFT+F2 to jump directly to the function or subroutine.
"Noli pati a scelestis opprimi"... or is it "non lacessit illegitimae te carborundum"?

You can find me on Deviantart https://www.deviantart.com/yereverluvinuncleber/gallery/

User avatar
Rickard Johansson
Site Admin
Posts: 6167
Joined: 19 Jul 2006 14:29

Re: DONE: Shift+F2 to find a function or subroutine automatically

Post by Rickard Johansson »

In the latest version you need to install and add a language server for it to work. I really recommend Typescript language server found in the Language Servers (LSP) thread.

Because of a bug - goto implementation doesn't work in the current version (it's fixed in the next release), but you can use goto definition.

Using a language server also improves auto completion, mouse hover results and gives you diagnostic errors, warnings...

In the next version I've added (so far):

Find References
_References.png
_References.png (6.4 KiB) Viewed 1987 times
Right click and select Find references to get a project wide list of all instances where the item under the cursor is used. Including the declaration. It can be a method, class, variable etc.

Document Symbols
_Symbols.png
_Symbols.png (12.55 KiB) Viewed 1987 times
Hierarchical list of classes, methods, properties, fields, interfaces etc. found in a file. You can switch to any file in your project without opening it.

User avatar
pjj
Posts: 1934
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: DONE: Shift+F2 to find a function or subroutine automatically

Post by pjj »

Rickard Johansson wrote:
27 May 2021 13:25
Using a language server also improves auto completion, mouse hover results and gives you diagnostic errors, warnings...
Can confirm. LSP implementation is immensely and incredibly helpful!
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus

User avatar
yereverluvinuncleber
Posts: 297
Joined: 20 Apr 2018 09:49

Re: DONE: Shift+F2 to find a function or subroutine automatically

Post by yereverluvinuncleber »

I have been meaning to test, will do so.
"Noli pati a scelestis opprimi"... or is it "non lacessit illegitimae te carborundum"?

You can find me on Deviantart https://www.deviantart.com/yereverluvinuncleber/gallery/

Post Reply