vala-lang / vala-vscode

Vala and Genie integration for Visual Studio Code/VSCodium/Code-OSS
MIT License
41 stars 9 forks source link

Inline error/problem highlighting? #17

Closed elsiehupp closed 2 years ago

elsiehupp commented 2 years ago

I definitely appreciate the syntax coloring, but VS Code's interactive code annotation can go a bit further. For example, with Vala, if I type vala <filename> in the terminal, it will give me a list of syntax errors, improperly defined symbols, etc.—line and column numbers and all!—while by contrast the official Python VS Code extension highlights these sorts of issues using red underlines.

Basically, what would be involved in adding this sort of inline error/problem highlighting? This is somewhat related to https://github.com/Prince781/vala-vscode/issues/16, except that it shouldn't require writing the underlying rules from scratch, since the Vala compiler already provides them. Indeed, If you Cmd-Click on the filename and line/column number in the terminal, VS Code will open the file and scroll to that location, so all the necessary information is already there.

elsiehupp commented 2 years ago

The better comparison might be the official OmniSharp extension for VS Code, since Vala and C# are much, much more similar to each other than they are to Python. I'm not very good with JavaScript or TypeScript, but might it be possible to port some of the OmniSharp logic over to here?

stsdc commented 2 years ago

Do You mean something like this? obraz

elsiehupp commented 2 years ago

@stsdc yes, exactly that. (Though the particular instance you are showing is warnings, i.e. yellow underlines, rather than errors, i.e. red underlines.)

elsiehupp commented 2 years ago

I mean, the functionality may very well already exist, but if it does, it doesn't appear to be enabled by default.

elsiehupp commented 2 years ago

And if it does exist, instructions for enabling and using it are absent from the README.md.

stsdc commented 2 years ago

Here is an error ;)

obraz

There is an:

NOTE: in order to get code intelligence, you must install the Vala Language Server (https://github.com/benwaffle/vala-language-server).

elsiehupp commented 2 years ago

Thank you for the explanation. The README could be a lot clearer, though. What I mean is that instead of "code intelligence" it could say something more specific like "inline problem highlighting".

elsiehupp commented 2 years ago

(I mean, I could do a pull request with that change to the README.)

Prince781 commented 2 years ago

@elsiehupp

Thank you for the explanation. The README could be a lot clearer, though. What I mean is that instead of "code intelligence" it could say something more specific like "inline problem highlighting".

Neither this plugin nor the language server provide "inline problem highlighting." That depends on how the editor chooses to render the diagnostics. This plugin provides syntax highlighting and exposes a way for VS Code to start a language server (if one is installed) to communicate with using the Language Server Protocol, to provide semantic analysis. This is also how the other extensions work—C/C++, Python, C#, etc—you need to have a language server for these languages installed to go beyond syntax highlighting. It's just that some of these extensions will download the server and install it for you.

elsiehupp commented 2 years ago

You clearly do not respect the work of QA reporters. I will get back to you when I have the energy and inclination to do yet more of your job for you for free.

elsiehupp commented 2 years ago

For the time being I’m unsubscribing from this Issue request. I did write more substantive feedback, but I’m just going to sit on it for now.

Prince781 commented 2 years ago

Anyway, I'm closing this issue since the question posed has been answered.