Skip to content

[analyzer] Needs to determine the public library to use to reference elements defined in private libraries #55480

Open
@bwilkerson

Description

@bwilkerson

The problem we currently face is that when a tool needs to add an import for an element defined in a private library we have no way to add an import for anything other than the defining (private) library, even if that element is also exported by a public library.

The need is to be able to take an arbitrary element from an internal library and efficiently determine which public libraries, if any, make that element available. Individual tools could then decide how to handle the cases where there are zero, one, or many such libraries.

We minimally need this for code completion and quick fixes / quick assists / code actions. If we're going to support it for quick fixes we should implement this in such a way that plugins can also use this API.

The dartdoc implementation currently has the notion of a 'canonical' library. We'd like to unify these two pieces of implementation into a common set of APIs, though the concept of choosing one of the potentially many public libraries to be the canonical library might only be useful to dartdoc.

The question, then, is what design we ought to use for this piece of support. The purpose of this issue is to discuss whether there are other requirements and what that design might look like.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onanalyzer-apiIssues that impact the public API of the analyzer packagearea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.type-questionA question about expected behavior or functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions