Javascript completion using javascript-typescript-stdio does not work
Closed this issue · 3 comments
Neovim version
NVIM v0.2.2
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -Wconve
rsion -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -
pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protec
tor-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/neovim/src/bu
ild/config -I/build/neovim/src/neovim-0.2.2/src -I/usr/include -I/usr/include -I/usr/include -I/usr/inclu
de -I/usr/include -I/usr/include -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/s
rc/build/include
Compiled by builduser
Features: +acl +iconv +jemalloc +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
Plugin version: 6f46c92
Language server version (javascript-typescript-server): 2.7.0
Minimal vimrc:
" vim: ft=vim
call plug#begin('~/.local/share/nvim/plugged')
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
call plug#end()
augroup filetype_js
autocmd!
autocmd BufReadPost *.js setlocal filetype=javascript
augroup END
let g:LanguageClient_autoStart = 1
let g:LanguageClient_serverCommands = {
\ 'javascript': ['javascript-typescript-stdio'],
\ }
let g:LanguageClient_loggingLevel = 'DEBUG'Steps to reproduce:
- Create a directory for the project
mkdir /tmp/testlc && cd !$- Init package.json and install lodash
npm init -y && npm i lodash- Install plugins and run nvim with minimal config (just paste the above contens to a file named
minrc before)
npm i -g javascript-typescript-langserver
nvim -u minrc +PlugInstall +qa
nvim -u ./minrc ./index.js- Enter following code in nvim and trigger omni completion using
import _ from 'lodash';
_.Result is - no matches are found or '_' as a single match after you reopen the
file.
The only message in LanguageServer.log is
ERROR Stream was closed without shutdown notification
But it's probably because I quit nvim.
This is a problem with language server.
If you try
console.asserYou will find the correct completion menu.
Either the language server requires special setup or there is a bug there.
@autozimu sourcegraph/javascript-typescript-langserver#432 (comment) indicates that this is a problem in the client, not the server
This bug report seems not exactly as sourcegraph/javascript-typescript-langserver#432
For sourcegraph/javascript-typescript-langserver#432, the main issue is completion position calcuated by this plugin is not correct, which should have been resolved in latest releases.
This bug is more of completion for user installed modules, i.e., builtin functions are working, but user installed node modules completion are not working properly. From my experience, the modules importing has been problematic for javascript, especially with third party modules.