From 0c9bee6502f8a008bf000c7a2a5035699e269ba8 Mon Sep 17 00:00:00 2001 From: Alisue Date: Sat, 1 May 2021 00:51:59 +0900 Subject: [PATCH 1/3] Do NOT call notify on notified channel --- autoload/denops/server/channel.vim | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/autoload/denops/server/channel.vim b/autoload/denops/server/channel.vim index cb2071d4..fb11f87a 100644 --- a/autoload/denops/server/channel.vim +++ b/autoload/denops/server/channel.vim @@ -3,6 +3,10 @@ let s:vim_exiting = 0 let s:job = v:null function! denops#server#channel#start(notify) abort + let ctx = { + \ 'notified': 0, + \ 'notify': a:notify, + \} let args = [g:denops#server#channel#deno, 'run'] let args += g:denops#server#channel#deno_args let args += [s:script] @@ -13,7 +17,7 @@ function! denops#server#channel#start(notify) abort \ 'env': { \ 'NO_COLOR': 1, \ }, - \ 'on_stderr': funcref('s:on_stderr', [a:notify]), + \ 'on_stderr': funcref('s:on_stderr', [ctx]), \ 'on_exit': funcref('s:on_exit'), \ 'raw_options': raw_options, \}) @@ -40,9 +44,13 @@ function! denops#server#channel#request(method, params) abort return s:request(s:job, a:method, a:params) endfunction -function! s:on_stderr(notify, data, ...) abort dict +function! s:on_stderr(ctx, data, ...) abort dict + if a:ctx.notified + return + endif let address = substitute(a:data, '[\s\r\n]*$', '', '') - call a:notify(address) + let a:ctx.notified = 1 + call a:ctx.notify(address) call denops#debug(printf('channel server resolve: %s', address)) endfunction From 1467d2b798c991bb7f4fbe8ec0f50acbddc45e33 Mon Sep 17 00:00:00 2001 From: Alisue Date: Sat, 1 May 2021 01:02:16 +0900 Subject: [PATCH 2/3] Do NOT automatically restart on 'start()' but skip --- autoload/denops/server.vim | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/autoload/denops/server.vim b/autoload/denops/server.vim index f9af558b..5c18fe09 100644 --- a/autoload/denops/server.vim +++ b/autoload/denops/server.vim @@ -1,7 +1,29 @@ +let s:STATUS_STOPPED = 'stopped' +let s:STATUS_RUNNING = 'running' +let s:status = s:STATUS_STOPPED + function! denops#server#start() abort + if s:status is# s:STATUS_RUNNING + call denops#debug('Servers are already running. Skip') + return + endif + let s:status = s:STATUS_RUNNING + call denops#server#channel#start({ address -> s:start_service(address) }) +endfunction + +function! denops#server#stop() abort call denops#server#channel#stop() call denops#server#service#stop() - call denops#server#channel#start({ address -> s:start_service(address) }) + let s:status = s:STATUS_STOPPED +endfunction + +function! denops#server#restart() abort + call denops#server#stop() + call denops#server#start() +endfunction + +function! denops#server#status() abort + return s:status endfunction function! s:start_service(address) abort From f37de435438e1be6f1fc8cbe9a848b5750583a0e Mon Sep 17 00:00:00 2001 From: Alisue Date: Sat, 1 May 2021 01:07:40 +0900 Subject: [PATCH 3/3] Do NOT run CI for Neovim nightly on macOS/Windows --- .github/workflows/neovim.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/neovim.yml b/.github/workflows/neovim.yml index 36d0dcfd..ae08660d 100644 --- a/.github/workflows/neovim.yml +++ b/.github/workflows/neovim.yml @@ -22,6 +22,13 @@ jobs: version: - head - v0.4.4 + exclude: + # It seems 'head' of Neovim for macOS/Windows + # are not available (HttpError: Not Found) is raised. + - os: macos-latest + version: head + - os: windows-latest + version: head runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2