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

Analyzer slow, broken, results in managled AST, incorrect error messages, etc... #50670

Open
firephreek opened this issue Dec 9, 2022 · 5 comments
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@firephreek
Copy link
Contributor

Dart Analyzer is getting worse and worse, taking longer and longer to complete and results in broken AST, mangled code, mis-colored structures, etc...Made a screen cast to see it in action. Events occur in real time.

In the video, I have two Text Widgets as placeholders that I change to MaterialButton widgets, surround with Expanded widgets. I then move to refactor the MaterialButton widgets into a new widget, MyIconButton and you can watch it all fall apart in the process. The end result is a broken AST where the syntax highlighting changes based on cut/pasting widgets and properties and dart messages showing errors/improper properties that aren't even there. Happy to show logs/diagnostics of everything I have, but this is an issue that continues to pop up over and over and over in the latest SDK. It's causing a great deal of frustration and actively slowing development. Quick-fixes will often break my code by injecting import statements directly into the middle of other import statements, making suggestions for things that don't exist, re-naming incorrect sections of code, or just taking anywhere from 5 to 30 seconds to update the AST breaking all code refactoring/fixes until the new AST is completed.

Workstation is a Pop_OS linux with upgraded drivers on an i9-9980XE, 64GB of Ram, latest version of Android Studio Dolphin 2021.3.1 Patch 1 and latest Flutter/Dark SDK's.

logs.zip

@bwilkerson bwilkerson added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Dec 9, 2022
@bwilkerson
Copy link
Member

@jwren @alexander-doroshko Might this be related to the line-ending issue reported elsewhere?

@alexander-doroshko
Copy link

alexander-doroshko commented Dec 9, 2022

@bwilkerson No, this is not related to that line-ending issue.

@firephreek First of all I see that logs are overfilled with the exceptions from the 3rd party 'Flutter Enhancement Suite' plugin. Please try to disable it and see if it makes any difference.

Second, I see freeze reports. Keywords are "sun.java2d.loops.Blit", "java2d.pipe.DrawImage", "SunGraphics2D", etc. I'm not an expert in this, unfortunately. Something is not great with JVM+Linux. I see that there are quite few issues with these words in JetBrains issue tracker: https://youtrack.jetbrains.com/. Among them I've met recommendations to upgrade or downgrade Linux version. There might be some other hints, I haven't read all these issues yet.

Next, you may try Android Studio Electric Eel RC (2022.1.x) or Android Studio Flamingo Canary (2022.2.x) or even IntelliJ IDEA 2022.3.

@firephreek
Copy link
Contributor Author

@bwilkerson I can try those, but to be sure, these are issues that seem to have persisted across platforms. I was on Windows 10 before this (same hardware/IDE) and they seemed even worse. If anything, they've lessened on linux. Happy to disable FES, it doesn't seem to do much anyways, not sure how much I can do re: the JVM on linux. I'm pretty sure it's just using the JVM that AS is using. The Sun/2D issues could be a GNOME issue or it might be picking up problems in the emulator. I'll get a System UI crash in the Pixel 4/Play emulator image if I let it stay in one place too long.

Again, these are issues I've been noticing despite the platform/plugins, but I'll troubleshoot those and see what, if anything, changes.

@bwilkerson bwilkerson added the P2 A bug or feature request we're likely to work on label Dec 13, 2022
@KlausJokisuo
Copy link

KlausJokisuo commented Dec 13, 2022

The analyzer has been working a bit better for a while unless you're generating code. If you're generating code you need to restart the analyzer quite often so it won't get stuck.

@bwilkerson
Copy link
Member

Thank you, that's a useful data point.

@srawlins srawlins added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

5 participants