-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Analysis Server slows down when Save performed #50960
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
Comments
/cc @jensjoha for visibility |
Nice. 6de7ea7 is the reason --- a timer delays the analysis for 10 seconds and in the meantime it won't answer. In particular, when editing the file sdk/pkg/analysis_server/lib/src/legacy_analysis_server.dart Lines 765 to 776 in eba2188
I'll assign this to @scheglov who authored the introduction of this. It seems to have good intentions (from one of the comments in the commit "This helps for analysis server running remotely, with slow remote file systems") but miss the mark in letting everyone have this delay. |
From #50968 it's probably furthermore the mismatching line-endings between saved and not-saved when the IDE fires requests that make it respond as it does. This means that it's probably only an issue on Windows. If the previous overlay and the new file data has been identical (which it probably is on Mac and Linux) it probably wouldn't be that big of an issue. |
Oh, depending on how "format on save" is implemented that could possibly introduce a mismatch on non-Windows too. I haven't looked into that though. |
This reverts 6de7ea7 This hurts our external users, and I got an impression that the scenario for which we designed it initially is not the way our internal developers works now. Bug: #50960 Change-Id: I9b1ecf4860146d67963c5c99ecefc581e1526a89 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278883 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Samuel Rawlins <[email protected]>
Can we CP the fix to 2.19? |
Yes, this most certainly needs to be cherry picked once it bakes a bit. @srawlins could you make a CP request? |
Can do! |
Issue 50960. Revert delaying removing file overlays. This reverts 6de7ea7 This hurts our external users, and I got an impression that the scenario for which we designed it initially is not the way our internal developers works now. Bug: #50960 Change-Id: I9b1ecf4860146d67963c5c99ecefc581e1526a89 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278883 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Samuel Rawlins <[email protected]> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278993 Reviewed-by: Siva Annamalai <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
Thank you Flutter team for the fast fix, I can confirm the prebuilt Before I updated Flutter, I tried one more thing, so that the new lines of the file have unix line separator instead of windows line separator, and everything started to work so 6de7ea7 might be readded however it should work without this workaround. I also tested git @jensjoha was right about line endings:
|
Steps to reproduce
In Android Studio when
File | Settings | Languages & Frameworks | Flutter | Format code on save
orFile | Settings | Tools | Actions on Save | Reformat code
is enabled OR WITHOUT THEM and Save action is performed the Analyzer Server is not avaible for the saved file for a long time ~10 sec.In Visual Studio Code everything working fine.
Example code
Here is a little video both Rename
F2
and Context ActionsAlt + Enter
are working and whenever a Save Action is performedCtrl + S
the Analyzer won't suggest anything for more then 10 seconds and Rename is still not avaliable.android_studio.mp4
As you can see
Bloc
's plugin suggestions working fine however I cannot get any suggetsion for a long time from the Analyzer Server.Sometimes when
Format code on save
is enabled and I delete some method so some Class definition jumps into it's place then Rename might want to rename some method or it's constructors key paramter <= I think Analyzer Server doesn't get updated file. Edit: I made a seperate issue for this problem: #50968I can reproduce on both stable and beta channels.
dart --version
flutter --version
The text was updated successfully, but these errors were encountered: