Skip to content

LSP not showing unused variable (in VSCode) #2607

@TurtleOrangina

Description

@TurtleOrangina

Unused variables in comprehensions are not highlighted (neither by ty nor by ruff).

Not sure where this issue belongs, but in VSCode I get this with pyright:

Image

But when using the ty Language Server I get:

Image

Note the difference in the color of the variable a. If I hover the a, pyright tells me it is unused, while ty does not. Is this something we can add to ty? It is a useful feature that can help catch bugs.

Metadata

Metadata

Assignees

Labels

featureNew feature or requestserverRelated to the LSP server

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions