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

Consider parsing JSON output from check and clippy #249

Open
CorvusPrudens opened this issue Oct 25, 2024 · 4 comments
Open

Consider parsing JSON output from check and clippy #249

CorvusPrudens opened this issue Oct 25, 2024 · 4 comments

Comments

@CorvusPrudens
Copy link

This issue is motivated by crisidev/bacon-ls#2.

bacon's locations export doesn't surface enough information to fully describe spans in an editor. From my quick investigation, I believe this is because bacon simply parses the direct output of check and clippy, but do correct me if I'm wrong.

However, both tools can provide much more information with their JSON message formats as described here. As far as I can tell, json-diagnostic-rendered-ansi provides the best of both worlds by providing detailed information along with fully rendered messages.

I don't know what the scope of such a change would be, so it's possible this is impractical. However, while it may seem a little roundabout, I've found using bacon in this way very refreshing and more reliable than rust-analyzer for my larger projects. It would be amazing if we could get accurate spans to boot!

@Canop
Copy link
Owner

Canop commented Nov 8, 2024

it's possible this is impractical

This would require some work but is doable. Biggest problem for me today is finding time.

@crisidev
Copy link
Contributor

I am working on bacon-ls 0.4.0, but when I am done with the release, I have some time to start the MR and try to work on it.

@Canop
Copy link
Owner

Canop commented Nov 14, 2024

@crisidev I'm working on designing a new version of the analyzer framework, in accordance with this roadmap. Please come chat about what you intend to do exactly before starting a PR.

@crisidev
Copy link
Contributor

Nice, I'll join the chat to see if I can help.

After reading the roadmap, I think I can help updating the analyzers for cargo using json output, to provide precise locations.

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

No branches or pull requests

3 participants