Closed Vitax closed 5 years ago
@Vitax Can you post a minimal init.vim
to reproduce? The one you posted is still quite long.
@clason Seeing that you're also using ncm2
, perhaps you have an idea what the problem could be?
This only seems to happen with javascript / typescript on my side. Tryed using the language server protocol with C++ and it works fine there.
Okay as you were probably expecting something up top seems to make ncm2 / lsp behave weirdly. With the one below everything seems to work fine. Gonna try adding things and see what makes it break.
call plug#begin()
Plug 'ncm2/ncm2'
Plug 'roxma/nvim-yarp'
Plug 'ncm2/ncm2-bufword'
Plug 'ncm2/ncm2-path'
Plug 'ncm2/ncm2-ultisnips'
Plug 'SirVer/ultisnips'
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'ncm2/ncm2-vim-lsp'
Plug 'ryanolsonx/vim-lsp-typescript'
Plug 'ryanolsonx/vim-lsp-javascript'
call plug#end()
syntax on
filetype on
filetype plugin on
filetype indent on
set encoding=utf-8
set completeopt=noinsert,menuone,noselect
set shortmess+=c
au User lsp_setup call lsp#register_server({
\ 'name': 'javascript support using typescript-language-server',
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']},
\ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'package.json'))},
\ 'whitelist': ['javascript', 'javascript.jsx', 'javascriptreact'],
\ })
let g:UltiSnipsExpandTrigger = "<Plug>(ultisnips_expand)"
let g:UltiSnipsJumpForwardTrigger = "<c-j>"
let g:UltiSnipsJumpBackwardTrigger = "<c-k>"
let g:UltiSnipsRemoveSelectModeMappings = 0
autocmd BufEnter * call ncm2#enable_for_buffer()
Please test with g:lsp_signature_help_enabled = v:false
.
The error / bug is happening when adding
" Setup Nerdtree
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
Experienced the same problem, and vim became such a mess that :qa seemed to be the only solution! I write golang with the help of vim-lsp and use neocomplete to provide auto-completion popup.
Actually let me correct myself the behavior from above does happen when NERDTree is active. When toggling nerdtree off the language server works fine. And weird enough it seem to only happen for javascript / typescript.
I can also provide my .vimrc though it's kind of tedious. Hope to see this annoying problem got fixed soon because this also happens with golang.
https://github.com/chengzeyi/.vim_runtime/blob/master/my_config.vim
same here, I'm writing go
code. When turning off NERDTree, this issue is gone.
same problem with the C++ protocol server, ccls, when NERDTree is opened. When NERDTree is closed, everything is fine.
Hi, everyone! I think this is caused by the function "lsp#ui#vim#folding#foldtex" in folding.vim. Popup window in completion changes buffer or window number? Why dose it happen when we write go or typescript code? I do not know... I changed winnr() to bufwinnr(). It works. WHY???
When we open NERDTree, vim window is splitted? If it is OK, I submit Pull Request.
Feel free to submit PR
I am sorry. The function is function! s:handle_fold_request(server, data) . And bufwinnr() is bad call. Please wait.
Thank you, @prabirshrestha . I submitted PR.
Can other folks having issues verify this pr https://github.com/prabirshrestha/vim-lsp/pull/541
I have verified the PR works and have merged it to master. Please get the latest vim-lsp and try again.
Thanks to @studiome for the patch.
Hello,
I am having issues using the language server protocols with nmc2. As you can see in the gif something seems to cancel the insert mode and I cannot figure out what. I recreated my init.vim to the bare minimum where I could write code again but no changes there.
I am gonna include my init.vim as well so maybe you can pin point the error: