You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用AstroVim打开Dart文件时出现dartls -32007错误求助

Dartls报错-32007 file is not being analyzed及LSP功能失效问题

我是Neovim新手,目前正在使用AstroVim,并配置了flutter-tools插件。每次打开Dart文件都会报错:dartls -32007 file is not being analyzed。自动补全和Flutter命令可正常使用,但有时Dart文件中的颜色高亮、跳转定义等功能会失效。

我的配置如下:

return {
  lsp = {
    skip_setup = { "dartls" }, -- skip lsp setup because flutter-tools will do it itself
    ["server-settings"] = {
      dartls = {
        -- any changes you want to make to the LSP setup, for example
        color = {
          enabled = true,
        },
        settings = {
          showTodos = true,
          completeFunctionCalls = true,
        },
      },
    },
  },
  plugins = {
    init = {
      {
        "akinsho/flutter-tools.nvim",
        requires = "nvim-lua/plenary.nvim",
        after = "mason-lspconfig.nvim", -- make sure to load after mason-lspconfig
        config = function()
          require("flutter-tools").setup {
            lsp = astronvim.lsp.server_settings "dartls", -- get the server settings and built in capabilities/on_attach
          }
        end,
      },
    },
  },
}

内容的提问来源于stack exchange,提问作者Arbaz Irshad

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 04:25:16