Skip to content

Move WorkspacePackage into analyzer public API #60725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
srawlins opened this issue May 14, 2025 · 1 comment
Open

Move WorkspacePackage into analyzer public API #60725

srawlins opened this issue May 14, 2025 · 1 comment
Labels
analyzer-api Issues that impact the public API of the analyzer package area-dart-model For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.

Comments

@srawlins
Copy link
Member

srawlins commented May 14, 2025

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))
@srawlins srawlins added analyzer-api Issues that impact the public API of the analyzer package area-dart-model For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer. labels May 14, 2025
@srawlins
Copy link
Member Author

CC @stereotype441 @scheglov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-api Issues that impact the public API of the analyzer package area-dart-model For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.
Projects
None yet
Development

No branches or pull requests

1 participant