prabirshrestha / vim-lsp

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

LSP servers not connecting, Windows 11 #1540

Closed kevinlam03 closed 7 months ago

kevinlam03 commented 7 months ago

I ran :PlugInstall and can see that the lsp servers are installed and registered by the log message:

["lsp#register_server","server registered","typescript-language-server"]
["s:on_text_document_did_open()",1,"typescript","/c/Users/lamk5/Downloads","file:///C:/Users/lamk5/Downloads/ex.ts"].

However, the server never starts up afterwards. :LspStatus shows typescript-language-server: not running. What could be going wrong? This is all I have in my ~/_vimrc

filetype plugin indent on
syntax on
color desert

call plug#begin('~/.vim/autoload/')

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

call plug#end()

function! s:on_lsp_buffer_enabled() abort
    setlocal omnifunc=lsp#complete
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
let g:lsp_log_verbose = 1
let g:lsp_log_file = expand('~/vim-lsp.log')
kevinlam03 commented 7 months ago

I was running vim from Git Bash, and I guess that it was screwing with the system finding my files. I downloaded Vim from the official site for Windows, then moved my ~/.vim stuff to ~/vimfiles, which is what Windows uses.