Skip to content

[BUG] Single pub workspace lsp support not working #515

@khensunny

Description

@khensunny

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Even after #505 I still see lsp servers spawned for each package
here's the lsp state:

Client [id=1]

  • name: Dart SDK LSP Analysis Server
  • version: 3.10.4
  • workspace: ~/development/<redacted>/<redacted>.worktrees/<redacted>/app
  • buffers: 10

Client [id=3]

  • name: Dart SDK LSP Analysis Server
  • version: 3.10.4
  • workspace: ~/development/<redacted>/<redacted>.worktrees/<redacted>/packages/authentication_client/authentication_client
  • buffers: 11

I have a file open in the /app and in /packages/* both belong to the pub workspace.

Here's activity monitor:

Image

flutter-tools version: e45f4ea

Expected Behavior

only one dartls server running

Steps To Reproduce

project using pub workspaces

Environment

- OS: macOS 26.2
- Flutter version:
- Is flutter in $PATH: no. using fvm
- neovim version: v0.11.5

Anything else?

lazy.nvim config:

  {
    "nvim-flutter/flutter-tools.nvim",
    isLazy = false,
    event = "BufReadPre *.dart",
    dependencies = "nvim-lua/plenary.nvim",
    opts = {
      fvm = true,
      default_run_args = { flutter = { "--no-pub" } },
      debugger = {
        enabled = true,
        exception_breakpoints = {},
      },
      widget_guides = {
        enabled = true,
      },
      lsp = {
        init_options = {
          onlyAnalyzeProjectsWithOpenFiles = false,
          allowOpenUri = true,
        },
        settings = {
          showTodos = false,
          completeFunctionCalls = false,
          renameFilesWithClasses = "always",
          analysisExcludedFolders = {
            ".dart_tool/",
            vim.fn.expand("$HOME/.pub-cache/"),
            vim.fn.expand("$HOME/fvm/"),
          },
        },
      },
      dev_log = {
        enabled = true,
        focus_on_open = false,
        open_cmd = "15split",
        notify_errors = true,
      },
      decorations = {
        statusline = {
          app_version = false,
          device = false,
          project_config = true,
        },
      },
    },
  },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions