godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.55k stars 164 forks source link

Comments get hover documentation #534

Closed moritztim closed 10 months ago

moritztim commented 10 months ago

Godot version

v4.1.3.stable.arch_linux

VS Code version

1.84.2

Godot Tools VS Code extension version

1.3.1

System information

Arch Linux

Issue description

image

Steps to reproduce

Hover over a comment

DaelonSuzuka commented 10 months ago

A lot of comments include examples or snippets of usage code, so this is useful behavior in those instances.

image

It is unfortunate that the Language Server isn't correctly resolving the class of the current file when providing hovers. The correct behavior in the situation you posted would be for it recognize that EnumLabel.gd is not a SegmentShape2D or a Color, and thus a doesn't refer to a known symbol symbol right now.

I also couldn't change this behavior even if I wanted to, because hovers are provided by the engine itself, using its Language Server. This extension just displays what it gets sent.

moritztim commented 10 months ago

Hmm yeah it kinda sucks that there's no formatting in comments to explicitly tell the language server that this is a code snippet. Oh well

atirut-w commented 10 months ago

@DaelonSuzuka if you don't mind, do you know anyone familiar with Godot's LSP codes? Just in case.

DaelonSuzuka commented 10 months ago

@atirut-w Why does that matter?

atirut-w commented 10 months ago

Fine, then. I'll study it myself during free time.