【问题标题】:Flutter/Dart Extensions and intellisense not working on VSCodeFlutter/Dart 扩展和智能感知不适用于 VSCode
【发布时间】:2021-04-14 11:40:03
【问题描述】:

几个月来我一直在使用带有 dart 扩展的 VSCode。我在 VS Code intellisense 上遇到了一个错误,该错误只出现在我的存储库版本中,而不出现在任何其他开发人员身上。这个明显的错误实际上并没有阻止我从运行颤振运行或构建 aar。所以我认为这是扩展本身的问题。这是 dart:convert 和 dart:core 之间的 String 类的多重引用错误。我无法解决错误,所以我决定使用以下步骤卸载并重新安装 VS:How to completely uninstall vscode on mac

自从重新安装后,我无法获得智能感知和代码自动完成工作。代码突出显示正常工作,但查找引用和跳转到引用根本不起作用。

Flutter doctor op:
[✓] Flutter (Channel stable, 1.22.2, on Mac OS X 10.15.7 19H2, locale en-IN)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
[!] Android Studio (version 4.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.55.0)
[✓] Connected device (1 available)

! Doctor found issues in 1 category.

设置.json

{
    "[dart]": {
        "editor.formatOnSave": true,
        "editor.formatOnType": true,
        "editor.rulers": [
            80
        ],
        "editor.selectionHighlight": false,
        "editor.suggest.snippetsPreventQuickSuggestions": false,
        "editor.suggestSelection": "first",
        "editor.tabCompletion": "onlySnippets",
        "editor.wordBasedSuggestions": false
    },
    "files.autoSave": "afterDelay",
    "dart.debugExternalLibraries": false,
    "dart.debugSdkLibraries": false,
    "editor.multiCursorModifier": "ctrlCmd",
    "dart.lineLength": 1000
}

请帮助解决问题,如果需要其他项目,请告诉我。

【问题讨论】:

标签: flutter dart visual-studio-code vscode-settings


【解决方案1】:

当我检查到 Flutter SDK 的稳定版本并升级到最新版本的 Flutter 时,问题得到了解决。这确保了 Intellisense 正常工作并且 dart SDK 正常工作。

在此之后,即使在签出特定版本的 SDK 时,智能感知工具也能正常工作。

【讨论】:

    猜你喜欢
    • 2020-11-22
    • 1970-01-01
    • 2019-12-28
    • 1970-01-01
    • 1970-01-01
    • 2019-12-23
    • 1970-01-01
    • 1970-01-01
    • 2022-07-19
    相关资源
    最近更新 更多