#2341 - Handle completion messages with textEdit objects

This commit is contained in:
w0rp
2019-03-10 15:21:36 +00:00
parent 8a0213f1fd
commit 03384a5d6f
2 changed files with 42 additions and 1 deletions

View File

@@ -471,3 +471,34 @@ Execute(Should handle documentation in the markdown format):
\ ],
\ },
\ })
Execute(Should handle completion messages with textEdit objects):
AssertEqual
\ [
\ {'word': 'next_callback', 'menu': 'PlayTimeCallback', 'info': '', 'kind': 'v', 'icase': 1},
\ ],
\ ale#completion#ParseLSPCompletions({
\ 'id': 226,
\ 'jsonrpc': '2.0',
\ 'result': {
\ 'isIncomplete': v:false,
\ 'items': [
\ {
\ 'detail': 'PlayTimeCallback',
\ 'filterText': 'next_callback',
\ 'insertText': 'next_callback',
\ 'insertTextFormat': 1,
\ 'kind': 6,
\ 'label': ' next_callback',
\ 'sortText': '3ee19999next_callback',
\ 'textEdit': {
\ 'newText': 'next_callback',
\ 'range': {
\ 'end': {'character': 13, 'line': 12},
\ 'start': {'character': 4, 'line': 12},
\ },
\ },
\ },
\ ],
\ },
\ })