Description
Summary
For the PowerShell language server, "PowerShell Editor Services", it runs a powershell script that starts the language server in a powershell instance. (see below init.vim for details) When :LanguageClientStop
or :call LanguageClient#exit()
get called, that powershell process hangs around leading to stray processes.
LanguageClient-neovim should kill these processes when calling Stop or Exit.
Reproduction
- neovim/vim version (
nvim --version
orvim --version
):NVIM v0.2.2
- This plugin version (
git rev-parse --short HEAD
):b96f442
- This plugin's binary version (
bin/languageclient --version
):
languageclient 0.1.70 6e901906a6b63e074d043b59fe2d44107d5ad792
- Minimal vimrc content. A minimal vimrc is the smallest vimrc that could
reproduce the issue. Refer to an example here. Make sure
your vimrc containslet g:LanguageClient_loggingLevel = 'DEBUG'
to have
full log:
init.vim
call plug#begin('~/.local/share/nvim/plugged')
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
Plug 'sheerun/vim-polyglot'
"Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
"let g:deoplete#enable_at_startup = 1
Plug 'roxma/nvim-completion-manager'
call plug#end()
"LanguageServerProtocol setup
"required for operations modifying multiple buffers like rename.
set hidden
"note call to powershell (pwsh)
let g:LanguageClient_serverCommands = {
\ 'ps1': ['pwsh', '~/Desktop/PowerShellEditorServices/module/Start-EditorServices.ps1', '-HostName', 'nvim', '-HostProfileId', '0', '-HostVersion', '1.0.0', '-EditorServicesVersion', '1.6.0', '-LogPath', '~/Desktop/pses.log.txt', '-LogLevel', 'Diagnostic', '-BundledModulesPath', '~/Desktop/PowerShellEditorServices/module', '-Stdio', '-SessionDetailsPath', '~/Desktop/.pses_session']
\ }
let g:LanguageClient_loggingLevel = 'DEBUG'
autocmd FileType ps1 call VsimEnableLanguageServerKeys()
function! VsimEnableLanguageServerKeys()
" TODO hover with timer
nnoremap <silent> <S-K> :call LanguageClient_textDocument_hover()<CR>
nnoremap <silent> <F2> :call LanguageClient_textDocument_rename()<CR>
nnoremap <silent> gd :call LanguageClient_textDocument_definition()<CR>
nnoremap <silent> <F12> :call LanguageClient_textDocument_definition()<CR>
set formatexpr=LanguageClient_textDocument_rangeFormatting()
vnoremap = :call LanguageClient_textDocument_rangeFormatting()<CR>
nnoremap <C-k><C-r> :call LanguageClient_textDocument_references()<CR>
nnoremap <C-e><C-d> :call LanguageClient_textDocument_formatting()<CR>
autocmd! CursorHold * call LanguageClient_textDocument_hover()
autocmd! VimLeave * :LanguageClientStop
endfunction
- Language server link and version:
I'm testing out the following PR by @yatli for PowerShell Editor Services EditorServiceHost: allow Tcp/NamedPipe/Stdio listeners PowerShell/PowerShellEditorServices#629
This will allow PowerShell Editor Services to listen on stdio to be able to work with LanguageClient-neovim
@yatli's fork is here: https://github.com/yatli/PowerShellEditorServices
clone that to ~/Desktop
You'll need to run the build step to get it working:
https://github.com/powershell/powershelleditorservices#development
- Steps to reproduce the issue from clean state
- open a ps1 with neovim
- close neovim or do
:LanguageClientStop
or do:call LanguageClient#exit()
- run
ps aux | grep pwsh
- Logs. Paste or attach
/tmp/LanguageClient.log
and/tmp/LanguageServer.log
.
LanguageClient.log
LanguageServer.log
Expected Behavior
LanguageClient-neovim would close the running instance of powershell (where the language server is running)
Current Behavior
The process is still running:
tylerleonhardt 19425 0.0 0.7 6606068 118280 s001 S+ 11:13PM 0:04.18 pwsh /Users/tylerleonhardt/Desktop/PowerShellEditorServices/module/Start-EditorServices.ps1 -HostName nvim -HostProfileId 0 -HostVersion 1.0.0 -EditorServicesVersion 1.6.0 -LogPath /Users/tylerleonhardt/Desktop/pses.log.txt -LogLevel Diagnostic -BundledModulesPath /Users/tylerleonhardt/Desktop/PowerShellEditorServices/module -Stdio -SessionDetailsPath /Users/tylerleonhardt/Desktop/.pses_session
This is bad because I often close and open neovim all the time and every time that happens a new process is left behind. Too many stray processes.