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

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

Open
rathishnk opened this issue Aug 9, 2024 · 9 comments
Open

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

rathishnk opened this issue Aug 9, 2024 · 9 comments

Comments

@rathishnk
Copy link

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

  • create a custom lint rule using custom_lint_builder
  • run dart run custom_lint shows the errors as
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
Copy link

droidpl commented Sep 9, 2024

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
Copy link

uniwasa commented Sep 28, 2024

I'm facing the same problem.

@stefangaller
Copy link

Seems to work with version 0.6.6.

@lunaticcoding
Copy link

same here

@hohlfma
Copy link

hohlfma commented Dec 17, 2024

same here!

@LeonP2ER
Copy link

LeonP2ER commented Jan 3, 2025

Problem still persists. Also, I cannot downgrade custom_lint. When I do, I get these errors:

Failed to build custom_lint:custom_lint:
../../.pub-cache/hosted/pub.dev/custom_lint_core-0.6.5/lib/src/node_lint_visitor.g.dart:92:41: Error: Type 'AugmentationImportDirective' not found.
  void visitAugmentationImportDirective(AugmentationImportDirective node) {
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/custom_lint_core-0.6.5/lib/src/node_lint_visitor.g.dart:686:42: Error: Type 'LibraryAugmentationDirective' not found.
  void visitLibraryAugmentationDirective(LibraryAugmentationDirective node) {
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@itsJoKr
Copy link

itsJoKr commented Jan 20, 2025

I'm not even using custom_lint, I get this issue. Cannot use build_runner right now.

@MartinAKovachev
Copy link

Any updates on the issue?

@olablessing
Copy link

add this to your pubspec yaml

dependency_overrides:
analyzer: ^6.3.0
custom_lint_core: ^0.6.6

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

10 participants