[CP] Fix analysis_options.yaml "include:" for nested folders in workspace. #56464
Labels
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
cherry-pick-approved
Label for approved cherrypick request
cherry-pick-merged
Cherry-pick has been merged to the stable or beta branch.
cherry-pick-review
Issue that need cherry pick triage to approve
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Commit(s) to merge
https://dart-review.googlesource.com/c/sdk/+/376500
Target
stable
Prepared changelist for beta/stable
https://dart-review.googlesource.com/c/sdk/+/380205
Issue Description
When folders/package are nested in a workspace, and the
analysis_options.yaml
has aninclude:
that depends on the other package, theinclude:
does not get resolved. This fix allows for nested folders to be separate workspaces with packages. This fixes an issue that was introduced with the changes for monorepo support.What is the fix
The analyzer maintains a map of all known workspaces and their roots, and this is built by traversing the directory structure. The fix ensures that all nested roots were added to the map before any lookup is done.
Why cherry-pick
Since the
include:
in the analysis options cannot be resolved, the analysis performed can report errors/warnings that should be reported, and vice versa. This leads to a poor UX and makes it difficult to code, as now the user cannot rely on the analysis results.Risk
Low risk.
Issue link(s)
#56047
Extra Info
No response
The text was updated successfully, but these errors were encountered: