Closed
Description
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:
Blocking:
- test_fileSystem_deleteFile_packageConfigJsonFile fails #55580
- [multi-option contexts] spurious
MISSING_DEPENDENCY
reported on a flutter customer app #55413 - evaluate performance for multi-option contexts #55300
- Fix sort order of folders in options map to ensure most specific lookups #55252
- ensure
exclude:
path filtering works in multi-option contexts #54858 - verify that command line flags are updating multi-options #54849
- DAS diagnostics page is displaying *all* options files for each context #54816
- update
context_locator
to not create fresh contexts for nested options #54714 - add domain analysis tests that verify options are correct after deletions and aditions #54814
- add options map tests where an
optionsFile
is provided #54791 - update internal g3 linter rule tests to new options APIs #54770
- migrate away from (singleton)
contextRoot.optionsFile
accesses #54312 - analyzer: move strictCasts bool field out of TypeSystemImpl #53873
- deprecate uses (and update callers)
- remove API
- Add
strictCasts
API access to lints #54376 - Add an
sdkVersionConstraint
getter toWorkspacePackage
#54043 - Redesign the DAS diagnostics page to display multiple options per context #54074
- Cache analysis options objects in
FileState
s #54124 - evaluate where we call
workspace.findPackageFor(file)
and seek improvements #54310