godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.54k stars 160 forks source link

Show method/class documentation on ctrl+click #205

Closed nanoblit closed 11 months ago

nanoblit commented 4 years ago

Currently as far as I know you can go to the documentation from the command palette and find whatever class you want to look up. It would be nice if the documentation would open scrolled to the correct method on ctrl + click.

Razoric480 commented 4 years ago

Ctrl + click is already being used to travel to a function call's definition (provided it's user made.) But it'd be nice to have some easy way of finding a function in the documentation from its use, though, yes.

Calinou commented 4 years ago

The documentation for built-in methods should already display if you hover them with the mouse for roughly one second. As for user-made methods, that's not supported in GDScript yet (there's no standard syntax for it). That said, this extension could use the comment line(s) above the variable/method declaration as a docblock like the C++ extension does.

linkpy commented 3 years ago

This feature can be implemented, tho it must go through the LSP server.

When you hover a user-defined variable, the LSP server will communicate where is that variable defined, making Ctrl+Click to work. In the case of a predefined name (class names, GDScript's functions, ...) the same request is sent to the server, but the later returns no information at all.

Opened https://github.com/godotengine/godot/issues/43188 to see if we can have the necessary addition to the LSP server so this can be implemented in the addon.

Ramh5 commented 3 years ago

I can right click on a built-in method, select "go to declaration", it opens a tab with the declaration, then I can click on the class of that method and it opens another tab with the documentation. Is there a less convoluted way to do that? In the Godot editor it is a a simple ctrl-click. For example in this old video I can see GDQuest can click on the popup and get the documentation. Unfortunately clicking anywhere on the popup does nothing on my installation.

DaelonSuzuka commented 11 months ago

Type documentation is currently available in VSCode by right-clicking on a typed variable and selecting "Godot Tools: Open Type Documention". I am currently working on making this feature available in more circumstances (methods of builtin types, for instance).

image