LanguageClient-neovim icon indicating copy to clipboard operation
LanguageClient-neovim copied to clipboard

can't get arguments info of a function from language-client while nvim-typescript do

Open maple-leaf opened this issue 6 years ago • 4 comments

Describe the bug

can't get arguments info of a function from language-client while nvim-typescript do, which will make echodoc can't dispaly correct info

Environment

  • neovim/vim version (nvim --version or vim --version): 0.3.0
  • This plugin version (git rev-parse --short HEAD): Branch: next, commit: 288f1be
  • This plugin's binary version (bin/languageclient --version): 0.1.120
  • Minimal vimrc content (A minimal vimrc is the smallest vimrc that could reproduce the issue. Refer to an example [here][min-vimrc.vim]):
  • Language server link and version:

minimal vimrc

if empty($XDG_DATA_HOME)
	let $XDG_DATA_HOME = $HOME . '/.config'
endif

let mapleader = "\<Space>"

" curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
call plug#begin('~/.config/nvim/plugged')


Plug 'autozimu/LanguageClient-neovim', {
    \ 'branch': 'next',
    \ 'do': 'bash install.sh',
    \ }
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'Shougo/echodoc.vim'
Plug 'HerringtonDarkholme/yats.vim'
Plug 'mhartington/nvim-typescript', { 'do': './install.sh' }

" Add plugins to &runtimepath
call plug#end()

"turn on that syntax highlighting
syntax on

function! s:deopleteConfig()
    let g:deoplete#enable_at_startup=1
endfunction
call s:deopleteConfig()

function! s:echoDocConfig()
    let g:echodoc#enable_at_startup = 1
endfunction
call s:echoDocConfig()

function! s:lspConfig()
    let g:LanguageClient_serverCommands = {
                \ 'rust': ['~/.cargo/bin/rustup', 'run', 'stable', 'rls'],
                \ 'javascript': ['/usr/local/bin/javascript-typescript-stdio'],
                \ 'javascript.jsx': ['tcp://127.0.0.1:2089'],
                \ 'python': ['/usr/local/bin/pyls'],
                \ 'vue': ['vls'],
                \ }

    nnoremap <F5> :call LanguageClient_contextMenu()<CR>
    " Or map each action separately
    nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
    nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
    nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
endfunction
call s:lspConfig()

function! VimTSCConfig()
    let g:nvim_typescript#javascript_support=1
    let g:nvim_typescript#vue_support=1
    let g:nvim_typescript#type_info_on_hold=1
    let g:nvim_typescript#diagnosticsEnable=0
    autocmd BufNewFile,BufRead *.tsx set filetype=typescript

    no <Leader>tD   :TSDoc<cr>
    no <Leader>tt   :TSType<cr>
    no <Leader>ttd   :TSTypeDef<cr>
    no <Leader>td   :mark 1<cr>:TSDef<cr>
    no <Leader>tpd  :TSDefPreview<cr>
    no <Leader>tr   :TSRefs<cr>
    no <Leader>tR   :TSRename<cr>
endfunction
call VimTSCConfig()

To Reproduce

Steps to reproduce the behavior:

  1. Start vim, nvim -u min-vimrc.vim ...
  2. insert content
function abc(b) {
}
  1. type abc, check candidates list, two options provided by LC and nvim-typescript is different (check screenshot)

Current behavior

function missing arguments and return info provided by language-client

Expected behavior

function should have arguments and return info provided by language-client

Screenshots

image

maple-leaf avatar Sep 27 '18 06:09 maple-leaf

Is this configuration related or does javascript-typescript-langserver not support it?

dustinblackman avatar Feb 04 '19 19:02 dustinblackman

I also never could make this work -- I switched many different typescript language servers and none of them worked. It seems that all of the them provides these typings, but for some unknown reason LanguageClient-neovim isn't working with them. I can get typings on Elixir language server, though.

derekstavis avatar Feb 08 '19 21:02 derekstavis

I'm also having this issue. Only happens with the typescript language server

georgewitteman avatar Jun 02 '19 01:06 georgewitteman

I've migrated to https://github.com/neoclide/coc.nvim and now I have the most awesome setup I ever had.

derekstavis avatar Jun 03 '19 22:06 derekstavis