fix #51: support Dart workspaces with multiple pubspec files#57
Open
BIOMAS-Devel wants to merge 1 commit intobluefireteam:masterfrom
Open
fix #51: support Dart workspaces with multiple pubspec files#57BIOMAS-Devel wants to merge 1 commit intobluefireteam:masterfrom
BIOMAS-Devel wants to merge 1 commit intobluefireteam:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes support for Dart/Flutter workspaces where multiple
pubspec.yamlfiles may exist above a file.Problem
The extension currently expects to find exactly one
pubspec.yamlabove a Dart file.In Dart workspaces / monorepos, this is not always valid because both the workspace root and the package root may contain a
pubspec.yaml.This causes errors such as:
Fix
Instead of throwing when multiple
pubspec.yamlfiles are found, the extension now selects the nearest matchingpubspec.yamlfor the file when 1 or 2 files are found (3 or more is still considered an error).This preserves the expected behavior for single-package projects and allows the extension to work correctly in monorepos/workspaces.
Notes
I was able to verify the fix locally against the workspace scenario that triggered the bug.
I also hit some unrelated test/repo setup issues while trying to run the full test flow, so I’m documenting that here in case it helps review:
Should close #51.