Skip to content

Unused tag applied to too big range #253

Open
@rchl

Description

@rchl

In #229 support for DiagnosticTag was introduced for flake8 but the range in those diagnostics is not quite right.

With a file like (requires "pylsp.plugins.flake8.enabled": true):

from typing import Any, List


def foo() -> Any:
    return 1

the whole from typing line is marked with "unused" tag while only the List import is unused.

Here is how it looks with pylsp:

Screenshot 2022-08-24 at 08 29 48

Here is how it looks with pyright:

Screenshot 2022-08-24 at 08 30 19

@krassowski @ccordoba12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions