Dart-Code/Dart-Code#5970 is a request to change the values pass in the querystring passed to DevTools to include the proper IDE name and not hard-coded values like "VSCode" (which prevents distinguishing VS Code forks using the same extension, like Antigravity or Cursor).
However, there are some places that currently assume "VSCode" here in DevTools that I think require reviewing first (or, we need to pass two values).
- Survey IDE filters
- WASM/JS fallback message
- Property editor documentation link
1. Survey IDE Filters
|
// This list is optional and can be used to limit the survey to a specific |
|
// set of users based on their development environment. |
|
'devEnvironments': ['Android-Studio', 'IntelliJ-IDEA', 'VSCode', 'CLI'], |
I don't know if this is used, but if it is, it would need to cover each of the variations of editors now. I think we could either:
- Update this comment to mention this is based on DASH__IDE_NAME and include updated examples ("Visual Studio Code", "Antigravity", "Cursor")
- Pass two values in querystring, DASH__IDE_NAME and also DASH__TOOL (or DASH__PLUGIN_NAME) which are constant across different IDE flavours using the same plugin/extension
2. WASM/JS fallback message
|
// Do not show the JS fallback notification when embedded in VS Code |
|
// because we do not expect the WASM build to load successfully by |
|
// default. This is because cross-origin-isolation is disabled by VS |
|
// Code. See https://github.com/microsoft/vscode/issues/186614. |
|
final embeddedInVsCode = |
|
queryParams.embedMode.embedded && queryParams.ide == 'VSCode'; |
|
if (!embeddedInVsCode) { |
|
notificationService.push( |
|
'Something went wrong when trying to load DevTools with WebAssembly. ' |
|
'Falling back to Javascript.', |
|
); |
|
} |
It controls whether to show a message if the wasm version fails. I'm not sure if this is necessary anymore, as I think there were WASM changes to not require COI? If so, this code could probably just be deleted (and if not, I think won't cause any problems). Needs testing though.
3. Property editor documentation link
|
String? _documentationLink() { |
|
final queryParams = DevToolsQueryParams.load(); |
|
final isEmbedded = queryParams.embedMode.embedded; |
|
if (!isEmbedded) return null; |
|
const uriPrefix = 'https://docs.flutter.dev/tools/'; |
|
const uriHash = '#property-editor'; |
|
return '$uriPrefix${queryParams.ide == 'VSCode' ? 'vs-code' : 'android-studio'}$uriHash'; |
|
} |
If IDE is not exactly "VSCode" this will link to the Android Studio docs.
Dart-Code/Dart-Code#5970 is a request to change the values pass in the querystring passed to DevTools to include the proper IDE name and not hard-coded values like "VSCode" (which prevents distinguishing VS Code forks using the same extension, like Antigravity or Cursor).
However, there are some places that currently assume "VSCode" here in DevTools that I think require reviewing first (or, we need to pass two values).
1. Survey IDE Filters
devtools/packages/devtools_app/lib/src/shared/development_helpers.dart
Lines 229 to 231 in 6046c5b
I don't know if this is used, but if it is, it would need to cover each of the variations of editors now. I think we could either:
2. WASM/JS fallback message
devtools/packages/devtools_app/lib/src/shared/preferences/preferences.dart
Lines 239 to 250 in 6046c5b
It controls whether to show a message if the wasm version fails. I'm not sure if this is necessary anymore, as I think there were WASM changes to not require COI? If so, this code could probably just be deleted (and if not, I think won't cause any problems). Needs testing though.
3. Property editor documentation link
devtools/packages/devtools_app/lib/src/standalone_ui/ide_shared/property_editor/property_editor_panel.dart
Lines 172 to 179 in 6046c5b
If IDE is not exactly "VSCode" this will link to the Android Studio docs.