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

Support and Integration for VSCode #118

Closed
harshalchaudhari35 opened this issue Sep 7, 2022 · 10 comments · Fixed by #655
Closed

Support and Integration for VSCode #118

harshalchaudhari35 opened this issue Sep 7, 2022 · 10 comments · Fixed by #655

Comments

@harshalchaudhari35
Copy link

Is there a way to add ruff as a python linter in VScode?

@Jackenmen
Copy link
Contributor

If the maintainers decide that editor integration is in scope for this project rather than separate dedicated projects, I would like to suggest using Language Server Protocol for this to allow usage with many editors at once (editors that support it include: Visual Studio, Visual Studio Code, Neovim, Sublime Text, JetBrains Fleet, and more):
https://microsoft.github.io/language-server-protocol/

@HallerPatrick
Copy link
Contributor

I think @jack1142 made a good suggestion here. I just researched a little, and integrating ruff as a linter in VSCode is not trivial. The best way is to create a PR for the official Python extension. It doesn't look too complicated, but I am also not sure if they are willing to support a new, not fully stable linter.

As a Neovim user, I am happier with a LSP, which is easily integrable. I might take a look at it.

@Jackenmen
Copy link
Contributor

VS Code Python team is actually pushing for this as well (LSP-based integrations, not necessarily the linter themselves implementing language server protocol themselves), they're working on extension templates and stuff like that to make it easy to create new integrations for linters with hopefully no TypeScript knowledge required (unlike the current solution which does require that). Considering that a lot of this is still being worked on, it might not make sense to work on VS Code specific extension just yet. LSP is generic enough that it's likely that not much will be needed to make a VS Code specific extension for it in the future.

Here are a bunch of related issues:

@dinhanhx
Copy link

@charliermarsh
Copy link
Member

Worth mentioning, for anyone that comes across this issue in the future, that we now have a dedicated Ruff VS Code Extension.

@CodeFanaticX
Copy link

Worth mentioning, for anyone that comes across this issue in the future, that we now have a dedicated Ruff VS Code Extension.

Hello. The vscode extension is not yet updated. I really want the fix for "f-string without any placeholders"

@charliermarsh
Copy link
Member

I cut a new pre-release extension with the latest Ruff version.

@jaxwagner
Copy link

jaxwagner commented Dec 12, 2023

Is there a way to specify the version of ruff that is run in the vscode extension? specifically, it would be super helpful to be able to run version 0.1.6 or 0.1.7. Is this the only way to run one of these later versions https://github.com/astral-sh/ruff-vscode#using-a-custom-version-of-ruff ? thanks so much! 🙏

@zanieb
Copy link
Member

zanieb commented Dec 12, 2023

@jaxwagner The extension will use your Python project's Ruff version if available. It will only fall back to the bundled version if it cannot find a compatible one in your environment.

@jaxwagner
Copy link

thanks so much @zanieb ! super helpful really appreciate it 🙏

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 a pull request may close this issue.

8 participants