Skip to content

Use parso scopes to correctly determine if non top level types are in scope #15

Open
@anentropic

Description

@anentropic

Currently we find all the imports and class defs in the module and treat them as all "in scope" for any annotated function

So there are some edge cases where we would fail to auto-add an import because we treated a non-top-level classdef or import elsewhere in the module as in-scope, whne it wasn't

It looks like Parso is able to keep track of variable scopes in its parse tree... so we could potentially "get this right", just at the cost of even more complication in our auto-import logic...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions