Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fresh Install Not Working #665

Open
coffeebe4code opened this issue Mar 27, 2023 · 4 comments
Open

Fresh Install Not Working #665

coffeebe4code opened this issue Mar 27, 2023 · 4 comments

Comments

@coffeebe4code
Copy link

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
Copy link
Owner

mattn commented Mar 27, 2023

package.json is in the current directory?

@coffeebe4code
Copy link
Author

image

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

@coffeebe4code
Copy link
Author

coffeebe4code commented Mar 27, 2023

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants