mirror of
https://github.com/dense-analysis/ale.git
synced 2026-03-01 04:52:28 +08:00
Add support for finding references using LSP servers or tsserver
This commit is contained in:
@@ -116,3 +116,13 @@ function! ale#lsp#message#Definition(buffer, line, column) abort
|
||||
\ 'position': {'line': a:line - 1, 'character': a:column},
|
||||
\}]
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#message#References(buffer, line, column) abort
|
||||
return [0, 'textDocument/references', {
|
||||
\ 'textDocument': {
|
||||
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')),
|
||||
\ },
|
||||
\ 'position': {'line': a:line - 1, 'character': a:column},
|
||||
\ 'context': {'includeDeclaration': v:false},
|
||||
\}]
|
||||
endfunction
|
||||
|
||||
@@ -61,3 +61,11 @@ function! ale#lsp#tsserver_message#Definition(buffer, line, column) abort
|
||||
\ 'file': expand('#' . a:buffer . ':p'),
|
||||
\}]
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#tsserver_message#References(buffer, line, column) abort
|
||||
return [0, 'ts@references', {
|
||||
\ 'line': a:line,
|
||||
\ 'offset': a:column,
|
||||
\ 'file': expand('#' . a:buffer . ':p'),
|
||||
\}]
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user