vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.74k stars 592 forks source link

Vls crash in Neovim #2821

Closed alexaandru closed 3 years ago

alexaandru commented 3 years ago

https://github.com/vuejs/vetur/issues/2724 seems somewhat related, but it's hard to tell from the description/details if it's the same kind of crash.

Info

Problem

The LSP server crashes as soon as I open a .vue file. Here are the log entries:

Log file [ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "V panic: get_type_symbol: invalid type (typ=0 idx=0). Compiler bug. This should never happen. Please create a GitHub issue.\n\n" [ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "/tmp/v/vls.18315471424635845045.tmp.c:15330: at v_panic: Backtrace\n" [ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "/tmp/v/vls.18315471424635845045.tmp.c:29457: by v__table__Table_get_type_symbol\n" [ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "/tmp/v/vls.18315471424635845045.tmp.c:40440: by v__parser__Parser_type_decl\n"[ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "/tmp/v/vls.18315471424635845045.tmp.c:38915: by v__parser__Parser_top_stmt\n" [ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "/tmp/v/vls.18315471424635845045.tmp.c:38701: by v__parser__Parser_parse\n"[ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "/tmp/v/vls.18315471424635845045.tmp.c:38523: by v__parser__parse_text\n" [ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "/tmp/v/vls.18315471424635845045.tmp.c:48864: by vls__Vls_process_file\n"[ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "/tmp/v/vls.18315471424635845045.tmp.c:48772: by vls__Vls_did_open\n" [ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "/tmp/v/vls.18315471424635845045.tmp.c:49034: by vls__Vls_dispatch\n"[ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "/tmp/v/vls.18315471424635845045.tmp.c:49165: by vls__Vls_start_loop\n" [ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "/tmp/v/vls.18315471424635845045.tmp.c:49314: by main__run_cli\n" [ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "/tmp/v/vls.18315471424635845045.tmp.c:25811: by cli__Command_parse_commands\n" [ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "/tmp/v/vls.18315471424635845045.tmp.c:25703: by cli__Command_parse\n" [ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "/tmp/v/vls.18315471424635845045.tmp.c:49326: by main__main\n" [ ERROR ] 2021-03-26T11:18:43+0200 ] ..._nvim.aKq01Cn/usr/share/nvim/runtime/lua/vim/lsp/rpc.lua:458 ] "rpc" "vls" "stderr" "/tmp/v/vls.18315471424635845045.tmp.c:49699: by main\n"

Reproducible Case

# get neovim nightly from https://github.com/neovim/neovim/releases
# clone nvim-lspconfig somewhere in neovim's runtimepath:
mkdir -p ~/.config/nvim/pack/plugins/opt
git clone https://github.com/neovim/nvim-lspconfig ~/.config/nvim/pack/plugins/opt/
git clone https://github.com/gothinkster/vue-realworld-example-app
cd vue-realworld-example-app
echo "vim.cmd('packadd nvim-lspconfig');require'lspconfig'.vuels.setup{}" > vls.lua
n -u vls.lua src/components/ArticleActions.vue # or ArticleList.vue, ArticleMeta & others
alexaandru commented 3 years ago

Sorry, fat fingered the Enter.... will fill it in properly, please bare with me.

alexaandru commented 3 years ago

related nvim-lspconfig issue https://github.com/neovim/nvim-lspconfig/issues/798

yoyo930021 commented 3 years ago

I make a special version for debugging. This version will send the error to sentry and I can study it.

If anyone can try to use it, I would be grateful.

vetur-0.33.1.vsix.zip

Steps:

  1. Download zip and unzip
  2. Unzip vsix
  3. Start LSP in server/bin/vls
  4. Test it.
  5. crash
  6. comment in this post.
alexaandru commented 3 years ago

My bad, had an old vls binary in /usr/local/bin which was being picked up :( Sorry for the noise, it all works fine with the latest vls.