Provide a way to copy the path to a file in the CPU Profiler
When running DevTools in a browser, on the CPU Profiler page, in the Bottom Up tab (and presumably elsewhere as well) each method is followed by a link whose label is the URI of the file (or maybe library) in which the method is defined. Clicking on the link opens the Debugger page showing the indicated file, but opens to the wrong location in the file. Given that the Debugger is in maintenance mode I don't expect that we're going to fix this behavior, but going to the debugger isn't really helpful anyway given that the method is no longer on the stack.
What would be helpful, and what I'm asking for, is to have a 'copy' button added after the link that would copy the path to the file. That would allow me to easily navigate to the file in my IDE.
When running DevTools inside your IDE (or launching the IDE-started DevTools in the browser), clicking on the link should navigate to the code directly in your IDE. Does this work for you? If that behavior is broken, we need to fix it.
Related to https://github.com/flutter/devtools/issues/4551 because the tree column text cannot be copied like other columns, which would also fix this issue. Although, I agree and easily accessible copy button would be helpful.
When running DevTools inside your IDE ... Does this work for you?
I have both the Dart and Flutter extension installed, but when I use the command pallet to look for "Flutter" commands (after starting the app) I don't see a way to run DevTools. Does it have to be a Flutter app that's running? This is a simple Dart script.
@DanTup it doesn't look like the "Dart: ..." devtools-related commands in the command palette have as much granularity as the "Flutter: ..." commands. A user who has a pure Dart project open should be able to open individual DevTools screens embedded in VS Code like a Flutter user could. Is there a bug here or does the current implementation not support opening a individual DevTools screen embedded in VS Code for a Dart project?
"Dart: ..." devtools-related commands
Oh! There's a "Dart: Open DevTools" command. I missed that when I read the docs.
So I tried it and both that and "Dart: Open DevTools in browser" open DevTools in my browser.
It's probably a configuration issue on my end.
@kenzieschmoll I can't repro this - for a Dart-only project I still see these options:
The Dart versions of the commands are defined in here:
https://github.com/Dart-Code/Dart-Code/blob/6e78541d09fa2e1aa20c12cbd5d3c382dfc1294d/package.json#L655-L668
We do currently only show them when you have an appropriate app running though (I don't recall exactly why, but you can't access the offline versions this way - though I'm not sure if that's the problem you were seeing).
@bwilkerson
Oh! There's a "Dart: Open DevTools" command. I missed that when I read the docs.
So I tried it and both that and "Dart: Open DevTools in browser" open DevTools in my browser.
It's probably a configuration issue on my end.
Can you check if you have dart.devToolsLocation set in your User or Workspace settings?
"dart.devToolsLocation": {
"default": "beside" // you can add "default" for a default, but also keys for individual sections like "inspector"
}
The default is "beside" which means to open embedded in a second column (besides the editor), but we also support "external" to always open externally (it's possible you changed this setting if you were testing DevTools in the sidebar recently?).
The "Open DevTools" command should use this setting, and the "in browser" one will always open in browser regardless of the setting.
Can you check if you have
dart.devToolsLocationset in your User or Workspace settings?
I do not, so presumably it should be using the default of "beside".
We do currently only show them when you have an appropriate app running though ...
I don't know whether it matters, but I don't think I had any app running when I tried them on Friday.
I don't know whether it matters, but I don't think I had any app running when I tried them on Friday.
Ah, it does. We don't currently support * loading embedded views that aren't connected to a VM Service, so if you don't have a debug session we'll always open externally from this command. If you had a session, then we would've instead prompted for which page you want to open (CPU Profiler, etc.) and then opened that embedded.
* I think this may have slightly changed with the sidebar, in that you can load the offline versions of some pages, but this command will still always spawn a browser.
@kenzieschmoll
When running DevTools inside your IDE (or launching the IDE-started DevTools in the browser), clicking on the link should navigate to the code directly in your IDE. Does this work for you? If that behavior is broken, we need to fix it.
This doesn't seem to work for me either embedded or in an external browser - I've filed https://github.com/flutter/devtools/issues/9174 with some notes. In both cases it navigates to the debugger view (which in the embedded mode is particularly confusing).