devtools
devtools copied to clipboard
Have IDEs that start DTD pass their identifier
Currently, we don't know which IDE is launching devtools becuase it is not being shared with dds.
For example, we should know if devtools was being started with VS Code with dds. This will allow us to pass this value to the analytics instance from package:unified_analytics
so that it can be recorded with each event sent.
cc @kenzieschmoll , feel free to edit the issue to add any info that could be helpful
When the IDEs (or DDS in the case of flutter tools and dart CLI entry points) start DevTools, they should pass in information about who started the devtools server. It would be pretty simple to add a flag for this.
CC @DanTup @helin24
We currently set some env variables that other tools use for this:
https://github.com/Dart-Code/Dart-Code/blob/37ae5ace42c372c1c65ae7797d892cac21128ee2/src/extension/utils/processes.ts#L27-L28
Env variables have a slight benefit in that they're inherited by child processes automatically (so if DevTools spawned something else, it wouldn't need to also pass down flags).
We've talked about standardising in the past, maybe now is a good time to agree on a new generic variable ("DART_EDITOR" or something?). I'd also like to expand the string from VS Code to be a bit more specific (like "VSCode", "VSCode-wsl", "VSCode-server") so it's clearer in what different contexts the tools/extension are being used.
With active work to create a unified analytics service in DTD (https://github.com/dart-lang/sdk/issues/55280), I think it is more straight forward now to pass an identifier into the DTD startup code. (e.g. vs-code, intellij, devtools-server, or dds).
@kenzieschmoll what's the status of this? Is there a defined way for us editors to pass a value here now or does it still require DTD/analytics changes?
No work has happened here yet. This should be as simple as adding a flag to DTD (maybe --started-from
or --source
?): https://github.com/dart-lang/sdk/blob/master/pkg/dtd_impl/lib/src/dart_tooling_daemon.dart#L61.
and then passing that through to the UnifiedAnalyticsService object so it can be used here: https://github.com/dart-lang/sdk/blob/master/pkg/dtd_impl/lib/src/service/unified_analytics_service.dart/#L185
Whoever is starting DTD will need to pass that flag with an identifier (e.g. vs-code, intellij, devtools-server, or dds).