-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2492 - Try to fix a deoplete bug again
- Loading branch information
Showing
4 changed files
with
103 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
Before: | ||
call ale#linter#Reset() | ||
|
||
unlet! b:ale_linters | ||
unlet! b:ale_completion_info | ||
unlet! b:ale_completion_response | ||
unlet! b:ale_completion_parser | ||
unlet! b:ale_completion_result | ||
|
||
function! Identity(x) abort | ||
return a:x | ||
endfunction | ||
|
||
After: | ||
delfunction Identity | ||
|
||
call ale#linter#Reset() | ||
|
||
unlet! b:ale_linters | ||
unlet! b:ale_completion_info | ||
unlet! b:ale_completion_response | ||
unlet! b:ale_completion_parser | ||
unlet! b:ale_completion_result | ||
|
||
Execute(ale#completion#GetCompletionResult() should return v:null when there are no results): | ||
AssertEqual v:null, ale#completion#GetCompletionResult() | ||
|
||
Execute(ale#completion#GetCompletionResult() should parse the result when it has yet to be parsed): | ||
let b:ale_completion_response = [1] | ||
let b:ale_completion_parser = 'Identity' | ||
|
||
AssertEqual [1], ale#completion#GetCompletionResult() | ||
Assert !exists('b:ale_completion_response') | ||
Assert !exists('b:ale_completion_parser') | ||
AssertEqual [1], b:ale_completion_result | ||
|
||
Execute(ale#completion#GetCompletionResult() should return a result computed previously): | ||
let b:ale_completion_result = [1] | ||
|
||
Assert !exists('b:ale_completion_response') | ||
Assert !exists('b:ale_completion_parser') | ||
AssertEqual [1], ale#completion#GetCompletionResult() | ||
|
||
Execute(ale#completion#GetCompletionPosition() should return 0 when there is no completion information): | ||
AssertEqual 0, ale#completion#GetCompletionPosition() | ||
|
||
Given python(Some Python file): | ||
foo bar | ||
|
||
Execute(ale#completion#GetCompletionPosition() should return the position in the file when information is available): | ||
let b:ale_completion_info = {'line': 1, 'column': 6} | ||
|
||
" This is the first character of 'bar' | ||
AssertEqual 4, ale#completion#GetCompletionPosition() | ||
|
||
Execute(ale#completion#CanProvideCompletions should return 0 when no completion sources are available): | ||
AssertEqual 0, ale#completion#CanProvideCompletions() | ||
|
||
Execute(ale#completion#CanProvideCompletions should return 1 when at least one completion source is available): | ||
runtime ale_linters/python/pyls.vim | ||
let b:ale_linters = ['pyls'] | ||
|
||
AssertEqual 1, ale#completion#CanProvideCompletions() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters