godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.59k stars 170 forks source link

Support for Godot Type-Safe lines #436

Open emarino135 opened 2 years ago

emarino135 commented 2 years ago

Godot version

3.5.stable

VS Code version

1.73.0

Godot Tools VS Code extension version

1.3.1

System information

Windows 10

Problem statement

image Similar to how Godot built in script editor supports Safe-Type lines by showing darkened numbers on the side of the editor

Safe-Type from Docs: https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/static_typing.html

Proposed solution

At the minimum I think some kind of terminal tree output with filenames and line numbers of unsafe lines would be great and get the job done. Maybe a function we could call using command palette like

Godot-tool show unsafe lines

Dream Solution: I don't know how the language Linter you used works to detech if line is unsafe but if it could detect it was unsafe and use a function like text-marker extention to just highlight the line of code within vscode text editor that would work.

DaelonSuzuka commented 1 year ago

That's a somewhat interesting feature but I would be surprised if the language server provides the information required to implement it.

chexmo commented 2 months ago

this would be pretty useful.... it seems like (sadly) one can never get the best of the two worlds... text editor inside godot hasn't the power of vscode, but in vscode you lack of these kind of things, or the icons that hints there is a node signal connected, etc.

geekley commented 1 month ago

I would be happy if this could be added even as info blue squiggles on the line (that I could disable in a setting).

Unrelated, but... it would be also nice to have an option to render the "unused" warnings not as yellow warnings, but like how you get "unused" in other languages (less opacity).

DaelonSuzuka commented 2 weeks ago

Unrelated, but... it would be also nice to have an option to render the "unused" warnings not as yellow warnings, but like how you get "unused" in other languages (less opacity).

I... think I know how to do that!

geekley commented 2 weeks ago

Unrelated, but... it would be also nice to have an option to render the "unused" warnings not as yellow warnings, but like how you get "unused" in other languages (less opacity).

I... think I know how to do that!

Yeah, should be easy, you probably just need to check the error codes containing "UNUSED" or whatever and add a DiagnosticTag.Unnecessary to their diagnostic, right? Possibly also reduce the level to info or hint if that alone doesn't hide the yellow squiggles.