fnando / vscode-linter

Extension for code linting, all in one package. New linters can be easily added through an extension framework.
https://marketplace.visualstudio.com/items?itemName=fnando.linter
MIT License
62 stars 16 forks source link

Correctly filter clippy results to include the current file only #38

Open OmegaJak opened 10 months ago

OmegaJak commented 10 months ago

Fixes #37.

Made a rust project in samples that can be opened as root for testing, not sure if that's how you like to do things but it helped me.

The clippy target.src_path that was being looked at always reported the main file of the project, not the current file. To filter to the current file, you have to look at the spans being returned.

Tested on Windows (where I had to do the silly \ to / conversion).