From 3e1dbd5f0f8f0d678826a7f17e27873005644fe5 Mon Sep 17 00:00:00 2001 From: Bogdan Gusiev Date: Thu, 23 Jan 2025 14:01:29 +0100 Subject: [PATCH 1/2] Add matched text to ALEFindReferences -quickfix for tsserver --- autoload/ale/references.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/ale/references.vim b/autoload/ale/references.vim index df253c9cff..7041d07528 100644 --- a/autoload/ale/references.vim +++ b/autoload/ale/references.vim @@ -17,18 +17,20 @@ 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 From 2ce2da82cacb2017f63a7dd71cee11f2c29c0178 Mon Sep 17 00:00:00 2001 From: Bogdan Gusiev Date: Fri, 7 Feb 2025 11:06:56 +0100 Subject: [PATCH 2/2] Update autoload/ale/references.vim --- autoload/ale/references.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/autoload/ale/references.vim b/autoload/ale/references.vim index 7041d07528..e8cbda9e78 100644 --- a/autoload/ale/references.vim +++ b/autoload/ale/references.vim @@ -18,6 +18,7 @@ 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,