Skip to content

Auto-import suggestions can suggest importing a symbol that already exists due to a * import #2820

@AlexWaygood

Description

@AlexWaygood

Summary

For example:

Image

reveal_type is already present in the global namespace here (due to the * import), so I'm surprised to see an autocompletion suggestion here that appears to indicate that it would add a from typing import reveal_type statement to the top of my module.

In actual fact, it seems like accepting the completion suggestion doesn't actually add an import? So perhaps this is just an issue with the label that's displayed on the completion suggestion.

to reproduce:

from typing import *

X = ClassVar[int]
reveal_

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    completionsBugs or features relating to autocomplete suggestionsplaygroundA playground-specific issueserverRelated to the LSP server

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions