-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support multi-option contexts #53876
Comments
This is a little hokey but I'm not sure it's worth over-thinking. Needless to say, input welcome! Context: #53876 Change-Id: I9c249156ee2573dc3a74c38f939a0d4ba36609a6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338583 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Phil Quitslund <[email protected]>
…a contextRoot I'm not crazy about the re-constitution of `File`s (see the TODO) but I'm not sure this is a yak we want to shave now (especially since this handler is not yet in use). Larger context: #53876 Change-Id: I4b9814842525ed4440aa39a7d14baa75f526f72a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339043 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Phil Quitslund <[email protected]>
I think the If |
Sorry for the confusion @rrousselGit. This is taking a bit longer than hoped (lots of moving parts). Out of curiosity, how are you using analysis options objects? In plugins? |
In analyzer_plugins, yes. In custom_lint specifically, a wrapper around analyzer_plugin to make it more dev friendly and improve support for monorepo in terms of memory usage. |
Thanks! If it isn't too much trouble, could you tell me how you're using analysis options in (fyi @srawlins.) |
Any updates on this effort, @pq , as a P1 feature? |
Thanks for the ping. This is currently blocked behind #54858. Will be revisiting that in the next week. |
Investigating current blocked (#55252) now. |
Fix for #55252 cleared up the |
I switched the |
|
The For example, with
With it set to false, you should see only one. If you don't have any nested options files, you won't see a difference. |
On the other hand, it's a necessary part of providing good monorepo support. Without this, every package in a monorepo would likely still have it's own analysis context, which would largely defeat the gains we expect to see from the monorepo support. |
Thank you for the confirmation. I'll patiently wait for pub workspace support. |
#53876 Change-Id: Ia6e8fd299685f6049862a7027e9c7734d806e328 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350342 Commit-Queue: Phil Quitslund <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
This reverts commit 409fa2c. Reason for revert: breaking Flutter Engine -> Framework roll. See: flutter/flutter#146506 Original change's description: > enable multi-option context support > > #53876 > > Change-Id: Ia6e8fd299685f6049862a7027e9c7734d806e328 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350342 > Commit-Queue: Phil Quitslund <[email protected]> > Reviewed-by: Brian Wilkerson <[email protected]> Change-Id: I226d2d70fc15b83c26de015a96a2f328d6d03122 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362000 Reviewed-by: Alexander Aprelev <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Bot-Commit: Rubber Stamper <[email protected]> Commit-Queue: Phil Quitslund <[email protected]>
Any updates? |
We're waiting for https://dart-review.googlesource.com/c/sdk/+/362442 to fully make it through a flutter roll before we can try to re-enable this. (See: #55413) |
See: #53876 With 0199e9d landed addressing #55413, this *should* now be safe to land. Change-Id: I2c2a8d47ae0ede04f5de56b558f5e61778bf05f3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364020 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Phil Quitslund <[email protected]>
22da6ed flips the bit but we've reverted related changes twice so I think we want to let it bake for a few more days at least before declaring victory. |
Looking at the latest engine roll (flutter/flutter#147373) which brings Dart in @b5f51d8, it looks like this change has safely made it's way into Flutter. Here's hoping this landing sticks. 🤞 |
With #55580 fixed, all known issues have been addressed. |
I think we can close this? Can we mark |
I'm in favor but have a few reservations. I've added it for discussion later today. |
The Dart Analyzer treats the presence of an
analysis_options.yaml
file as a signal to create an analysis context, a discrete, hermetic environment for analysis. In many cases this is unneeded and the memory overhead of elements that could be shared but are duplicated is significant, contributing to poor IDE performance.Plan: Decouple options from contexts, allowing one context to contain many analysis options files without any element model and file state duplication. To the user, there will be no change in semantics with reduced memory pressure and improved performance.
Follow-ups:
ContextLocatorImpl.singleOptionContexts
flag #56352Blocking:
MISSING_DEPENDENCY
reported on a flutter customer app #55413exclude:
path filtering works in multi-option contexts #54858context_locator
to not create fresh contexts for nested options #54714optionsFile
is provided #54791contextRoot.optionsFile
accesses #54312strictCasts
API access to lints #54376sdkVersionConstraint
getter toWorkspacePackage
#54043FileState
s #54124workspace.findPackageFor(file)
and seek improvements #54310Related:
AnalysisContext.getAnalysisOptionsForFile
be removed in favor of access fromResolvedUnitResult
? #54667The text was updated successfully, but these errors were encountered: