prabirshrestha / vim-lsp

async language server protocol plugin for vim and neovim
MIT License
3.1k stars 304 forks source link

[Question] Convert lsp#register_server to vim9script #1499

Closed carlotm closed 10 months ago

carlotm commented 11 months ago

Hello, my vimrc is using vim9script. Can I translate:

if executable('elixir-ls')
    au User lsp_setup call lsp#register_server({
        \ 'name': 'elixir-ls',
        \ 'cmd': {server_info->['elixir-ls']},
        \ 'allowlist': ['elixir'],
        \ })
endif

to

if executable("elixir-ls")
       au User lsp_setup lsp#register_server({
           name: 'elixir-ls',
           cmd: 'elixir-ls',
           allowlist: ['elixir']
       })
endif

I got this error:

E492: Not an editor command: ^I^I^I^Iname: 'elixir-ls',

What I am doing wrong? Thank you

Jorengarenar commented 10 months ago

AFAIK, you still need line continuation backslashes when using autocmd in vim9script

carlotm commented 10 months ago

Ok, thanks