mattn / vim-lsp-settings

Auto configurations for Language Server for vim-lsp
MIT License
1.29k stars 231 forks source link

Fresh Install Not Working #665

Open coffeebe4code opened 1 year ago

coffeebe4code commented 1 year ago

I have these two entries using plug.

Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'

related config.

function! s:on_lsp_buffer_enabled() abort
    setlocal omnifunc=lsp#complete
    setlocal signcolumn=yes
    if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
    nmap <buffer> <leader>cd <plug>(lsp-definition)
    nmap <buffer> <leader>cs <plug>(lsp-document-symbol-search)
    nmap <buffer> <leader>cS <plug>(lsp-workspace-symbol-search)
    nmap <buffer> <leader>c/ <plug>(lsp-references)
    nmap <buffer> <leader>ci <plug>(lsp-implementation)
    nmap <buffer> <leader>ct <plug>(lsp-type-definition)
    nmap <buffer> <leader>rn <plug>(lsp-rename)
    nmap <buffer> <leader>cp <plug>(lsp-previous-diagnostic)
    nmap <buffer> <leader>cn <plug>(lsp-next-diagnostic)
    nmap <buffer> <leader>ch <plug>(lsp-hover)
    nnoremap <buffer> <expr><c-f> lsp#scroll(+4)
    nnoremap <buffer> <expr><c-d> lsp#scroll(-4)

    let g:lsp_format_sync_timeout = 1000
    autocmd! BufWritePre *.rs,*.go,*.ts call execute('LspDocumentFormatSync')

    " refer to doc to add more commands
endfunction

augroup lsp_install
    au!
    " call s:on_lsp_buffer_enabled only for languages that has the server registered.
    autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
augroup END

and then I ran LspInstallServer typescript-language-server When I look at the manage list I see a [*] for typescript. However, the lsp doesn't seem to be running.

Is there additional config I need?

mattn commented 1 year ago

package.json is in the current directory?

coffeebe4code commented 1 year ago

image

Yup. I didn't see a way to "start" a server in vim-lsp either.

coffeebe4code commented 1 year ago

The .git directory is one directory up, however. Which I noticed there was some auto configuration around that, could that be the issue? if so, how would I resolve it for this project?

coffeebe4code commented 1 year ago

I tried a kotlin project I had, the language server took a while, but eventually started up, so i would say it was working. So it's something specific to typescript-language-server or this project.