Skip to content

[audit] Dual Python LSPs (pyright + pyrefly) both active — duplicate diagnostics expected #121

Description

@stanfish06

What

Both pyright and pyrefly are enabled simultaneously without any guard.

Where

lua/config/plugin_config.lua lines 76–88:

vim.lsp.config("pyright", { ... })
vim.lsp.enable("pyright")
-- ...
vim.lsp.enable("pyrefly")

Why it matters

Both servers attach to every Python buffer and emit independent diagnostics for the same code. In practice this means:

  • Every type error appears twice in the diagnostic list (once from each server), visible in the statusline count and in vim.diagnostic.setloclist().
  • vim.lsp.completion receives completions from both, producing duplicates in the popup.
  • <leader>d (the loclist diagnostic dump) shows interleaved output from two sources making it harder to read — even though the [%s] source prefix was added to help with exactly this.

The in-code comment ("pyrefly seems capable of showing more type issues") suggests this was intentional as an experiment/comparison, but leaving both active permanently doubles noise.

Recommended action

Pick one and disable the other, or add a project-local or env-var toggle so the comparison can be done deliberately. For example:

-- pick one:
vim.lsp.enable("pyright")
-- vim.lsp.enable("pyrefly")  -- trial: enable this, disable pyright above

Or see issue #64 (per-project LSP config via exrc) for a more surgical approach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions