summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2019-01-02 22:40:11 +0000
committerGitHub <noreply@github.com>2019-01-02 22:40:11 +0000
commit1d87c844b0dd824e3e51cbbf651aec4d1d8834e5 (patch)
tree34b6a215332a8a953d4c0623092371f52d00bcb2
parent73ca1e71918a0b50b7bbcbed91857c3618ad93cc (diff)
parent5792bd6e29eb21d129df6f26b08ae60be217be60 (diff)
downloadale-1d87c844b0dd824e3e51cbbf651aec4d1d8834e5.zip
Merge pull request #2173 from chaucerbao/feature/find-references-line-text
Add associated line text on ALEFindReferences results for TypeScript
-rw-r--r--autoload/ale/references.vim1
-rw-r--r--test/test_find_references.vader6
2 files changed, 4 insertions, 3 deletions
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()