hansec / vscode-fortran-ls

Fortran IntelliSense for Visual Studio Code
MIT License
37 stars 7 forks source link

[Suggestion] #11

Closed bmxam closed 5 years ago

bmxam commented 5 years ago

Boy.txt Human.txt

Dear Chris,

Here is a new suggestion. It is quite difficult to explain so don't hesitate to go directly to the example... When using Go to Definition on a procedure that is declared in a derived type, this derived type being defined in an other file, we are sent to the line procedure, pass(this) :: foo. Most of the time, we would like to go directly to the procedure body itself subroutine foo(..).

I attached a minimum working example (attached files are .f90 files). Human declares a procedure foo. Boy extends Human and uses the procedure foo somewhere. When using Go to Definition on foo in line 16 of Boy.f90, we are sent to line 7 of Human.f90. We could expect to be sent directly to line 12 of Human.f90 (the subroutine body). Even better, to satisfy "everybody" : clicking on foo in line 16 of Boy.f90 could redirect (as it is the case now) to line 7 of Human.f90 but then clicking on foo in line 7 of Human.f90 could redirect to the subroutine body, line 12.

I hope my example will help you understand the behaviour I am describing.

Best regards,

Maxime

hansec commented 5 years ago

This feature is already implemented as a separate request "Go to Implementation" in VSCode. By default the key mapping for this isn't as obvious as the "Go to Definition" but you can always change that.

bmxam commented 5 years ago

Alright, thank you for the tips.