nvimdev / lspsaga.nvim

improve neovim lsp experience
MIT License
3.48k stars 288 forks source link

Cannot see multiple diagnostics for a single position #596

Closed rensftw closed 1 year ago

rensftw commented 2 years ago

Description

Lspsaga does not show all diagnostic messages for a position (line:column, eg 1:29). When there are multiple diagnostics it only shows one diagnostic (it appears to be non-deterministic which one gets shown)

Expected Behavior All three diagnostic messages are shown for position 1:29 are shown in the popup:

image

Actual Behavior The Lspsaga popup shows only one out of three diagnostics for 1:29:

image

Details

I initially found this issue with null-ls and Vale, but I suspect it will be reproducible with other LSPs as well.

Steps to reproduce
  1. Copy Vale config Copy the contents of this folder to your home directory. These are the sources (only yml and json files) that Vale uses to lint prose.
  2. Use this minimal Neovim config 👇
    
    require('packer').startup(function(use)
        use({ 'glepnir/lspsaga.nvim', branch = 'main' })
        use 'jose-elias-alvarez/null-ls.nvim'
    end)
    require('null-ls').setup({
        sources = {
            require('null-ls').builtins.diagnostics.vale,
        },
    })
    require 'lspsaga'.init_lsp_saga {
        border_style = 'rounded',
        diagnostic_header = { ' ', ' ', ' ', ' ' },
        code_action_icon = '↯ ',
    }
    
  3. Create a Markdown file and paste the following line: _Note: This setup is built for and tested on macOS._
  4. Open that Markdown file in Neovim and :Lspsaga diagnostic_jump_next
  5. Observe that the Lspsaga popup shows only one diagnostic message for position 1:19, while in reality there should be 3. For reference these are the CLI results of running vale image
Environment - nvim --version output:

NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Ventura-arm64.local
- Operating system: macOS v13.0.1 (Ventura) - lspsaga commit: 85e1c00f5a6645b0571d475b4b43803377a82bf0
glepnir commented 1 year ago

Lspsaga show_line_diagnostic and Lspsaga show_cursor_diagnostic