Dart-Code: Dart formatter freezing
Everytime I try to save a .dart file, this window appears and won’t go away (the file is not saved, and it keeps waiting forever)
Log
!! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
Dart Code extension: 3.9.1
Flutter extension: 3.9.1 (not activated)
VS Code: 1.43.2
Platform: win
Workspace type: Flutter
Multi-root?: false
Dart SDK:
Loc: C:\Flutter\bin\cache\dart-sdk
Ver: 2.7.2
Flutter SDK:
Loc: C:\Flutter
Ver: 1.12.13+hotfix.9
HTTP_PROXY: undefined
NO_PROXY: undefined
Wed Apr 08 2020 [12:02:57 GMT-0300 (Horário Padrão de Brasília)] Log file started
[12:03:01] [Analyzer] [Info] ==> {"id":"24","method":"analysis.updateContent","params":{"files":{"C:\\Projects\\MedConf\\Frontend\\lib\\data\\database.dart":{"edits":[{"id":"","length":0,"offset":847,"replacement":"\r\n"}],"type":"change"}}},"clientRequestTime":1586358181456}
[12:03:02] [Analyzer] [Info] ==> {"id":"25","method":"analysis.updateContent","params":{"files":{"C:\\Projects\\MedConf\\Frontend\\lib\\data\\database.dart":{"edits":[{"id":"","length":2,"offset":849,"replacement":""}],"type":"change"}}},"clientRequestTime":1586358182296}
[12:03:02] [Analyzer] [Info] ==> {"id":"26","method":"edit.format","params":{"file":"C:\\Projects\\MedConf\\Frontend\\lib\\data\\database.dart","lineLength":150,"selectionLength":0,"selectionOffset":0},"clientRequestTime":1586358182614}
Wed Apr 08 2020 [12:03:11 GMT-0300 (Horário Padrão de Brasília)] Log file ended
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 16
- Comments: 38 (19 by maintainers)
Since Flutter v2.2, this issue is frequently occurring which is very annoying, I am having to restart the VS Code many a times.
Since I upgraded to Flutter 2.2 the problem has worsened. I’m getting this for all of my big projects
@DanTup
I know this issue is closed but I was also having this issue but I may have a helpful insight. The issue had something to do with having a large workspace in VS Code. I got an error saying “Cannot watch files in a large workspace” (I am paraphrasing because i am having trouble reproducing). Opening the Flutter app in its own workspace solved the problem for me.
@netgfx I think the original issue mentioned at the top was in an analyzer plugin, though there have been a few different issues mentioned throughout. There’s an open issue about the formatter taking a long time (which may or may not be the formatters fault - it may also be the server being busy and not starting to format for a while either) here:
https://github.com/Dart-Code/Dart-Code/issues/3270
There are some fixes that ma improved this that have not yet reached the Flutter stable channel, however I’d definitely be interested in logs even from stable to try and confirm exactly what’s going on. If you could enable the analysis server log and grab a copy next time you see this (note: it will include parts of your source files), please let me know (in the https://github.com/Dart-Code/Dart-Code/issues/3270 thread) and I can give you some notes on what to look for to extract relevant parts of the log (or if you can repro using a public project and can share the whole log, you can send it to logs@dartcode.org).
Thanks!