ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.46k stars 2.81k forks source link

vueCompleter Server State: Dead #4159

Closed FuDesign2008 closed 1 year ago

FuDesign2008 commented 1 year ago

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:

Thank you for adhering to this process! It ensures your issue is resolved quickly and that neither your nor our time is needlessly wasted.

Issue Details

Provide a clear description of the problem, including the following key questions:

  1. install YouCompleteMe and lsp-examples
  2. edit a *.vue file
  3. expect YouCompleteMe + vls works

Include steps to reproduce here.

  1. vim -Nu /path/to/YCM/ycm_vimrc_minimal
  2. :edit ./src/components/CreateIssueHint.vue , see vue2-project
  3. Enter insert mode and type this., expect YouCompleteMe + vls give some good completion

Include description of a minimal test case, including any actual code required to reproduce the issue.

If you made changes to vimrc_ycm_minimal, pase them here:

" windows default encoding is not supported
set encoding=utf-8

" If you using neovim and python isn't loading, copy your python setup from your
" vimrc here:
"
" let g:python3_host_prog = '/path/to/python3/with/neovim/module'
"
" But remember that neovim is not officially supported, so please reproduce in
" Vim.

" Enable debugging
let g:ycm_keep_logfiles = 1
let g:ycm_log_level = 'debug'

" If the base settings don't repro, paste your existing config for YCM only,
" here:
" let g:ycm_....

" Load YCM (only)
let &rtp .= ',' . expand( '<sfile>:p:h' )
filetype plugin indent on
syn on

"""""""""""""""""""""""""""""""""""""""""""""
" following statements is copied from  path/to/lsp-examples/vimrc.generated
""""""""""""""""""""""""""""""""""""""""""""""
 let g:ycm_lsp_dir = '/Users/fuyg/.fudesign2008.vim/.vim/bundle/lsp-examples'
 let g:ycm_language_server = []

let g:ycm_language_server += [
  \   { 'name': 'vue',
  \     'filetypes': [ 'vue' ],
  \     'cmdline': [ expand( g:ycm_lsp_dir . '/vue/node_modules/.bin/vls' ) ]
  \   },
  \ ]

Include description of the expected behaviour.

expect YouCompleteMe + vls give some good completion

Include description of the observed behaviour, including actual output, screenshots, etc.

Run :YcmDebugInfo: YcmDebugInfo

Diagnostic data

Output of vim --version

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Feb 07 2023 11:35:56)
macOS version - arm64
Included patches: 1-1276
Compiled by Homebrew
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl               +find_in_path      +mouse_xterm       +tcl
+arabic            +float             +multi_byte        +termguicolors
+autocmd           +folding           +multi_lang        +terminal
+autochdir         -footer            -mzscheme          +terminfo
-autoservername    +fork()            +netbeans_intg     +termresponse
+balloon_eval      +fullscreen        +num64             +textobjects
+balloon_eval_term +gettext           +odbeditor         +textprop
+browse            -hangul_input      +packages          +timers
++builtin_terms    +iconv             +path_extra        +title
+byte_offset       +insert_expand     +perl              +toolbar
+channel           +ipv6              +persistent_undo   +transparency
+cindent           +job               +popupwin          +user_commands
+clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           -python            +viminfo
+cmdline_info      +libcall           +python3           +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          +ruby              +wildignore
+cursorbind        +lua               +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con_gui    +mksession         +smartindent       +writebackup
+diff              +modify_fname      +sodium            -X11
+digraphs          +mouse             +sound             -xfontset
+dnd               +mouseshape        +spell             +xim
-ebcdic            +mouse_dec         +startuptime       -xpm
+emacs_tags        -mouse_gpm         +statusline        -xsmp
+eval              -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary
-farsi             -mouse_sysmouse    -tag_old_static
+file_in_path      +mouse_urxvt       -tag_any_white
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X -DMACOS_X_DARWIN -g -O2 -arch arm64 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -arch arm64 -L/opt/homebrew/lib -o Vim -lm -lncurses /opt/homebrew/lib/libsodium.a -liconv /opt/homebrew/lib/libintl.a -framework AppKit -L/opt/homebrew/opt/lua/lib -llua5.4 -L/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE -lperl -L/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/config-3.11-darwin -lpython3.11 -framework CoreFoundation -F/System/Library/Frameworks -framework Tcl -framework CoreFoundation -lruby.3.2 -L/opt/homebrew/Cellar/ruby/3.2.1/lib

Output of YcmDebugInfo

Printing YouCompleteMe debug information...
-- Resolve completions: Up front
-- Client logfile: /var/folders/ty/wqtsjfdn12j8w6yg9nlflgv80000gn/T/ycm_r2nvqaof.log
-- Server Python interpreter: /opt/homebrew/opt/python@3.11/bin/python3.11
-- Server Python version: 3.11.4
-- Server has Clang support compiled in: True
-- Clang version: Homebrew clang version 16.0.6
-- No extra configuration file found
-- GenericLSP completer debug information:
--   vueCompleter not running
--   vueCompleter executable: ['/Users/fuyg/.fudesign2008.vim/.vim/bundle/lsp-examples/vue/node_modules/.bin/vls']
--   vueCompleter logfiles:
--     /var/folders/ty/wqtsjfdn12j8w6yg9nlflgv80000gn/T/vuecompleter_stderrkwn46pwd.log
--   vueCompleter Server State: Dead
--   vueCompleter Project Directory: /Users/fuyg/workspace/github2008/vue2-test
--   vueCompleter Settings: {}
-- Server running at: http://127.0.0.1:57656
-- Server process ID: 33566
-- Server logfiles:
--   /var/folders/ty/wqtsjfdn12j8w6yg9nlflgv80000gn/T/ycmd_57656_stdout_w01oez_f.log
--   /var/folders/ty/wqtsjfdn12j8w6yg9nlflgv80000gn/T/ycmd_57656_stderr_lxex50f3.log
-- Semantic highlighting supported: True
-- Virtual text supported: True
-- Popup windows supported: True

Output of YcmDiags

Forcing compilation, this will block Vim until done.
Diagnostics refreshed
No warnings or errors detected.

Output of git rev-parse HEAD in YouCompleteMe installation directory

95a5d541437b501cb56ffcf3ee6c6f47be349e40

Contents of YCM, ycmd and completion engine logfiles

Reproduce the issue with vim -Nu /path/to/YCM/vimrc_ycm_minimal, which enabled debug logging and other useful diagnostics. Include a link to a gist containing all of the log files listed by :YcmToggleLogs.

https://gist.github.com/FuDesign2008/e9eeeb882b3fdb430e3197a75a573a14

OS version, distribution, etc.

Include system information here.

MacOs 13.4.1 (22F82) + M1

Output of build/install commands

Include link to a gist containing the invocation and entire output of install.py if reporting an installation issue.

puremourning commented 1 year ago

The language server crashed. You can see that in the debug ouput and this message:

2023-07-07 00:46:54,726 - ERROR - Server reported: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './vetur/tags.json' is not defined by "exports" in /Users/fuyg/workspace/github2008/vue2-test/node_modules/vue-router/package.json at new NodeError (node:internal/errors:387:5) at throwExportsNotFound (node:internal/modules/esm/resolve:365:9) at packageExportsResolve (node:internal/modules/esm/resolve:649:3) at resolveExports (node:internal/modules/cjs/loader:554:36) at Function.Module._findPath (node:internal/modules/cjs/loader:594:31) at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1012:27) at Function.resolve (node:internal/modules/cjs/helpers:114:19) at getDependencyTagProvider (/Users/fuyg/.fudesign2008.vim/.vim/bundle/lsp-examples/vue/node_modules/vls/dist/vls.js:756:3285) at getTagProviderSettings (/Users/fuyg/.fudesign2008.vim/.vim/bundle/lsp-examples/vue/node_modules/vls/dist/vls.js:756:6234) at new HTMLMode (/Users/fuyg/.fudesign2008.vim/.vim/bundle/lsp-examples/vue/node_modules/vls/dist/vls.js:757:1445) 2023-07-07 00:46:55,116 - ERROR - The language server communication channel closed unexpectedly.

puremourning commented 1 year ago

If I just try a simple vue app with vue create testapp I still don't get anything useful from the server, but it at least seems to start up and initialise correctly.

Looks like there's lots of config, and complexit, involved in vis now.

I would suggest reporting/askin the VLS developers why it's creashing/not working.

FuDesign2008 commented 1 year ago

If I just try a simple vue app with vue create testapp I still don't get anything useful from the server, but it at least seems to start up and initialise correctly.

Looks like there's lots of config, and complexit, involved in vis now.

I would suggest reporting/askin the VLS developers why it's creashing/not working.

  1. I sometimes use vim-lsp + asyncomplete solution and can get good completion. It's config for vls is https://github.com/mattn/vim-lsp-settings/blob/master/settings/vls.vim
  2. Vue has different versions: 2 and 3 . The vls is used for vue 2 and volar-sever for vue 3. The vim-lsp config for volar-server is https://github.com/mattn/vim-lsp-settings/blob/master/settings/volar-server.vim

I have tried different completion solutions. YCM is the fastest, and the user experience is the best. For I write codes in *.vue files almost every day, so I hope YCM will provide a better support for *.vue.

Respect and thanks a lot for YCM and @puremourning

puremourning commented 1 year ago

I can see nothing in the logs that suggests a problem with YCM only a problem with the server or your project.