Merge pull request #2173 from chaucerbao/feature/find-references-line-text

Add associated line text on ALEFindReferences results for TypeScript
This commit is contained in:
w0rp 2019-01-02 22:40:11 +00:00 committed by GitHub
commit 1d87c844b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -27,6 +27,7 @@ function! ale#references#HandleTSServerResponse(conn_id, response) abort
\ 'filename': l:response_item.file, \ 'filename': l:response_item.file,
\ 'line': l:response_item.start.line, \ 'line': l:response_item.start.line,
\ 'column': l:response_item.start.offset, \ 'column': l:response_item.start.offset,
\ 'match': substitute(l:response_item.lineText, '^\s*\(.\{-}\)\s*$', '\1', ''),
\}) \})
endfor endfor

View File

@ -135,9 +135,9 @@ Execute(Results should be shown for tsserver responses):
AssertEqual AssertEqual
\ [ \ [
\ {'filename': '/foo/bar/app.ts', 'column': 9, 'line': 9}, \ {'filename': '/foo/bar/app.ts', 'column': 9, 'line': 9, 'match': 'import {doSomething} from ''./whatever'''},
\ {'filename': '/foo/bar/app.ts', 'column': 3, 'line': 804}, \ {'filename': '/foo/bar/app.ts', 'column': 3, 'line': 804, 'match': 'doSomething()'},
\ {'filename': '/foo/bar/other/app.ts', 'column': 3, 'line': 51}, \ {'filename': '/foo/bar/other/app.ts', 'column': 3, 'line': 51, 'match': 'doSomething()'},
\ ], \ ],
\ g:item_list \ g:item_list
AssertEqual {}, ale#references#GetMap() AssertEqual {}, ale#references#GetMap()