astral-sh / ruff-vscode

A Visual Studio Code extension with support for the Ruff linter.
Other
945 stars 45 forks source link

Does Ruff extension offer on-hover introspection? #492

Closed alexandreczg closed 3 weeks ago

alexandreczg commented 3 weeks ago

Hi,

I'm coming from the Pylance world and trying the Ruff language server. I just installed it on my vscode and wondering about if the on-hover introspection is offered?

Like in this screenshot:

image

The above is coming from Pylance. I was wondering if we still need both extensions? If I remove Pylance I don't get any introspection.

Thank you,

charliermarsh commented 3 weeks ago

Yeah, the Ruff LSP is intended to be used alongside a "full" LSP like Pylance. The Ruff LSP offers linting, quick fix, and formatting capabilities, but it is not a general LSP (i.e., it doesn't do Go-To Completion or similar).

alexandreczg commented 3 weeks ago

@charliermarsh Thank you!

I spent 2 hours trying to disable the extra extensions (ms-python.python, ms-python.vscode-pylance, etc) being installed, now I understand why it wasn't working 🤣

Quick follow-up. Is there a way to only have the linting coming from Ruff, and remove the LSP (Pylance) ?

image

charliermarsh commented 3 weeks ago

Oh no! I'm sorry for the trouble. When in doubt you can always ask.

Yeah, you can configure Pylance to stop showing those. There's some code here and here demonstrating how to configure it.