mirror of
https://github.com/amix/vimrc
synced 2025-08-07 06:05:00 +08:00
Updated plugins
This commit is contained in:
@ -3,6 +3,10 @@
|
||||
"
|
||||
" Messages in this movie will be returned in the format
|
||||
" [is_notification, method_name, params?]
|
||||
"
|
||||
" All functions which accept line and column arguments expect them to be 1-based
|
||||
" (the same format as being returned by getpos() and friends), those then
|
||||
" will be converted to 0-based as specified by LSP.
|
||||
let g:ale_lsp_next_version_id = 1
|
||||
|
||||
" The LSP protocols demands that we send every change to a document, including
|
||||
@ -37,7 +41,7 @@ function! ale#lsp#message#Initialize(root_path, initialization_options) abort
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#message#Initialized() abort
|
||||
return [1, 'initialized']
|
||||
return [1, 'initialized', {}]
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#message#Shutdown() abort
|
||||
@ -98,7 +102,7 @@ function! ale#lsp#message#Completion(buffer, line, column, trigger_character) ab
|
||||
\ 'textDocument': {
|
||||
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
|
||||
\ },
|
||||
\ 'position': {'line': a:line - 1, 'character': a:column},
|
||||
\ 'position': {'line': a:line - 1, 'character': a:column - 1},
|
||||
\}]
|
||||
|
||||
if !empty(a:trigger_character)
|
||||
@ -116,7 +120,16 @@ function! ale#lsp#message#Definition(buffer, line, column) abort
|
||||
\ 'textDocument': {
|
||||
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
|
||||
\ },
|
||||
\ 'position': {'line': a:line - 1, 'character': a:column},
|
||||
\ 'position': {'line': a:line - 1, 'character': a:column - 1},
|
||||
\}]
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#message#TypeDefinition(buffer, line, column) abort
|
||||
return [0, 'textDocument/typeDefinition', {
|
||||
\ 'textDocument': {
|
||||
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
|
||||
\ },
|
||||
\ 'position': {'line': a:line - 1, 'character': a:column - 1},
|
||||
\}]
|
||||
endfunction
|
||||
|
||||
@ -125,7 +138,7 @@ function! ale#lsp#message#References(buffer, line, column) abort
|
||||
\ 'textDocument': {
|
||||
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
|
||||
\ },
|
||||
\ 'position': {'line': a:line - 1, 'character': a:column},
|
||||
\ 'position': {'line': a:line - 1, 'character': a:column - 1},
|
||||
\ 'context': {'includeDeclaration': v:false},
|
||||
\}]
|
||||
endfunction
|
||||
@ -141,7 +154,7 @@ function! ale#lsp#message#Hover(buffer, line, column) abort
|
||||
\ 'textDocument': {
|
||||
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
|
||||
\ },
|
||||
\ 'position': {'line': a:line - 1, 'character': a:column},
|
||||
\ 'position': {'line': a:line - 1, 'character': a:column - 1},
|
||||
\}]
|
||||
endfunction
|
||||
|
||||
|
@ -33,7 +33,7 @@ function! ale#lsp#response#ReadDiagnostics(response) abort
|
||||
\ 'lnum': l:diagnostic.range.start.line + 1,
|
||||
\ 'col': l:diagnostic.range.start.character + 1,
|
||||
\ 'end_lnum': l:diagnostic.range.end.line + 1,
|
||||
\ 'end_col': l:diagnostic.range.end.character + 1,
|
||||
\ 'end_col': l:diagnostic.range.end.character,
|
||||
\}
|
||||
|
||||
if l:severity == s:SEVERITY_WARNING
|
||||
@ -58,16 +58,20 @@ function! ale#lsp#response#ReadDiagnostics(response) abort
|
||||
if has_key(l:diagnostic, 'relatedInformation')
|
||||
let l:related = deepcopy(l:diagnostic.relatedInformation)
|
||||
call map(l:related, {key, val ->
|
||||
\ ale#path#FromURI(val.location.uri) .
|
||||
\ ':' . (val.location.range.start.line + 1) .
|
||||
\ ':' . (val.location.range.start.character + 1) .
|
||||
\ ":\n\t" . val.message
|
||||
\ })
|
||||
\ ale#path#FromURI(val.location.uri) .
|
||||
\ ':' . (val.location.range.start.line + 1) .
|
||||
\ ':' . (val.location.range.start.character + 1) .
|
||||
\ ":\n\t" . val.message
|
||||
\})
|
||||
let l:loclist_item.detail = l:diagnostic.message . "\n" . join(l:related, "\n")
|
||||
endif
|
||||
|
||||
if has_key(l:diagnostic, 'source')
|
||||
let l:loclist_item.detail = printf('[%s] %s', l:diagnostic.source, l:diagnostic.message)
|
||||
let l:loclist_item.detail = printf(
|
||||
\ '[%s] %s',
|
||||
\ l:diagnostic.source,
|
||||
\ l:diagnostic.message
|
||||
\)
|
||||
endif
|
||||
|
||||
call add(l:loclist, l:loclist_item)
|
||||
|
Reference in New Issue
Block a user