astral-sh / ruff-vscode

A Visual Studio Code extension with support for the Ruff linter.
Other
1.12k stars 53 forks source link

Auto restart ruff server when config changes #281

Open jd-solanki opened 1 year ago

jd-solanki commented 1 year ago

Hi 👋🏻

Thanks for the ruff. It's super incredible. I wanted a Python tool similar to ESLint and ruff is doing a perfect job. ❤️

I started using ruff and I noticed when I update the rules (In this example, I'm turning off the rule) in ruff.toml, the linting server isn't restarted automatically causing the warning to persist and I have to manually restart the server to ensure I have disabled the rule & get rid of warning lines in my code.

P.S. I'm using ruff.toml and we should do the same for other config files where ruff rules can be written like pyproject.toml

T-256 commented 3 months ago

Try enable nativeServer setting which I think it can help you.

dhruvmanila commented 3 months ago

Yes, this feature is available in the native server: https://docs.astral.sh/ruff/editors/features/#dynamic-configuration although I think it requires some additional configuration in Neovim because the client doesn't provide any handle for workspace/diagnostics/refresh. I'll open an issue in Neovim for this.