Prompt to reload when Flutter projects are added to a Dart-only workspace#5617
Prompt to reload when Flutter projects are added to a Dart-only workspace#5617
Conversation
a213a5b to
d4beb85
Compare
|
/gemini review |
There was a problem hiding this comment.
Pull Request Overview
This PR adds functionality to prompt users to reload the VS Code extension when Flutter projects are added to a Dart-only workspace. The enhancement improves the user experience by automatically detecting new Flutter projects and offering to switch to Flutter SDK support.
- Adds a new
FlutterProjectWatcherclass that monitors pubspec.yaml file changes - Implements cache clearing functionality to ensure fresh project detection after reload
- Integrates the watcher into the extension activation process for Dart-only workspaces
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/shared/vscode/utils.ts | Exports a new clearCaches function to reset project folder cache |
| src/shared/utils/cache.ts | Adds a clear method to the SimpleTimeBasedCache class |
| src/extension/flutter/flutter_project_watcher.ts | New class that watches for Flutter projects and prompts for reload |
| src/extension/extension.ts | Integrates cache clearing and Flutter project watcher into extension activation |
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to detect when a Flutter project is added to a Dart-only workspace and prompts the user to reload. The implementation involves a new FlutterProjectWatcher that monitors pubspec.yaml files. The changes also include clearing project caches on activation to ensure new project types are detected after a reload. The overall approach is sound. I've provided one suggestion to improve the robustness of the new FlutterProjectWatcher by handling potential race conditions and improving resource management.
d4beb85 to
952c3f8
Compare
If you start with a Dart-only workspace and later add a Flutter project, you'll now be prompted to reload:
Fixes #5612