nvim-lua / diagnostic-nvim

A wrapper for neovim built in LSP diagnosis config
Apache License 2.0
219 stars 15 forks source link

virtual text lose position when using this plugin. #41

Closed aca closed 4 years ago

aca commented 4 years ago

When attaching this plugin, virtual text doesn't follow errors and get lost.

minimal vimrc

call plug#begin('~/.local/share/nvim/plugged')
    Plug 'neovim/nvim-lsp'
    Plug 'nvim-lua/diagnostic-nvim'
    Plug 'nvim-lua/completion-nvim'
call plug#end()
" lua require'nvim_lsp'.gopls.setup{on_attach=require'completion'.on_attach}
lua << EOF
local on_attach_vim = function()
  require'completion'.on_attach()
  require'diagnostic'.on_attach()
end
require'nvim_lsp'.gopls.setup{on_attach=on_attach_vim}
EOF
au Filetype lua setl omnifunc=v:lua.vim.lsp.omnifunc
" Use <Tab> and <S-Tab> to navigate through popup menu
inoremap <expr> <Tab>   pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"

" " Set completeopt to have a better completion experience
set completeopt=menuone,noinsert,noselect

let g:diagnostic_enable_virtual_text = 1

let g:completion_chain_complete_list = {
    \ 'default': [
    \    {'complete_items': ['lsp', 'snippet', 'tabnine']},
    \    {'mode': '<c-p>'},
    \    {'mode': '<c-n>'}
    \]
\}

image

Iron-E commented 4 years ago

Could this be related to #40?

aca commented 4 years ago

Looks similar.

By the way, even without this plugin. Virtual text is working well. I thought this plugin was creating virtual text. hmm..

I think I should read the source. 😄

Iron-E commented 4 years ago

There are some things that the built-in virtual text function doesn't do (like customizing the prefix, insert delay, etc). I've left more comments on #40 which might help in figuring this out

aca commented 4 years ago

Closing as It seems duplicate issue with #40 .