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.

Activity

  1. stanfish06 commented on Jul 19, 2026

    @stanfish06
    OwnerAuthor

    Duplicate of #195 (same finding: pyright + pyrefly both unconditionally enabled), which has more detail (statusline doubling, code-action doubling) and three concrete options. Still unresolved in current master — see #195 for tracking. A related PR (#272, gating pyrefly vs pyright) was closed unmerged, so this is still open for a workflow decision.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions