mirror of
https://github.com/prabirshrestha/vim-lsp.git
synced 2025-12-14 20:35:59 +01:00
Add config.diagnostics to disable diagnostics per server (#828)
This commit is contained in:
@@ -736,10 +736,12 @@ function! s:on_notification(server_name, id, data, event) abort
|
||||
call lsp#log_verbose('<---', a:id, a:server_name, a:data)
|
||||
let l:response = a:data['response']
|
||||
let l:server = s:servers[a:server_name]
|
||||
let l:server_info = l:server['server_info']
|
||||
let l:lsp_diagnostics_config_enabled = get(get(l:server_info, 'config', {}), 'diagnostics', v:true)
|
||||
|
||||
if lsp#client#is_server_instantiated_notification(a:data)
|
||||
if has_key(l:response, 'method')
|
||||
if g:lsp_diagnostics_enabled && l:response['method'] ==# 'textDocument/publishDiagnostics'
|
||||
if g:lsp_diagnostics_enabled && l:lsp_diagnostics_config_enabled && l:response['method'] ==# 'textDocument/publishDiagnostics'
|
||||
call lsp#ui#vim#diagnostics#handle_text_document_publish_diagnostics(a:server_name, a:data)
|
||||
elseif l:response['method'] ==# 'textDocument/semanticHighlighting'
|
||||
call lsp#ui#vim#semantic#handle_semantic(a:server_name, a:data)
|
||||
|
||||
@@ -893,6 +893,16 @@ The vim |dict| containing information about the server.
|
||||
|
||||
Example: >
|
||||
'config': { 'completion_item_kinds': {'26': 'type' } }
|
||||
<
|
||||
* diagnostics
|
||||
Type: |Boolean|
|
||||
Default: |v:true|
|
||||
|
||||
This allows disablingdiagnostics per server. Useful when dealing
|
||||
with multiple servers (One for diagnostic only)
|
||||
|
||||
Example: >
|
||||
'config': { 'diagnostics': v:false }
|
||||
<
|
||||
refresh_pattern *vim-lsp-refresh_pattern*
|
||||
Type: |String| (|pattern|)
|
||||
|
||||
Reference in New Issue
Block a user