Skip to content
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

Dart / Flutter thrown exception location opens in read-only ("Preview") mode #7646

Open
filiph opened this issue Sep 11, 2024 · 1 comment
Open

Comments

@filiph
Copy link

filiph commented Sep 11, 2024

Steps to Reproduce

  1. Install the Flutter IntelliJ plugin
  2. Create a new Flutter project
  3. Introduce a thrown exception (e.g. put throw "test"; anywhere inside the _incrementCounter() method)
  4. Run the app on any target (e.g. macOS)
  5. Hit the exception (e.g. press the + 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).

Screenshot 2024-08-19 at 10 18 49-1

This means code analysis doesn't work in the file:

Screenshot 2024-08-19 at 10 21 17-1

(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":

Screenshot 2024-08-19 at 10 24 00-1

The one workaround is to find the same file in the Project toolbar and open it, then find the same location manually.

Version info

flutter doctor --verbose
[✓] Flutter (Channel stable, 3.24.2, on macOS 14.4.1 23E224 darwin-arm64, locale en-US)
    • Flutter version 3.24.2 on channel stable at /Users/filiph/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4cf269e36d (7 days ago), 2024-09-03 14:30:00 -0700
    • Engine revision a6bd3f1de1
    • Dart version 3.5.2
    • DevTools version 2.37.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/filiph/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.3.2)
    • IntelliJ at /Users/filiph/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 78.4.2
    • Dart plugin version 233.15271

[✓] VS Code (version 1.92.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.84.0
@filiph
Copy link
Author

filiph commented Sep 11, 2024

I originally reported this issue on IntelliJ's YouTrack, but they say it's a plugin issue: https://youtrack.jetbrains.com/issue/WEB-68867

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant