hansec / vscode-fortran-ls

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

Show subroutine argument info when hovering at call site #12

Closed letmaik closed 5 years ago

letmaik commented 5 years ago

Currently, when hovering over a in call foo(a) then the hover only shows information about a itself, but not how the subroutine argument itself is defined, that is, what the intent is, type, and name. This would be quite useful to have, maybe in a second line in the hover with some special formatting like italic or so to differentiate it.

michaelkonecny commented 5 years ago

You can get this info when hovering over the function name (foo).

letmaik commented 5 years ago

Sure, but that doesn't help much if you have a lot of arguments and would have to start counting etc.

hansec commented 5 years ago

I don't think this wouldn't be too hard to add to the language server since its already setup for "signatureHelp" requests. However, what is the specific use case here? Is this to help decipher other people's code? It seems like if you are writing code yourself and already specified a variable you should know what the argument is or use "signatureHelp" when choosing a variable to pass.

letmaik commented 5 years ago

You nailed it, deciphering other people's sometimes very complex code. It would be hugely helpful. And if it's too weird in general to display it, maybe it could be an option to enable/disable it?

hansec commented 5 years ago

Haha, yeah that is a lot of arguments..... I will take a crack at adding this an update (see the referenced issue in the LS repo above).