Repository navigation
Demote .dart_tool/package_config.json to after PATH when searching for an SDK - #6109
Conversation
There was a problem hiding this comment.
Pull request overview
Updates Flutter SDK discovery to prefer SDKs available on the user’s PATH over the Flutter SDK path inferred from .dart_tool/package_config.json, addressing scenarios where users switch SDKs via environment changes (eg. nix/direnv) but the extension continues using a previously-cached SDK reference.
Changes:
- Reorders Flutter SDK search paths so
.dart_tool/package_config.json-derived SDK paths are only used afterPATH. - Adds an explanatory comment noting
.dart_tool/package_config.jsonis now a fallback and that Pub status checks will detect mismatches and prompt a rerun.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request adjusts the SDK search path order in src/extension/sdk/utils.ts by moving the extraction of the Flutter SDK path from the packages file to be a fallback after the user's PATH. This ensures that changes to the SDK on the user's PATH are prioritized. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
3cbb577 to
ca89c4b
Compare
Fixes #5844
Also see #4607