mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-09 13:02:28 +08:00
Fix #1568 - Filter LSP completion results with the prefixes
This commit is contained in:
@@ -390,3 +390,42 @@ Execute(Should handle Python completion results correctly):
|
||||
\ ]
|
||||
\ }
|
||||
\ })
|
||||
|
||||
Execute(Should handle Python completion results correctly):
|
||||
let b:ale_completion_info = {
|
||||
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
|
||||
\ 'prefix': 'mig',
|
||||
\}
|
||||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {'word': 'migrations', 'menu': 'xxx', 'info': 'migrations', 'kind': 'f', 'icase': 1},
|
||||
\ {'word': 'MigEngine', 'menu': 'xxx', 'info': 'mig engine', 'kind': 'f', 'icase': 1},
|
||||
\ ],
|
||||
\ ale#completion#ParseLSPCompletions({
|
||||
\ 'jsonrpc': '2.0',
|
||||
\ 'id': 6,
|
||||
\ 'result': {
|
||||
\ 'isIncomplete': v:false,
|
||||
\ 'items': [
|
||||
\ {
|
||||
\ 'label': 'migrations',
|
||||
\ 'kind': 3,
|
||||
\ 'detail': 'xxx',
|
||||
\ 'documentation': 'migrations',
|
||||
\ },
|
||||
\ {
|
||||
\ 'label': 'MigEngine',
|
||||
\ 'kind': 3,
|
||||
\ 'detail': 'xxx',
|
||||
\ 'documentation': 'mig engine',
|
||||
\ },
|
||||
\ {
|
||||
\ 'label': 'ignore me',
|
||||
\ 'kind': 3,
|
||||
\ 'detail': 'nope',
|
||||
\ 'documentation': 'nope',
|
||||
\ },
|
||||
\ ]
|
||||
\ }
|
||||
\ })
|
||||
|
||||
Reference in New Issue
Block a user