You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unexpected prompt to select a package when saving pubspec.yaml for Pub Workspaces if root is outside of open folders #5563
In this Flutter workspace, when I save bots/pubspec.yaml I'm prompted to run pub get in which folder. This should be automatic for the project where I just saved!
changed the title [-]Unexpected prompt to select a package when saving pubspec.yaml[/-][+]Unexpected prompt to select a package when saving pubspec.yaml for Pub Workspaces if root is outside of open folders[/+]on Jun 25, 2025
This happened because when selecting a project root, we only consider folders inside the workspace. However with Pub Workspaces, the project root (the target for running "pub get" can now be the workspace root instead of the nested project).
I've applied a fix to getFolderToRunCommandIn but we may need to review all uses of locateBestProjectRoot to see whether this restriction is useful. It's been there for 9 years and unclear if really required.
Activity
DanTup commentedon Jun 25, 2025
The same happens when opening the project and it prompts to run pub get. Clicking "Run pub get" results in a prompt.
[-]Unexpected prompt to select a package when saving pubspec.yaml[/-][+]Unexpected prompt to select a package when saving pubspec.yaml for Pub Workspaces if root is outside of open folders[/+]DanTup commentedon Jun 25, 2025
This happened because when selecting a project root, we only consider folders inside the workspace. However with Pub Workspaces, the project root (the target for running "pub get" can now be the workspace root instead of the nested project).
I've applied a fix to
getFolderToRunCommandInbut we may need to review all uses oflocateBestProjectRootto see whether this restriction is useful. It's been there for 9 years and unclear if really required.Dart-Code/src/project.ts
Lines 20 to 22 in 02b7f9f
Allow running "pub get" for folders outside of the workspace