Skip to content

Auto-import should probably union __all__ definitions in some cases #1758

@BurntSushi

Description

@BurntSushi

Ref: https://github.com/astral-sh/ruff/pull/21779/files/d314aa859dcf9a6ffb006a594d7ca0431dd4fab2#r2586995420

Specifically, the auto-import AST scanner will assume that all conditionals are true. This could lead to some symbols not being declared as exported when they ought to be.

Instead, we might consider preferring false positives to false negatives by unioning __all__ definitions in such cases. We might suggest some things incorrectly, but thisis probably better than not suggesting correct symbols.

Metadata

Metadata

Assignees

No one assigned

    Labels

    completionsBugs or features relating to autocomplete suggestionsserverRelated to the LSP server

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions