ncm2 / ncm2-vim-lsp

MIT License
13 stars 2 forks source link

This doesn't seem to work #1

Closed benwainwright closed 4 years ago

benwainwright commented 5 years ago

I don't really know what to say other than I absolutely cannot get completion to work for ncm2-vim-lsp, using the Typescript language server. Here is a minimal vimrc:

call plug#begin('~/.vim/plugged')
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'ncm2/ncm2-vim-lsp'
Plug 'ncm2/ncm2'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
call plug#end()

au User lsp_setup call lsp#register_server({
      \ 'name': 'typescript-language-server',
      \ 'cmd': {server_info->[&shell, &shellcmdflag, 'node ~/.vim/plugged/javascript-typescript-langserver/lib/language-server-stdio']},
      \ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'jsconfig.json'))},
      \ 'whitelist': ['javascript'],
      \ })

autocmd BufEnter * call ncm2#enable_for_buffer()
set completeopt=noinsert,menuone,noselect
set shortmess+=c

inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"

I've enabled logging, and vim-lsp is definitely successfully connecting to the server. Things like rename etc. are working.

If anyone is able to provide any help, that would be great...

jsfaint commented 5 years ago

It works for me with this config https://github.com/jsfaint/nvimcfg/blob/master/lsp.vim

But I don't write typescript, I only tested the lsp servers below:

oblitum commented 5 years ago

I'm also trying it on Vim and it's not providing completion, the same config works fine on NeoVim. My relevant plugin list I'm trying right now:

Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'

Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/async.vim'

Plug 'ncm2/ncm2'
Plug 'ncm2/ncm2-vim-lsp'
oblitum commented 5 years ago

Also, with nvim-yarp and vim-hug-neovim-rpc I can have LanguageClient-neovim working as expected, but with the same configuration, just changing from LanguageClient to vim-lsp it simply stops working in vim, for completion. Diagnostics still works.

oblitum commented 5 years ago

I've been trying several LSP clients for Vim and have settled on vim-lsp because of its minimalism and better configuration from .vimrc without additional configuration files (thx @prabirshrestha). It works great with ncm2 (more simple than others I've found, thx @roxma Ero-Sennin). Sadly I have to stick to NeoVim for it (no problem, I like both) because of the current issue :-(

roxma commented 5 years ago

hmm... I don't write typescript. I've tried the config of https://github.com/ncm2/ncm2/issues/36, with set nocompatible and vim-hug-neovim-rpc, it does work on vim8.