Canop / bacon

background rust code check
https://dystroy.org/bacon
GNU Affero General Public License v3.0
1.95k stars 72 forks source link

Consider parsing JSON output from `check` and `clippy` #249

Open CorvusPrudens opened 3 weeks ago

CorvusPrudens commented 3 weeks ago

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 commented 6 days ago

it's possible this is impractical

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

crisidev commented 18 hours ago

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 commented 17 hours ago

@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 commented 17 hours ago

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.