mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! go#lsp#message#Initialize(wd)
|
||||
function! go#lsp#message#Initialize(wd) abort
|
||||
return {
|
||||
\ 'notification': 0,
|
||||
\ 'method': 'initialize',
|
||||
@ -11,13 +11,17 @@ function! go#lsp#message#Initialize(wd)
|
||||
\ 'rootUri': go#path#ToURI(a:wd),
|
||||
\ 'capabilities': {
|
||||
\ 'workspace': {},
|
||||
\ 'textDocument': {}
|
||||
\ 'textDocument': {
|
||||
\ 'hover': {
|
||||
\ 'contentFormat': ['plaintext'],
|
||||
\ },
|
||||
\ }
|
||||
\ }
|
||||
\ }
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
function! go#lsp#message#Definition(file, line, col)
|
||||
function! go#lsp#message#Definition(file, line, col) abort
|
||||
return {
|
||||
\ 'notification': 0,
|
||||
\ 'method': 'textDocument/definition',
|
||||
@ -30,8 +34,7 @@ function! go#lsp#message#Definition(file, line, col)
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
|
||||
function! go#lsp#message#TypeDefinition(file, line, col)
|
||||
function! go#lsp#message#TypeDefinition(file, line, col) abort
|
||||
return {
|
||||
\ 'notification': 0,
|
||||
\ 'method': 'textDocument/typeDefinition',
|
||||
@ -44,7 +47,7 @@ function! go#lsp#message#TypeDefinition(file, line, col)
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
function! go#lsp#message#DidOpen(file, content)
|
||||
function! go#lsp#message#DidOpen(file, content) abort
|
||||
return {
|
||||
\ 'notification': 1,
|
||||
\ 'method': 'textDocument/didOpen',
|
||||
@ -58,7 +61,7 @@ function! go#lsp#message#DidOpen(file, content)
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
function! go#lsp#message#DidChange(file, content)
|
||||
function! go#lsp#message#DidChange(file, content) abort
|
||||
return {
|
||||
\ 'notification': 1,
|
||||
\ 'method': 'textDocument/didChange',
|
||||
@ -75,7 +78,7 @@ function! go#lsp#message#DidChange(file, content)
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
function! go#lsp#message#DidClose(file)
|
||||
function! go#lsp#message#DidClose(file) abort
|
||||
return {
|
||||
\ 'notification': 1,
|
||||
\ 'method': 'textDocument/didClose',
|
||||
@ -87,7 +90,7 @@ function! go#lsp#message#DidClose(file)
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
function! go#lsp#message#Completion(file, line, col)
|
||||
function! go#lsp#message#Completion(file, line, col) abort
|
||||
return {
|
||||
\ 'notification': 0,
|
||||
\ 'method': 'textDocument/completion',
|
||||
@ -100,7 +103,20 @@ function! go#lsp#message#Completion(file, line, col)
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
function! s:position(line, col)
|
||||
function! go#lsp#message#Hover(file, line, col) abort
|
||||
return {
|
||||
\ 'notification': 0,
|
||||
\ 'method': 'textDocument/hover',
|
||||
\ 'params': {
|
||||
\ 'textDocument': {
|
||||
\ 'uri': go#path#ToURI(a:file)
|
||||
\ },
|
||||
\ 'position': s:position(a:line, a:col),
|
||||
\ }
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
function! s:position(line, col) abort
|
||||
return {'line': a:line - 1, 'character': a:col-1}
|
||||
endfunction
|
||||
|
||||
|
Reference in New Issue
Block a user