natebosch / vim-lsc

A vim plugin for communicating with a language server
BSD 3-Clause "New" or "Revised" License
694 stars 79 forks source link

E906: not an open channel #421

Open Linerre opened 3 years ago

Linerre commented 3 years ago

Hi there,

I met this E906: not an open channel error when opening *.vim files. E906: not an open channel complete startup log; error part

Full error message:

continuing in <SNR>29_Start
Error detected while processing BufRead Autocommands for "*"..function <SNR>14_OnOpen[6]..lsc#file#onOpen[11]..lsc#server#start[1]..<SNR>29_Start[26]..4[2]..15[4]..18[2]..20[2]..21[2]..22:
line    1:
E906: not an open channel

<SNR>14 is ~\vimfiles\plugged\vim-lsc\plugin\lsc.vim <SNR>29 is ~\vimfiles\plugged\vim-lsc\autoload\lsc\server.vim scriptnames

Basic info:

I have:

  1. installed vim-language-server with npm: vim-language-server installed

  2. configured vim-language-server according to the Wiki; even simpler:

let g:lsc_server_commands = {
  \ 'python': {
  \   'name': 'python-LSP',
  \   'command': 'pyls',
  \   },
  \ 'vim': {
  \ 'name': 'VimL',
  \ 'command': 'vim-language-server --stdio',
  \ },
  \}
let g:lsc_auto_map = {
 \  'GoToDefinition': 'gd',
 \  'FindReferences': 'gr',
 \  'Rename': 'gR',
 \  'ShowHover': 'K',
 \  'FindCodeActions': 'ga',
 \  'Completion': 'omnifunc',
 \}
let g:lsc_enable_autocomplete  = v:false
let g:lsc_reference_highlights = v:true
let g:lsc_enable_diagnostics   = v:false
set completeopt=menu,menuone,preview,noinsert,noselect

If I run :echo LSCServerStatus() in Vim, it returns starting. If I run vim-language-server --stdio from my terminal (PowerShell), no error at all. cmd line server

How can I fix the problem? Any advice? Thanks. By the way, Python server works fine.

Linerre commented 3 years ago

Somehow, the vim-language-server suddenly starts working with vim-lsc as expected: working

After I opened this issue, I did the following things (though I doubt any of them is special):

  1. I completely disabled vim-lsc plugin by commenting out the plug line and its config file;
  2. I switched to coc.nvim, but got another issue with the server (see the mentioned issue above)
  3. I decided to disable coc.nvim too, and switch back to this plugin, because at least it is lightweight and implemented in pure Vimscript, which won me over in the first place.
  4. Unommented the lsc related lines in my vim config and it started working.

I have no idea what happened. I'll keep an eye on this though. If I keep the config above and restart vim again, then the issue comes back. I am so confused.

andrescuco commented 3 years ago

I am having the same issue trying to initialize typescript-language-server. I have just the minimal config of

let g:lsc_server_commands = {'typescript': 'typescript-language-server --stdio'}

The same error as @Linerre appears when trying to open any typescript file. This doesn't happen with any other lsp vim plugin.