Skip to content

Move WorkspacePackage into analyzer public API #60725

Closed
@srawlins

Description

@srawlins

As part of moving LintRule and it's dependencies into public API (#50986), I see that we expose WorkspacePackage, and intentionally. Lint rules use it to figure out if a file is in public API, or if it's in the lib/ directory, etc.

So I'd like to move WorkspacePackage into public API. Luckily, we can extract a very small subset of the class, into a new class WorkspacePackage, and rename the private impl code WorkspacePackageImpl.

Here's a draft CL: https://dart-review.googlesource.com/c/sdk/+/428564

Here are the new bits in api.txt, quite minimal:

package:analyzer/workspace/workspace.dart:
  WorkspacePackage (class extends Object):
    new (constructor: WorkspacePackage Function())
    canHavePublicApi (getter: bool)
    root (getter: String)
    contains (method: bool Function(Source))
    isInTestDirectory (method: bool Function(File))

Metadata

Metadata

Assignees

No one assigned

    Labels

    analyzer-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

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions