From ce2b002c03a3a95b5118590905e366ba6e42cf3e Mon Sep 17 00:00:00 2001 From: Bogdan Gusiev Date: Sun, 16 Feb 2025 02:16:01 +0100 Subject: [PATCH] Add matched text to ALEFindReferences -quickfix for tsserver (#4898) * Add matched text to ALEFindReferences -quickfix for tsserver * Update autoload/ale/references.vim --- autoload/ale/references.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autoload/ale/references.vim b/autoload/ale/references.vim index df253c9c..e8cbda9e 100644 --- a/autoload/ale/references.vim +++ b/autoload/ale/references.vim @@ -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