mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Add matched text to ALEFindReferences -quickfix for tsserver (#4898)
Some checks are pending
CI / build_image (push) Waiting to run
CI / test_ale (--linters-only) (push) Blocked by required conditions
CI / test_ale (--neovim-06-only) (push) Blocked by required conditions
CI / test_ale (--neovim-08-only) (push) Blocked by required conditions
CI / test_ale (--vim-80-only) (push) Blocked by required conditions
CI / test_ale (--vim-90-only) (push) Blocked by required conditions
Some checks are pending
CI / build_image (push) Waiting to run
CI / test_ale (--linters-only) (push) Blocked by required conditions
CI / test_ale (--neovim-06-only) (push) Blocked by required conditions
CI / test_ale (--neovim-08-only) (push) Blocked by required conditions
CI / test_ale (--vim-80-only) (push) Blocked by required conditions
CI / test_ale (--vim-90-only) (push) Blocked by required conditions
* Add matched text to ALEFindReferences -quickfix for tsserver * Update autoload/ale/references.vim
This commit is contained in:
@@ -17,18 +17,21 @@ function! ale#references#ClearLSPData() abort
|
||||
endfunction
|
||||
|
||||
function! ale#references#FormatTSResponseItem(response_item, options) abort
|
||||
let l:match = substitute(a:response_item.lineText, '^\s*\(.\{-}\)\s*$', '\1', '')
|
||||
|
||||
if get(a:options, 'open_in') is# 'quickfix'
|
||||
return {
|
||||
\ 'filename': a:response_item.file,
|
||||
\ 'lnum': a:response_item.start.line,
|
||||
\ 'col': a:response_item.start.offset,
|
||||
\ 'text': l:match,
|
||||
\}
|
||||
else
|
||||
return {
|
||||
\ 'filename': a:response_item.file,
|
||||
\ 'line': a:response_item.start.line,
|
||||
\ 'column': a:response_item.start.offset,
|
||||
\ 'match': substitute(a:response_item.lineText, '^\s*\(.\{-}\)\s*$', '\1', ''),
|
||||
\ 'match': l:match,
|
||||
\}
|
||||
endif
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user