devtools
ce7f5479 - Use dashTool and dashIdeName to identify the launching IDE (#10037)

Commit
34 days ago
Use dashTool and dashIdeName to identify the launching IDE (#10037) Use dashTool and dashIdeName to identify the launching IDE IDE integrations now pass the `dashTool` and `dashIdeName` query parameters when they launch or embed DevTools, alongside the legacy `ide` parameter: * `dashTool` is the canonical label of the Dash tool that hosts DevTools, such as `vscode-plugins` or `intellij-plugins`. It is shared by every variant of an IDE that uses the same plugin; VS Code, Cursor and Antigravity all pass `vscode-plugins`. * `dashIdeName` is the name of the IDE, such as `Visual Studio Code`, `Cursor` or `Android Studio`. Its values are open-ended, so it is only suitable for display and diagnostics. The legacy `ide` parameter (`VSCode`, `Android-Studio`, `IntelliJ-IDEA`) is an ad-hoc vocabulary that cannot describe new IDEs or forks of IDEs, and it is expected to be removed once IDE integrations have passed `dashTool` and `dashIdeName` for long enough (at least two years). This change moves DevTools over to the new parameters, while remaining compatible with IDE integrations that only pass `ide`: * DevToolsQueryParams gains `dashTool`, `dashIdeName`, `ideDisplayName` (`dashIdeName`, falling back to `ide`) and `isVsCode`. `isVsCode` is true when `dashTool` is `vscode-plugins` or when `ide` is `VSCode`. The `ide` getter is documented as legacy, with a TODO to remove it. * The two checks of `ide == 'VSCode'` now use `isVsCode`: the choice of docs that the Property Editor links to, and the decision not to notify users that DevTools fell back from WebAssembly to JavaScript when embedded in VS Code, which disables cross-origin isolation. * A survey's `devEnvironments` may now list `dashTool` labels (like `vscode-plugins`) as well as the legacy `ide` values (like `VSCode`). The legacy `VSCode` environment also matches VS Code forks. The matching moves to `meetsEnvironmentRequirementFor`, which takes the query parameters as an argument so that it can be unit tested. Older versions of DevTools only know the legacy values, so surveys that need to reach them should keep listing those. * The environment details that DevTools pre-fills into bug reports use `ideDisplayName`, so they name the actual IDE (like Cursor). Analytics are not changed by this commit. `Event.devtoolsEvent` in `package:unified_analytics` does not accept `dashTool` or `dashIdeName` yet, so DevTools continues to report only the legacy `ide` value. That needs a change to `unified_analytics`, and follows once it is published. Part of https://github.com/flutter/devtools/issues/9811
Author
Parents
Loading