LSP crashes while editing one specific file on my Flutter project.
See original GitHub issueDescribe the bug After updating to null-safe Flutter, a file named decorations.dart on my file hiearchy shows errors, crashes LSP and does not respond to modifications to the file (errors are still indicated even after modifying/fixing them.). LSP keeps producing error messages after every keystroke and mouse movement.
To Reproduce Steps to reproduce the behavior:
- Generate a file named decorations.dart. (On my project, file path is as following:
lib/values/decorations.dart
) - Write some code which violates null-safety.
- Try to modify file.
Expected behavior I expect the editor and LSP to behave same way as when I modify any other file.
Flutter Doctor Log
[√] Flutter (Channel stable, 2.0.2, on Microsoft Windows [Version 10.0.18363.1441], locale tr-TR)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 3.5)
[√] IntelliJ IDEA Community Edition (version 2018.3)
[√] VS Code, 64-bit edition (version 1.54.2)
[√] Connected device (2 available)
Note I get a seperate report from LSP for every action performed while modifying the file; here is a few examples:
[Error - 21:22:13] Request textDocument/hover failed.
Message: Invalid file path
Code: -32003
...\lib\values\decorations.dart
[Error - 21:22:13] Request textDocument/codeAction failed.
Message: Invalid file path
Code: -32003
...\lib\values\decorations.dart
[Error - 21:22:14] Request textDocument/documentHighlight failed.
Message: Invalid file path
Code: -32003
...\lib\values\decorations.dart
[Error - 21:22:14] Request textDocument/codeAction failed.
Message: Invalid file path
Code: -32003
...\lib\values\decorations.dart
[Error - 21:22:14] Request textDocument/hover failed.
Message: Invalid file path
Code: -32003
...\lib\values\decorations.dart
[Error - 21:32:58] Request textDocument/hover failed.
Message: Invalid file path
Code: -32003
...\lib\values\decorations.dart
[Error - 21:32:59] Request textDocument/hover failed.
Message: Invalid file path
Code: -32003
...\lib\values\decorations.dart
[Error - 21:32:59] Request textDocument/hover failed.
Message: Invalid file path
Code: -32003
...\lib\values\decorations.dart
[Error - 21:32:59] Request textDocument/codeAction failed.
Message: Invalid file path
Code: -32003
...\lib\values\decorations.dart
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Dart/ flutter: application crashes on startup - Stack Overflow
To check which library is causing the crash, look at the logs using Logcat by going to View > Tool Windows > Logcat...
Read more >New experimental Razor editor for Visual Studio - .NET Blog
You're now setup to use the new Razor editor when working with Razor files locally (.cshtml and .razor). What is Razor? Razor is...
Read more >Language Server Extension Guide - Visual Studio Code
Language Server is a special kind of Visual Studio Code extension that powers the editing experience for many programming languages. With Language Servers ......
Read more >Helix: A Neovim inspired editor, written in Rust | Hacker News
I've used Helix for all my recreational programming projects (in Rust) for about 6 months and I've written about 10kLOC of code with...
Read more >Documentation - Doom Emacs v21.12 documentation
TODO Projects; 5.6. TODO Programming. 5.6.1. LSP and servers; 5.6.2. Jump to definition/references; 5.6.3. Compiling; 5.6.4. Executing code on-the-fly ...
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
I was able to reduce this to a small amount of code in https://github.com/dart-lang/sdk/issues/45504. I think it might be related to having both private and public variables in the same definition:
Renaming
_kTwo
to justkTwo
or putting it in its own declaration seemed to prevent the issue, so that might be a reasonable workaround for you for now until the issue is fixed.I’ll close this issue as once it’s fixed in the SDK (and you have an updated SDK) there will be nothing to do in the VS Code extension. Thanks!
Thanks! I can reproduce this - it’s definitely failing to parse something in that code. I’ll try narrow it down and file an SDK issue with a small repro. Thanks!