Open filiph opened 12 hours ago
Summary: The issue reports that when an exception is thrown in a Dart/Flutter application running in IntelliJ, the code location is opened in read-only "Preview" mode, preventing code analysis, "Go to definition", and editing.
Note: The following issue was first filed in IntelliJ's YouTrack bug tracker, but there it was rejected with "Flutter is a third-party plugin maintained by Google, please try reporting the issue to the plugin vendor." I then filed the bug over at https://github.com/flutter/flutter-intellij/issues/7646 but since realized the bug is probably not specific to Flutter. Also, that bug was not touched since it was filed on September 11 and the tracker seems half-abandoned.
If you think I'm just filing a duplicate, feel free to close it as such, and I'm sorry for wasting your time. But I was seeing a bunch of
label:area-intellij
issues on this repo issue tracker so I thought maybe it belongs here. The original issue follows, and I'm happy to elaborate.Steps to Reproduce
throw "test";
anywhere inside the_incrementCounter()
method)+
button)Expected
The code location (e.g.
lib/main.dart
) is opened in the editor.Actual
The location is open, BUT it's open in Preview mode (filename in italics).
This means code analysis doesn't work in the file:
(Note the "No usages found" callout, although the method is clearly used in the code.)
Therefore, there's no "Go to definition", which is incredibly frustrating. There's also no syntax highlighting beyond the basics.
And when one wants to change the file where the problem happened (a common occurrence), the IDE refuses with "Failed to make ___ writable":
The one workaround is to find the same file in the Project toolbar and open it, then find the same location manually.
It looks as though the file that the IDE opens on exception is some temp/memory copy of the real file, and the linkage to the original file is lost on the IDE. I hypothesize that this might be an analyzer issue?
Version info