mirror of
https://github.com/prabirshrestha/vim-lsp.git
synced 2025-12-24 12:14:32 +01:00
* Move some codes to completion.vim that related to handling CompleteDone. * Add abort * Fix test * Add l: prefix to self vars * Disable unused vars * Restore position * Support snippet simple case and vim-lsp-snippets * Support g:lsp_text_edit_enabled * Fix for v:null results * Fix multi-byte chars * Add document * Fix for vim-lsp-snippets for now * Prepare to future improvements * More clalify line comment * User get_user_data instead of extract_user_data * Always use [''] pattern for accessing dictionary property * Fix misspelling * More strict check for completionProvider.resolveProvider * Fix obj.key to obj['key'] * Store completed_item id to the user_data * Fix omni tests * Apply for the review - Rename expand_text_simply -> simple_expand_text - to_col -> _lsp_to_vim - Rename user_data key * Add example tests * Add timeout to completionItem/resolve in completion.vim * Fix timeout feature * Add timeout log * Fix documents
38 lines
972 B
Plaintext
38 lines
972 B
Plaintext
Describe lsp#uivim#completion
|
|
|
|
Before each
|
|
%delete _
|
|
setlocal filetype=html
|
|
setlocal omnifunc=lsp#omni#complete
|
|
End
|
|
|
|
It should expand simple snippet with multibyte chars
|
|
Skip This test needs asynchronous process and snippetSupport=true
|
|
|
|
call setline(1, ['<div class="あいうえお">'])
|
|
execute "normal! 'gg$ha id\<C-x>\<C-o>\<C-n>\<Tab>'"
|
|
|
|
" wait for feedkeys.
|
|
|
|
Assert Equals(getline(1), '<div class="あいうえお" id="">')
|
|
Assert Equals(getpos('.')[1 : 2], [1, 30])
|
|
End
|
|
|
|
It should expand when textEdit.start.character is less than completion start col
|
|
Skip This test needs asynchronous process and snippetSupport=true
|
|
|
|
call setline(1, [
|
|
\ '<html>',
|
|
\ ' <div>',
|
|
\ ' </>',
|
|
\ '</html>'])
|
|
execute "normal! ':gg2j$ha\<C-x>\<C-o>\<C-n>\<Tab>'"
|
|
|
|
" wait for feedkeys.
|
|
|
|
Assert Equals(getline(3), ' </div>')
|
|
Assert Equals(getpos('.')[1 : 2], [1, 8])
|
|
End
|
|
|
|
End
|