Analyzing is not stopping when a syntax error occurred
See original GitHub issueSo when I make a syntax error (e.g. typing a widget that doesn’t exist/not imported) analyzing is not stopping. This broke autocomplete, hover preview, and formatting. Restarting VSCode or reopening the project folder fixed this, but that’s quite annoying since syntax error is (always) gonna happen when coding.
I think this happens after I updated to version 3.0.0 earlier and also updated flutter to 1.5.4, because before I updated this didn’t happen.
VSCode version 1.33.1 Dart-Code version 3.0.0 Output of flutter doctor:
[√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.17763.475], locale en-US)
• Flutter version 1.5.4-hotfix.2 at D:\Devs\Flutter\flutter
• Framework revision 7a4c33425d (9 days ago), 2019-04-29 11:05:24 -0700
• Engine revision 52c7a1e849
• Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at D:\AndroidSDK
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = D:\AndroidSDK
• ANDROID_SDK_ROOT = D:\AndroidSDK
• Java binary at: D:\AndroidStudio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[√] Android Studio (version 3.2)
• Android Studio at D:\AndroidStudio
• Flutter plugin version 31.3.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[√] VS Code, 64-bit edition (version 1.33.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.0.0
[√] Connected device (1 available)
• Redmi 3S • c37ae0927d63 • android-arm64 • Android 6.0.1 (API 23)
• No issues found!
Issue Analytics
- State:
- Created 4 years ago
- Comments:24 (13 by maintainers)
Top Results From Across the Web
One file with syntax errors should not stop SAST and ... - GitLab
A "syntax error" here is an unsupported runtime essentially; new javascript features our parser doesn't recognize. If we can't strip comments ...
Read more >JavaScript Syntax Errors and How to Prevent Them - Meticulous
The complete guide on JavaScript Syntax Errors, how they occur, and techniques and tools available to prevent them.
Read more >How to Identify and Resolve Python Syntax Errors - Coursera
Syntax errors occur when you enter a character or string that is unrecognizable to a system's interpreter. Instead of executing the program, the ......
Read more >Fix program errors and improve code - Visual Studio (Windows)
This article describes some basic ways Visual Studio can help you find and fix problems in your code, including build errors, code analysis, ......
Read more >Are there any compilers that attempt to fix syntax errors on ...
The reason for syntax errors is because a parser could not create the abstract syntax tree out of the program. This happens when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@larssn
Understood - though even just opening an issue with a short description would help - at least we’d know there’s a potential issue. Sometimes these perf issues turn out to be trivial to diagnose. I have tried to make it as simple as possible to gather logs with the Dart: Capture Logs command (which aggregates logs from analyzer, debugger, flutter, pub, etc. into one), but I’m always open to improving this if people have ideas.
For ex. https://github.com/microsoft/vscode/issues/71165 was huge lockup in VS Code’s UI that a user reported (but I’d never experienced). It took me a while to get a log (he was also very busy and figured it’d be lots of effort), but from the log it was immediately obvious he had thousands of errors and I was able to easily reproduce. I reported it to VS Code and it was fixed the same day (and available to the user in Insiders the following day!).
So if you do get some time when you’re not so busy, please do open a new issue (it might not be the same as this one, so easier to investigate separately) and with the info you can easily get, and we’ll go from there.
Ok, I’ve opened https://github.com/dart-lang/sdk/issues/36911 for the pausing issue, and I’ve changed VS Code to never use
--observe
which should prevent it ever stopping the server (I’ve confirmed it doesn’t pause with this change - instead it just retries, and then eventually deliver the results 😃).