diff --git a/autoload/ale/references.vim b/autoload/ale/references.vim index d00a1fa9..24267bb4 100644 --- a/autoload/ale/references.vim +++ b/autoload/ale/references.vim @@ -27,6 +27,7 @@ function! ale#references#HandleTSServerResponse(conn_id, response) abort \ 'filename': l:response_item.file, \ 'line': l:response_item.start.line, \ 'column': l:response_item.start.offset, + \ 'match': substitute(l:response_item.lineText, '^\s*\(.\{-}\)\s*$', '\1', ''), \}) endfor diff --git a/test/test_find_references.vader b/test/test_find_references.vader index 88b2d762..14b5e37b 100644 --- a/test/test_find_references.vader +++ b/test/test_find_references.vader @@ -135,9 +135,9 @@ Execute(Results should be shown for tsserver responses): AssertEqual \ [ - \ {'filename': '/foo/bar/app.ts', 'column': 9, 'line': 9}, - \ {'filename': '/foo/bar/app.ts', 'column': 3, 'line': 804}, - \ {'filename': '/foo/bar/other/app.ts', 'column': 3, 'line': 51}, + \ {'filename': '/foo/bar/app.ts', 'column': 9, 'line': 9, 'match': 'import {doSomething} from ''./whatever'''}, + \ {'filename': '/foo/bar/app.ts', 'column': 3, 'line': 804, 'match': 'doSomething()'}, + \ {'filename': '/foo/bar/other/app.ts', 'column': 3, 'line': 51, 'match': 'doSomething()'}, \ ], \ g:item_list AssertEqual {}, ale#references#GetMap()