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

fix: reduce the times of workspace/didChangeConfiguration #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mityu
Copy link
Contributor

@mityu mityu commented Sep 10, 2024

Reduce how many times the workspace/didChangeConfiguration notification is sent.
Also, omit needless parameter for the workspace/didChangeConfiguration notification.

Reduce how many times the workspace/didChangeConfiguration notification
is sent. Also, omit needless parameter for the
workspace/didChangeConfiguration notification.
@mityu
Copy link
Contributor Author

mityu commented Sep 10, 2024

I don't know why, but this patch prevents these diagnostics errors (shown in this screenshot) to be reported by deno lsp.

image

Repro steps

  • vimrc.vim
if &compatible
  set nocompatible
endif

filetype plugin indent on
syntax on

set runtimepath+=/path/to/denops.vim  " Please replace this.
set runtimepath+=/path/to/lspoints  " Please replace this.

autocmd User DenopsReady call lspoints#denops#register()
autocmd FileType typescript call lspoints#attach('denols', #{
  \ rootPath: findfile('deno.json', $'{expand('%:p:h')};')->fnamemodify(':h'),
  \ })
autocmd User DenopsPluginPost:lspoints call s:setup_lspoints()
autocmd User DenopsPluginPost:lspoints ++nested call timer_start(100, {-> s:open_files()})

function s:setup_lspoints() abort
  call lspoints#load_extensions(['nvim_diagnostics'])
  call lspoints#start('denols', #{
    \ cmd: [get(g:, 'denops#deno', 'deno'), 'lsp'],
    \ settings: #{
    \   deno: #{
    \     enable: v:true,
    \     lint: v:true,
    \     unstable: v:true,
    \   }}})
endfunction

function s:open_files() abort
  e /path/to/lspoints/denops/lspoints/builtin/diagnostics.ts  " Please replace this.
  sp /path/to/lspoints/denops/lspoints/app.ts  " Please replace this.
  wincmd p
  redraw!
endfunction
  • Open Neovim with nvim -u /path/to/vimrc.vim
  • After two files are opened, reopen denops/lspoints/builtin/diagnostics.ts by :e command. (Maybe you have to do this for two times.)
  • Some new diagnostics errors are given.

Env

  • deno
deno 1.45.5 (release, aarch64-apple-darwin)
v8 12.7.224.13
typescript 5.5.2
  • Neovim
NVIM v0.11.0-dev-732+g08153ddd1
Build type: Release
LuaJIT 2.1.1724512491

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

Successfully merging this pull request may close these issues.

1 participant