ZigBrains icon indicating copy to clipboard operation
ZigBrains copied to clipboard

Build error highlighting directly in the editor

Open Dima-369 opened this issue 1 year ago • 1 comments

First, thanks for this great plugin!


One little thing:

I notice how syntax errors are correctly annotated as an error in the right scroll bar.

CleanShot 2024-08-02 at 11 53 52@2x

Which sets the error count in the top right for the file analysis:

CleanShot 2024-08-02 at 11 56 16@2x


Is the same possible for build errors? It is great that the link in the build output is already clickable, but it would be even more convenient if it would be shown as a 'highlighted error'.

That way, the Next Highlighted Error action would also properly work.

CleanShot 2024-08-02 at 11 53 39@2x

Dima-369 avatar Aug 02 '24 09:08 Dima-369

I found this guide: https://kristoff.it/blog/improving-your-zls-experience/

It does help in displaying those compile errors, but I need to manually trigger a save which is suboptimal, but definitely helpful and an improvement so far.

And I notice how zig build --summary all only displays 1 error at max accumulated across all files, but I assume this is more an implementation detail. This leads to the error highlighting to not be as strong as one expects from languages like Java/Kotlin.

Dima-369 avatar Aug 02 '24 10:08 Dima-369

As of 0.14.0, if you enable build-on-save in ZLS, it will highlight build errors in the editor automatically.

FalsePattern avatar Mar 13 '25 15:03 FalsePattern