Vscode 在我的 flutter dart 代码中显示白色 theme/text
Vscode showing white theme/text in my flutter dart code
在上图中,您可以看到整个 dart 代码都显示了白线,这是在我 运行 编写代码时我的笔记本电脑意外关闭后发生的。
它给出的第一个错误是损坏的 .git/packed-ref 文件,我修复了这个错误,但这个错误并没有消失,其他文件类型正在显示它们各自的颜色主题,只有 .dart 文件正在这样做。而且飞镖分析器也不工作
//Flutter doctor -v
[√] Flutter (Channel stable, 2.8.0, on Microsoft Windows [Version 6.3.9600], locale en-US)
• Flutter version 2.8.0 at D:\flutter\Sdk\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision cf44000065 (8 weeks ago), 2021-12-08 14:06:50 -0800
• Engine revision 40a99c5951
• Dart version 2.15.0
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc2)
• Android SDK at C:\Users\bright\AppData\Local\Android\sdk
• Platform android-31, build-tools 31.0.0-rc2
• Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin version 44.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.63.2)
• VS Code at C:\Users\bright\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.34.0
[√] Connected device (1 available)
• Edge (web) • edge • web-javascript • Microsoft Edge 97.0.1072.69
! Doctor found issues in 1 category.
我不完全知道问题出在哪里,因为它没有向我显示任何错误。请问我该怎么办?
我认为 Dart 扩展有问题(可能某些文件已损坏),但 uninstalling/re-installing 它不会从磁盘中删除文件 re-download 它。
我会尝试卸载 Dart 扩展,然后进入您的 %USERPROFILE%\.vscode\extensions
文件夹并删除任何 dart-code.dart-code
文件夹,然后 re-launch VS Code 和 re-install 它。
如果这不能解决问题,请在 https://github.com/Dart-Code/Dart-Code 提交问题。谢谢!
在上图中,您可以看到整个 dart 代码都显示了白线,这是在我 运行 编写代码时我的笔记本电脑意外关闭后发生的。
它给出的第一个错误是损坏的 .git/packed-ref 文件,我修复了这个错误,但这个错误并没有消失,其他文件类型正在显示它们各自的颜色主题,只有 .dart 文件正在这样做。而且飞镖分析器也不工作
//Flutter doctor -v
[√] Flutter (Channel stable, 2.8.0, on Microsoft Windows [Version 6.3.9600], locale en-US)
• Flutter version 2.8.0 at D:\flutter\Sdk\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision cf44000065 (8 weeks ago), 2021-12-08 14:06:50 -0800
• Engine revision 40a99c5951
• Dart version 2.15.0
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc2)
• Android SDK at C:\Users\bright\AppData\Local\Android\sdk
• Platform android-31, build-tools 31.0.0-rc2
• Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin version 44.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.63.2)
• VS Code at C:\Users\bright\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.34.0
[√] Connected device (1 available)
• Edge (web) • edge • web-javascript • Microsoft Edge 97.0.1072.69
! Doctor found issues in 1 category.
我不完全知道问题出在哪里,因为它没有向我显示任何错误。请问我该怎么办?
我认为 Dart 扩展有问题(可能某些文件已损坏),但 uninstalling/re-installing 它不会从磁盘中删除文件 re-download 它。
我会尝试卸载 Dart 扩展,然后进入您的 %USERPROFILE%\.vscode\extensions
文件夹并删除任何 dart-code.dart-code
文件夹,然后 re-launch VS Code 和 re-install 它。
如果这不能解决问题,请在 https://github.com/Dart-Code/Dart-Code 提交问题。谢谢!