Skip to content

Add pre-activation global Flutter commands to package.json - #21

Merged
DanTup merged 3 commits into
Dart-Code:masterfrom
DanTupBot:issue6379_flutter_commands
Nov 12, 2026
Merged

DanTup merged 3 commits into
Dart-Code:masterfrom
DanTupBot:issue6379_flutter_commands

Conversation

@DanTupBot

Copy link
Copy Markdown
Collaborator

Fixes Dart-Code/Dart-Code#6379 (part of Dart-Code/Dart-Code#1404; removing the duplicate declarations from Dart-Code is tracked for v3.150.0 in Dart-Code/Dart-Code#6424).

Summary

Adds flutter.createProject ("Create New Project"), flutter.doctor ("Run Flutter Doctor"), and flutter.upgrade ("Run Flutter Upgrade") to contributes.commands in package.json (without explicit menus.commandPalette entries).

All runtime vs.commands.registerCommand(...) implementations remain in Dart-Code. Keeping the declarations in Dart-Code/package.json through the v3.148.0 release cycle provides a clean overlap period before Dart-Code/Dart-Code#6424 removes them in v3.150.0, so users who update Dart before Flutter (e.g. Dart pre-releases with Stable Flutter) do not lose these commands from the Command Palette.

Verification

Verified in VS Code 1.146.0 (in an empty window prior to extension activation):

  • With both Dart-Code and Dart-Code/Flutter declaring the 3 commands (overlap), each command appears once in the Command Palette with zero warnings/errors or package.json diagnostics:

    Command Palette during overlap

  • With the 3 commands removed from Dart-Code (and onCommand:... added to Dart-Code's activationEvents), all 3 commands appear in the Command Palette when Flutter is installed, activate Dart-Code.flutter -> Dart-Code.dart-code, and execute Dart-Code's handlers directly; when Flutter is uninstalled, none of the 3 commands appear.

@DanTupBot DanTupBot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Reviewed the manifest changes and verified both stages end-to-end in VS Code 1.146.0 (alongside inspecting VS Code's MenuRegistry / CommandService implementation):

  • Overlap with Dart-Code (short-term): Tested in both extension load orders (Dart before Flutter and Flutter before Dart). Each of flutter.createProject, flutter.doctor, and flutter.upgrade appears once in the Command Palette before and after activation (MenuRegistry._appendImplicitItems skips commands already present in menus.commandPalette), vscode.extension-editing reports zero package.json diagnostics, and VS Code only logs [info] messages for the duplicate command contributions with no warnings, errors, or runtime conflicts.
  • After removal from Dart-Code (Dart-Code/Dart-Code#6424): Verified in an empty unactivated window that all three commands still appear in the Command Palette when Flutter is installed, remain unactivated until selected, and when executed from the Command Palette cleanly activate Dart-Code.flutter -> Dart-Code.dart-code and invoke Dart-Code's registerCommand handlers (both with and without explicit onCommand:... entries in Dart-Code's activationEvents). When Flutter is not installed, none of the three commands appear in the Command Palette.

@DanTup
DanTup added this pull request to the merge queue Nov 12, 2026
Merged via the queue into Dart-Code:master with commit 35c5a18 Nov 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add pre-activation global Flutter commands (createProject, doctor, upgrade) to the Flutter extension manifest

2 participants