Skip to content
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

Add an sdkVersionConstraint getter to WorkspacePackage #54043

Closed
Tracked by #53876
pq opened this issue Nov 14, 2023 · 8 comments
Closed
Tracked by #53876

Add an sdkVersionConstraint getter to WorkspacePackage #54043

pq opened this issue Nov 14, 2023 · 8 comments
Assignees
Labels
analyzer-analysis-options area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@pq
Copy link
Member

pq commented Nov 14, 2023

See discussion in https://dart-review.googlesource.com/c/sdk/+/335063/3/pkg/analysis_server/lib/src/services/user_prompts/dart_fix_prompt_manager.dart.

@pq pq added P1 A high priority bug; for example, a single project is unusable or has many test failures area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-analysis-options labels Nov 14, 2023
@bwilkerson
Copy link
Member

Let me summarize where I think that conversation landed. Let me know if I've misunderstood.

We're moving from AnalysisContext.analysisOptions to AnalysisContext.getAnalysisOptionsForFile (though we might want to consider dropping the get in the process). That is, the API will allow different files within an analysis context to have different analysis options.

We're moving from AnalysisContext.analysisOptions.sdkVersionConstraint to AnalysisContext.contextRoot.workspace.findPackageFor.sdkVersionConstraint. That is, the SDK constraints will be the same for everything within a package, but can be different from package to package within an analysis context.

We're postponing the decision about whether to wrap these values in an internal object for convenience and safety until we've had a change to understand what the impact would actually be.

@pq
Copy link
Member Author

pq commented Nov 14, 2023

That sounds right. Does it follow thatWorkspace will get a new sdkVersionConstraint property and it will be up to the concrete workspace types (Blaze, Gn, Pub, etc) to implement it?

@scheglov
Copy link
Contributor

Do you mean WorkspacePackage, not Workspace?

@bwilkerson
Copy link
Member

Yes, the proposal is that there will be a new WorkspacePackage.sdkVersionConstraint getter.

@bwilkerson
Copy link
Member

@keertip For visibility.

@pq pq changed the title Determine how SDK constraints will be resolved if not tracked by options files Add an sdkVersionConstraint getter to WorkspacePackage Nov 29, 2023
@pq
Copy link
Member Author

pq commented Nov 29, 2023

@keertip: I was possibly going to take a look at this (unless you want to?)

@keertip
Copy link
Contributor

keertip commented Nov 29, 2023

@pq, that's fine by me, have not had the cycles to start on this as yet.

@pq pq assigned keertip and pq and unassigned keertip Nov 29, 2023
copybara-service bot pushed a commit that referenced this issue Dec 6, 2023
See: #54043.

In a follow-up, we'll:

* deprecate `AnalysisOptions.sdkVersionConstraint` and
* update all callers to use `PubWorkspacePackage`

Change-Id: Ie24861d50168de79e6a6db511887aea5148987f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340021
Commit-Queue: Phil Quitslund <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
@pq
Copy link
Member Author

pq commented Dec 6, 2023

Implemented w/ a354347.

@pq pq closed this as completed Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-analysis-options area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

4 participants