-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select Widget outputs <inspected variable> into Debug Console instead of selecting the code in VS Code Editor #2522
Comments
When this issue occurs what happens if you have dart devtools open to the inspector? Does the selection change in the widget tree or not? Danny did you change anything related to how VSCode handles dart:developer inspect api? |
@jacob314 nothing has changed recently, but a while ago I made calling For this to occur, it suggests that I did some testing and couldn't repro this, though I did note that if you click the Do you know of anything that could prevent |
If I understood you right when the Dart Devtools inspector is open and I click on a widget, it selects that widget in the widget tree but it does not select the widget in the code (doesn't open the file to the widget position). I found out that this happens when I have multiple emulators running at the same time (I need it for correct positioning of widgets). I open both emulators from VS Code, select one of them (let's say number 2) as the 'default' for VS Code, run F5 to start the debug session, then use a different CLI to start the same application on a different emulator. To reproduce, I just have to switch the 'default' emulator in VS Code while the debug session is running. After that, it starts outputting the 'inspected variable' into the console until I remove the application from the device. |
@jacob314 Another update: right now after it starts outputting |
@jacob314 could building the app a second time be overwriting anything that might affect this? As far as VS Code is concerned here, there's only one app (the one launched from VS Code). The file system (/build folder) is the only thing I can think that would be shared/stateful (although I don't know whether that should impact the inspector at all). |
Any update on that guys? |
@esentis are you seeing this even without running the app on two devices/simulators at the same time? Do you have steps to reproduce? |
@DanTup Yes, I'm running it in just one instance (emulator). Unfortunatelly I don't have any steps to reproduce, since it started occuring suddenly in a project that I'm working on for months, and it's mildly annoying. The issue is present only on this specific project. I'm sorry for not being more helpful... |
Guys are there any updates about this issue? It still persists on my project. |
@jacob314 any thoughts on how to track this down? I believe the VS Code behaviour of showing the inspected variable is somewhat unrelated. This only occurs when there's no widget summary. If I remove that, then inspecting will just do nothing at all. The problem is that response to @kovalyovi capturing a log may be useful:
This should capture the VM service traffic (which should include the response to |
I'm not sure why |
After the latest VS update the bug seems to be gone for me. I don't know if it was associated with it though :/ |
I don't think there are any changes in this area in the VS Code extension, although Flutter 2.0 was around the same time which contained significantly more. @kovalyovi do you still only see this when running multiple instances of
Happy to file an issue - although I'm not sure I entirely understand the request. Do you mean instead of firing the |
I apologize but reproducing is simply impossible. My project is 40k+ lines of code and it's private for the customer, so I can't provide reproducible code.
No, I have it when only one emulator is running. I already forgot what it is to use Dart DevTools since it's giving so many problems that I can't use it effectively, so I use Logs
|
Hi, I got same problem on my project. emulator working fine, only happen with real Android device (my Samsung A9 pro Android 8.0) got message So I tried comment each block code in my
Just comment above line then it working normal on my real device. Find more detail on what that line do, I found maybe because isolate or something make Final result is if comment line below then it work
I have repo here https://github.com/noncheat/flutter_helloworld You can try debug it on real Android device and see. Hope it helpful. |
@jacob314 I can repro this using @quyenvsp's instructions above. I don't think it's VS Code related, but I'm not sure where the problem is. When I run the app without the call to
However, when I add back
Any thoughts on whether this is likely an Inspector issue or a Firebase issue? |
Even I am facing this issue. However for me, restarting the debug session seems to solve the issue. |
Any update on this issue? I've been facing the same issue. |
Any Updates ?? |
My understanding of the original issue is that when the Firebase initialisation was performed, the inspector would no longer navigate to the code in the editor, and would output "". The first part was the cause of the second part (that is, if an Testing this today using the new SDK debug adapters (which are being rolled out gradually), the navigation works even with the Firebase initialization. Whatever was causing the inspector navigation to fail previously appears to be fixed. You can opt-in to the new debug adapters early with the So, I believe the outstanding issue (at least when using the new debug adapters) is that "" is also printed to the debug console. This happens because the inspector is currently using both the new mechanism (ToolEvent) and old mechanism ( The ideal fix for this would be to remove the But doing that would either need to be conditional on knowing the client editor is handling the new @CoderDake do you know of any way we could provide some signal to the inspector that the client is able to handle ToolEvent and the |
We should remove the call to inspect at L1584 and dispatch a custom event notifying the Flutter Inspector that the inspector selection has changed. I don't see anything blocking us from making that change. The inspector doesn't even need to know the object selected as it can query the inspector to determine that. |
By "Inspector" here, do you mean IntelliJ? I assumed that IntelliJ was listening for that
|
I've noticed that sometimes (doesn't depend on anything, based on my experience with it)
DevTools Widget Inspector
, when in theSelect Widget Mode
and when you click on a widget in Android Emulator, instead of highlighting the source code in the project it just outputs<inspected variable>
into VS CodeDEBUG CONSOLE
.Previously, it would be solved when I reload VS Code but now I reinstalled VS Code, reinstalled Flutter and Dart extensions, wiped the emulator data and nothing helps - Flutter DevTools just doesn't work. How to fix that?
The text was updated successfully, but these errors were encountered: