yegappan / lsp

Language Server Protocol (LSP) plugin for Vim9
MIT License
461 stars 54 forks source link

Error function lsp#lsp#AddFile #552

Open beppune opened 3 weeks ago

beppune commented 3 weeks ago

Afer installation as per README.md vim gives me this error. Im'using rust-analyzer added with rustup, and default LSP configuration.

continuing in <SNR>11_LoadIndent
chdir(/home/beppe/.vim/pack/downloads/opt/lsp/autoload/lsp)
fchdir() to previous dir
chdir(src)
fchdir() to previous dir
chdir(src)
fchdir() to previous dir
chdir(src)
fchdir() to previous dir
Error detected while processing BufRead Autocommands for "*.rs"..FileType Autocommands for "*"..function lsp#lsp#AddFile:
line   32:
E216: No such event: LspServerReady_1 ++once BufferInit(1, 1)
DanielViberg commented 3 weeks ago

I can't replicate this, can you provide your lsp configuration (even if default) and rust-analyzer version and can you provide an example rust project?

beppune commented 3 weeks ago

Here my vimrc with lsp configuration:

" Basic Settings
filetype plugin indent on
syntax on
set tabstop=4
set shiftwidth=4
set number
set relativenumber
set nocompatible

" Make find search more QoL
set wildmenu
set path+=**

""" REMAPS
inoremap jk <Esc>

" Greeting message
augroup User
        au!
        autocmd VimEnter * {
                echohl Comment
                echo "Welcome back ! ~(^._.)"
                echohl None
        }
augroup END

""" LSP CONFIGURE

packadd lsp

" Rust language server
call LspAddServer([#{
        \    name: 'rustlang',
        \    filetype: ['rust'],
        \    path: '/usr/bin/rust-analyzer',
        \    args: [],
        \    syncInit: v:true
        \  }])

the plugin is installed in .vim as per instruction by README.md:

.vim/
└── pack
    └── downloads
        └── opt
            └── lsp

rust analyzer version: rust-analyzer 1.80.1 (3f5fd8d 2024-08-06)

rustc and cargo version: cargo 1.80.1 (376290515 2024-07-16) rustc 1.80.1 (3f5fd8dd4 2024-08-06)

vim version:

VIM - Vi IMproved 9.1 (2024 Jan 02, compiled May 03 2024 02:45:42)
Included patches: 1-16
Modified by team+vim@tracker.debian.org
Compiled by team+vim@tracker.debian.org
Huge version without GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     -perl              +title
+channel           +ipv6              +persistent_undo   -toolbar
+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        +mksession         +smartindent       +writebackup
+diff              +modify_fname      +sodium            -X11
+digraphs          +mouse             -sound             +xattr
-dnd               -mouseshape        +spell             -xfontset
-ebcdic            +mouse_dec         +startuptime       -xim
+emacs_tags        +mouse_gpm         +statusline        -xpm
+eval              -mouse_jsbterm     -sun_workshop      -xsmp
+ex_extra          +mouse_netterm     +syntax            -xterm_clipboard
+extra_search      +mouse_sgr         +tag_binary        -xterm_save
-farsi             -mouse_sysmouse    -tag_old_static
   system vimrc file: "/etc/vim/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/build/vim-QkysrQ/vim-9.1.0016=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/build/vim-QkysrQ/vim-9.1.0016=/usr/src/vim-2:9.1.0016-1ubuntu7.1 -DSYS_VIMRC_FILE=\"/etc/vim/vimrc\" -DSYS_GVIMRC_FILE=\"/etc/vim/gvimrc\" -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lselinux -lsodium -lacl -lattr -lgpm -L/usr/lib/python3.12/config-3.12-x86_64-linux-gnu -lpython3.12 -ldl -lm

and this is my toy-project github url: https://github.com/beppune/prot