flutter - 查看 .pub-cache 文件给出 Request textDocument/

每次查看第三方 flutter 包(在 .pub-cache 文件夹中)的代码时,我都会收到这些错误消息:

[Error - 7:19:24 PM] Request textDocument/documentSymbol failed.
  Message: Invalid file path
  Code: -32003 
/Users/benjaminfarquhar/development/flutter/.pub-cache/hosted/pub.dartlang.org/hive-1.4.4+1/lib/src/hive_impl.dart
[Error - 7:19:24 PM] Request textDocument/codeAction failed.
  Message: Invalid file path
  Code: -32003 
/Users/benjaminfarquhar/development/flutter/.pub-cache/hosted/pub.dartlang.org/hive-1.4.4+1/lib/src/hive_impl.dart
[Error - 7:19:24 PM] Request textDocument/hover failed.
  Message: Invalid file path
  Code: -32003 
/Users/benjaminfarquhar/development/flutter/.pub-cache/hosted/pub.dartlang.org/hive-1.4.4+1/lib/src/hive_impl.dart
[Error - 7:19:25 PM] Request textDocument/hover failed.
  Message: Invalid file path
  Code: -32003 
/Users/benjaminfarquhar/development/flutter/.pub-cache/hosted/pub.dartlang.org/hive-1.4.4+1/lib/src/hive_impl.dart
[Error - 7:19:33 PM] Request textDocument/hover failed.
  Message: Invalid file path
  Code: -32003 
/Users/benjaminfarquhar/development/flutter/.pub-cache/hosted/pub.dartlang.org/hive-1.4.4+1/lib/src/hive_impl.dart

我以前没有得到它们。关于如何修复的任何想法?

我尝试将 settings.json dart sdk 设置从 null 更改为我的 dart sdk 位置:"dart.sdkPath": "/usr/local/opt/dart/libexec",但它没用。

最佳答案

我在 vscode v-1.58.2 中遇到了同样的问题,我用谷歌搜索了一下,有人说要卸载/安装 flutter sdk,但在跟踪了很多之后,错误的根源一直在产生,每当我悬停或单击代码的任何部分。

错误来源

在 AndroidManifest.xml 中包含代码之后

<meta-data
        android:name="com.google.firebase.messaging.default_notification_icon"
        android:resource="@drawable/transparent.png" />

后来我评论并删除了它。

解决方案

我只是简单地执行了这些步骤...

问题就解决了。

我希望这可以帮助某人。

关于flutter - 查看 .pub-cache 文件给出 Request textDocument/documentSymbol failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65434751/

相关文章:

c# - 使用 MVVM 绑定(bind) : Property not found in Xama

python - Flask-SQLAlchemy: SAWarning: Identity map

arrays - 检查列表和数组是否相等 F#

amazon-web-services - `amplify push` 失败 - 属性 : Str

docker - Elastic search AccessDeniedException[/usr

c++ - 一个只接受枚举类型参数的模板类?

r - 如何在 R 中的数据框中重新编码数据

mongodb - 如何在 NestJS (MongoDB) 中设置唯一复合索引

c++ - 重构为枚举以枚举类阴影命名空间

python - Pandas DataFrame - 将列转换为 JSON 并添加为新列