Skip to content

Dart analyser need to be manually run too often #3334

Open

Description

@jaumard

each time I'm running flutter pub pub run build_runner build --delete-conflicting-outputs (or whatch equivalent) the IDE doesn't get what as been updated so I need to manually run the dart analyzer for the changes to be taken into consideration. Same when I flutter packages get I need to run the dart analyzer for the changes to be in the IDE.

Would be nice to run dart analyzer automatically on package get (or having a checkbox on settings to enable that).
For the build_runner I don't have any solution except implementing #3137 that will allow the IDE to run dart analyzer when needed.

Activity

  1. jaumard commented on Mar 29, 2019

    @jaumard
    Author

    another details I forget to mention, all my generated file are "excluded" as I don't want them analyzed or under source versioning

  2. added this to the On Deck milestone on Apr 1, 2019
  3. stevemessick commented on Apr 1, 2019

    @stevemessick
    Contributor

    How many dart processes are running? Have you tried restarting the analysis server?

    For me, it works as you expect it should after Tools > Flutter > Flutter Packages Get from the menu. Is that what you're doing?

  4. jaumard commented on Apr 2, 2019

    @jaumard
    Author

    Have you tried restarting the analysis server? How do we do that ?

    Tools > Flutter > Flutter Packages Get didn't know that one, I open the pubspec and click packages get on my side ^^

  5. devoncarew commented on Apr 2, 2019

    @devoncarew
    Contributor

    There's a 'restart' button in the Dart Analysis tool window.

  6. stevemessick commented on Apr 2, 2019

    @stevemessick
    Contributor

    @jaumard

    How many dart processes are running?

    The banner button in the pubspec.yaml editor does the same thing as the menu I mentioned earlier. I don't need to manually run the dart analyzer.

    I need to manually run the dart analyzer

    How do you do that?

  7. jaumard commented on Apr 2, 2019

    @jaumard
    Author

    How many dart processes are running?

    macbook-pro-de-jimmy:kiwi_mobile jaumard$  ps aux | grep dart
    jaumard          69518   0.0  0.0  4277252    828 s000  S+    6:00PM   0:00.00 grep dart
    jaumard          69409   0.0  3.1  4840740 524504   ??  S     6:00PM   0:33.99 /Users/jaumard/flutter/bin/cache/dart-sdk/bin/dart /Users/jaumard/flutter/bin/cache/dart-sdk/bin/snapshots/analysis_server.dart.snapshot --client-id=Android-Studio --client-version=AI-182.5107.16 --useAnalysisHighlight2
    jaumard          69391   0.0  1.3  4553724 213288   ??  S     6:00PM   0:01.94 /Users/jaumard/flutter/bin/cache/dart-sdk/bin/dart /Users/jaumard/flutter/bin/cache/flutter_tools.snapshot daemon
    

    How do you do that?
    Ho it's what you call restart in fact, but as it's a refresh button I was thinking it just run the analysis again :)

    I have a simple case working for me which is I'm running build_runner on my terminal, so new fields are available on my classes that are not visible yet on the IDE, I'm trying to click packages get to run the analysis but nothing append, field still unknown to the IDE. Then restart the analysis server and all good it's visible. But look like a lot of manual steps when you deal a lot with code generation ^^

  8. stevemessick commented on Apr 2, 2019

    @stevemessick
    Contributor

    all my generated file are "excluded" as I don't want them analyzed or under source versioning

    Are those the files that require you to manually run analysis? When you exclude files in IntelliJ you're telling the virtual file system to ignore them. Normally the VFS sends the analysis server a signal that a file has changed and it gets reanalyzed. But if you're telling the VFS to ignore the files then that signal won't get sent.

    Your dart processes look good; thanks.

  9. jaumard commented on Apr 2, 2019

    @jaumard
    Author

    Are those the files that require you to manually run analysis?

    Yes that why I mention it because I think the problem might be here. Excluded in the sens that they are under my .gitignore as I don't want then in versioning control. I tried to remove them from it but no more luck...

    But I think I found the problem !
    On my analysis_options I have this:

    exclude:
        - 'bin/**'
        - 'lib/l10n/messages/**'
        - 'lib/**/*.*.dart'
    

    Meaning that I don't want to have lint for generated file as they don't follow my conventions. But by doing that the analysis server is totally ignoring my changes ! I tried to remove the exclude rules and then it works ! So not sure if it's a problem on the plugin or on the analysis server :/ but at least we know the reasons ^^

  10. stevemessick commented on Apr 2, 2019

    @stevemessick
    Contributor

    Glad you tracked down the problem.

    @bwilkerson Is there a way for generated files to be treated differently from source files by the analyzer? It sounds like he wants the files to be analyzed but not to have any problems listed in the problems view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions