Fix #417 completed snippets parser

This commit is contained in:
Shougo Matsushita
2018-02-18 18:53:18 +09:00
parent 3071a45a4c
commit e70864c53c
3 changed files with 25 additions and 30 deletions

View File

@@ -87,11 +87,6 @@ function! s:suite.get_completed_snippet() abort
\ 'menu' : '', 'info' : ''
\ }, 'foo(', ''), '${1:#:hoge}${2:#:, ...})${3}')
call s:assert.equals(neosnippet#parser#_get_completed_snippet({
\ 'word' : 'foo{', 'abbr' : 'foo{',
\ 'menu' : '', 'info' : ''
\ }, 'foo{', ''), '${1}}${2}')
call s:assert.equals(neosnippet#parser#_get_completed_snippet({
\ 'word' : 'Dictionary', 'abbr' : 'Dictionary<Key, Value>(foo)',
\ 'menu' : '', 'info' : ''
@@ -128,14 +123,14 @@ function! s:suite.get_completed_snippet() abort
\ 'menu' : '', 'info' : ''
\ }, 'forEach', ''), '(${1:#:BiConsumer<>})${2}')
call s:assert.equals(neosnippet#parser#_get_completed_snippet({
\ 'word' : 'for[', 'abbr' : '',
\ 'menu' : '', 'info' : ''
\ }, 'for[', ''), '${1}]${2}')
call s:assert.equals(neosnippet#parser#_get_completed_snippet({
\ 'word' : 'something', 'abbr' : 'something(else)',
\ 'menu' : '', 'info' : '', 'snippet' : '(${1:custom})${2}'
\ }, 'something', ''), '(${1:custom})${2}')
call s:assert.equals(neosnippet#parser#_get_completed_snippet({
\ 'word' : 'something', 'abbr' : 'something(else)',
\ 'menu' : '', 'info' : 'func()', 'snippet' : '(${1:custom})${2}'
\ }, 'something', ''), '(${1:custom})${2}')
endfunction