flutter / flutter-intellij

Flutter Plugin for IntelliJ
https://flutter.dev/using-ide
BSD 3-Clause "New" or "Revised" License
1.98k stars 319 forks source link

custom_lint: IDE Quick actions and errors are not shown in GUI #7600

Open rathishnk opened 3 months ago

rathishnk commented 3 months ago

Thanks for the feedback! If your issue is related to the Flutter framework itself, please open an issue at github.com/flutter/flutter.

Steps to Reproduce

Please tell us what you were doing and what went wrong

Building package executable... 
Built custom_lint:custom_lint.
Analyzing...                           0.0s

  lib/main.dart:15:11 • Use `optDouble` or `getDouble` from utils package for parsing double safely • avoid_double_casting • ERROR
  lib/main.dart:37:54 •  color linter • ERROR
  lib/main.dart:37:54 •  color linter • ERROR

3 issues found.

IDE does not show error in GUI

IntelliJ

Screenshot 2024-08-09 at 12 54 29 PM

VSCode

Screenshot 2024-08-01 at 11 45 08 AM

Version info

flutter --version

Flutter 3.22.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 761747bfc5 (9 weeks ago) • 2024-06-05 22:15:13 +0200
Engine • revision edd8546116
Tools • Dart 3.4.3 • DevTools 2.34.3

flutter doctor -v

[✓] Flutter (Channel stable, 3.22.2, on macOS 14.6.1 23G93 darwin-arm64, locale en-AE)
    • Flutter version 3.22.2 on channel stable at /Users/rathish.kannan/fvm/versions/3.22.2
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747bfc5 (9 weeks ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/rathish.kannan/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.11+0-17.0.11b1207.24-11852314)
    • 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.2

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

[✓] Android Studio (version 2024.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.11+0-17.0.11b1207.24-11852314)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.1.4)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 80.0.2
    • Dart plugin version 241.18808

[✓] VS Code (version 1.91.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (5 available)
    • Ratz  (mobile)        • 00008110-001E48EC0EB9801E            • ios            • iOS
      17.4.1 21E236
    • All expected network resources are available.

• No issues found!
droidpl commented 2 months ago

This seems to be related with the following error:

The request analysis.setContextRoots failed with the following error:
RequestErrorCode.PLUGIN_ERROR
ProcessException: No such file or directory
  Command: flutter pub get
at:
#0      _ProcessImpl._start (dart:io-patch/process_patch.dart:402:33)
#1      Process.start (dart:io-patch/process_patch.dart:38:20)
#2      _runNonInteractiveProcess (dart:io-patch/process_patch.dart:579:18)
#3      Process.run (dart:io-patch/process_patch.dart:49:12)
#4      CustomLintWorkspace.runPubGet (package:custom_lint/src/workspace.dart:772:36)
#5      CustomLintWorkspace.resolvePluginHost (package:custom_lint/src/workspace.dart:765:11)
#6      SocketCustomLintServerToClientChannel._startProcess (package:custom_lint/src/v2/server_to_client_channel.dart:151:24)
#7      SocketCustomLintServerToClientChannel.init (package:custom_lint/src/v2/server_to_client_channel.dart:110:22)
#8      CustomLintServer._maybeSpawnCustomLintPlugin (package:custom_lint/src/v2/custom_lint_analyzer_plugin.dart:394:25)
<asynchronous suspension>
#9      CustomLintServer._handleAnalysisSetContextRoots.<anonymous closure> (package:custom_lint/src/v2/custom_lint_analyzer_plugin.dart:341:9)
<asynchronous suspension>
#10     PendingOperation.run (package:custom_lint/src/async_operation.dart:22:14)
<asynchronous suspension>
#11     CustomLintServer._handleRequest (package:custom_lint/src/v2/custom_lint_analyzer_plugin.dart:173:22)
<asynchronous suspension>

It used to work some versions ago. The issue seems related to the environment variables used while running the linter in the IDE, that is not providing the full PATH which contains the flutter pub get.

uniwasa commented 1 month ago

I'm facing the same problem.

stefangaller commented 3 weeks ago

Seems to work with version 0.6.6.