Send workspace_config only if changed (#1137)

This commit is contained in:
hrsh7th
2021-04-12 20:16:39 +09:00
committed by GitHub
parent bba0f45c89
commit 9dc382c04a

View File

@@ -616,12 +616,12 @@ endfunction
function! s:ensure_conf(buf, server_name, cb) abort
let l:server = s:servers[a:server_name]
let l:server_info = l:server['server_info']
if has_key(l:server_info, 'workspace_config')
let l:workspace_config = l:server_info['workspace_config']
if has_key(l:server_info, 'workspace_config') && !get(l:server_info, '_workspace_config_sent', v:false)
let l:server_info['_workspace_config_sent'] = v:true
call s:send_notification(a:server_name, {
\ 'method': 'workspace/didChangeConfiguration',
\ 'params': {
\ 'settings': l:workspace_config,
\ 'settings': l:server_info['workspace_config'],
\ }
\ })
endif
@@ -1195,6 +1195,7 @@ function! lsp#update_workspace_config(server_name, workspace_config) abort
else
let l:server_info['workspace_config'] = a:workspace_config
endif
let l:server_info['_workspace_config_sent'] = v:false
call s:ensure_conf(bufnr('%'), a:server_name, function('s:Noop'))
endfunction