vlang / v-analyzer

The @vlang language server, for all your editing needs like go-to-definition, code completion, type hints, and more.
MIT License
86 stars 9 forks source link

Publish diagnostics even if the file is not saved to disk #104

Open resolritter opened 1 month ago

resolritter commented 1 month ago

Describe the feature

Feature

I would like to receive diagnostics on the fly as I am editing a file, without having to save it to disk.

Explanation

It understand that v-analyzer collects diagnostics by parsing the compiler's output for a given input_path.

https://github.com/vlang/v-analyzer/blob/7e11a6f8f369df935664fadd2f0c99d90fe3226f/src/server/inspections/compiler/utils.v#L74-L75

https://github.com/vlang/v-analyzer/blob/7e11a6f8f369df935664fadd2f0c99d90fe3226f/src/server/inspections/compiler/utils.v#L86

https://github.com/vlang/v-analyzer/blob/7e11a6f8f369df935664fadd2f0c99d90fe3226f/src/server/inspections/compiler/utils.v#L90

I guess that is why the file has to be saved to disk prior to providing the diagnostics.

Use Case

It is annoying to have to constantly save the file only for the sake of getting diagnostics. Many other language servers can provide diagnostics even if the file is not saved to disk.

Other Information

No response