diff options
author | Alvin Chan <chaucerbao@users.noreply.github.com> | 2019-02-08 11:43:04 -0800 |
---|---|---|
committer | w0rp <w0rp@users.noreply.github.com> | 2019-02-08 19:43:04 +0000 |
commit | 1fb0de2a8e4ff9846a62ec8c6bcbb8aea8856cc7 (patch) | |
tree | 7e41f2f3c06faca244a3c94a322dd8d1ab5afa15 /test | |
parent | d21581016ec7008afb00ea8e938505549a1136e9 (diff) | |
download | ale-1fb0de2a8e4ff9846a62ec8c6bcbb8aea8856cc7.zip |
Add `-relative` option to ALESymbolSearch (#2255)
* Add `-relative` option to ALESymbolSearch
* Document the `-relative` option for ALEFindReferences and ALESymbolSearch
Diffstat (limited to 'test')
-rw-r--r-- | test/test_symbol_search.vader | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/test/test_symbol_search.vader b/test/test_symbol_search.vader index d8b7a4a6..9d50e267 100644 --- a/test/test_symbol_search.vader +++ b/test/test_symbol_search.vader @@ -7,6 +7,7 @@ Before: let g:message_list = [] let g:preview_called = 0 let g:item_list = [] + let g:options = {} let g:capability_checked = '' let g:conn_id = v:null let g:WaitCallback = v:null @@ -47,9 +48,10 @@ Before: call add(g:expr_list, a:expr) endfunction - function! ale#preview#ShowSelection(item_list) abort + function! ale#preview#ShowSelection(item_list, options) abort let g:preview_called = 1 let g:item_list = a:item_list + let g:options = a:options endfunction After: @@ -63,6 +65,7 @@ After: unlet! g:message_list unlet! g:expr_list unlet! b:ale_linters + unlet! g:options unlet! g:item_list unlet! g:preview_called @@ -170,4 +173,15 @@ Execute(LSP symbol requests should be sent): \ ], \ g:message_list - AssertEqual {'42': {'buffer': bufnr('')}}, ale#symbol#GetMap() + AssertEqual {'42': {'buffer': bufnr(''), 'use_relative_paths': 0}}, ale#symbol#GetMap() + +Execute('-relative' argument should enable 'use_relative_paths' in HandleLSPResponse): + runtime ale_linters/python/pyls.vim + let b:ale_linters = ['pyls'] + call setpos('.', [bufnr(''), 1, 5, 0]) + + ALESymbolSearch -relative foo bar + + call call(g:WaitCallback, [g:conn_id, '/foo/bar']) + + AssertEqual {'42': {'buffer': bufnr(''), 'use_relative_paths': 1}}, ale#symbol#GetMap() |