Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix absolute path detection for build on save diagnostics #1938

Merged
merged 1 commit into from
Jul 20, 2024

Conversation

jayrod246
Copy link
Contributor

@jayrod246 jayrod246 commented Jul 3, 2024

This patch detects drive letters.

I was trying to trigger some diagnostics using std.fmt. For awhile I couldn't tell if anything was working at all. But after a debug session, I figured out that the ':' following a drive letter was causing the line iterator to bail.

After this change I was able to see this:
screenshot

Copy link
Member

@Techatrix Techatrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is a bit hacky but shouldn't cause any problems. I anticipate the build on save diagnostic system to be reworked anyway.

@jayrod246
Copy link
Contributor Author

Yeah I anticipated a rework when I was playing around with this.

I experimented with writing an actual parser for Zig compiler output, that tries to notice note:s for example that may appear on lines that follow a compile error. But this worked to get most diagnostics to show up for me.

@Techatrix
Copy link
Member

The : can be very annoying. Especially because it can be part of a valid filename like /somewhere/:.zig:2:5: error: ...
I would say that the best way forward is to wait for integration with Zig's compiler protocol which can send errors as std.zig.ErrorBundle. They don't require any parser which makes them far easier to deal with.

@Techatrix Techatrix merged commit 44a07a7 into zigtools:master Jul 20, 2024
3 checks passed
@jayrod246 jayrod246 deleted the buildOnSave-driveLetters branch July 20, 2024 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants