Fix #615
Fix #798
This commit is contained in:
hrsh7th
2022-02-15 20:20:57 +09:00
parent ba47440a97
commit 4f5cc6a9c8
3 changed files with 77 additions and 3 deletions

View File

@@ -264,6 +264,58 @@ describe('entry', function()
assert.are.equal(e:get_filter_text(), '$this')
end)
it('[odin-language-server] 1', function()
local state = spec.state('\t\t', 1, 4)
-- press g
state.input('s')
local e = entry.new(state.manual(), state.source(), {
additionalTextEdits = {},
command = {
arguments = {},
command = '',
title = '',
},
deprecated = false,
detail = 'string',
documentation = '',
insertText = '',
insertTextFormat = 1,
kind = 14,
label = 'string',
tags = {},
})
assert.are.equal(e:get_vim_item(e:get_offset()).word, 'string')
end)
it('[ansiblels] 1', function()
local state = spec.state('\t\t', 1, 4)
-- press g
state.input('s')
local e = entry.new(state.manual(), state.source(), {
detail = 'ansible.builtin',
filterText = 'blockinfile ansible.builtin.blockinfile',
kind = 7,
label = 'blockinfile',
sortText = '2_blockinfile',
textEdit = {
newText = '',
range = {
['end'] = {
character = 7,
line = 15,
},
start = {
character = 6,
line = 15,
},
},
},
})
assert.are.equal(e:get_vim_item(e:get_offset()).word, 'blockinfile')
end)
it('[#47] word should not contain \\n character', function()
local state = spec.state('', 1, 1)