@@ -44,15 +44,18 @@ local construct_additionTextEdits = function(id, name)
44
44
}
45
45
end
46
46
47
- local construct_textEdit = function (name )
47
+ local construct_textEdit = function (name , kind )
48
48
if _G .mock_textEdit == nil then return end
49
49
local new_text , pos = _G .mock_textEdit .new_text , _G .mock_textEdit .pos
50
+ local is_insertreplaceedit = kind == ' InsertReplaceEdit'
51
+ local range = {
52
+ start = { line = pos [1 ] - 1 , character = pos [2 ] - 1 },
53
+ [' end' ] = { line = pos [1 ] - 1 , character = pos [2 ] },
54
+ }
50
55
return {
51
56
newText = new_text (name ),
52
- range = {
53
- start = { line = pos [1 ] - 1 , character = pos [2 ] - 1 },
54
- [' end' ] = { line = pos [1 ] - 1 , character = pos [2 ] },
55
- },
57
+ [is_insertreplaceedit and ' insert' or ' range' ] = range ,
58
+ replace = is_insertreplaceedit and range or nil ,
56
59
}
57
60
end
58
61
@@ -71,8 +74,12 @@ Months.requests = {
71
74
res .additionalTextEdits = construct_additionTextEdits (' completion' , item .name )
72
75
end
73
76
74
- if vim .tbl_contains ({ ' April' , ' August' }, item .name ) then
75
- res .textEdit = construct_textEdit (item .name )
77
+ if item .name == ' April' then
78
+ res .textEdit = construct_textEdit (item .name , ' InsertReplaceEdit' )
79
+ res .filterText = construct_filterText (item .name )
80
+ end
81
+ if item .name == ' August' then
82
+ res .textEdit = construct_textEdit (item .name , ' textEdit' )
76
83
res .filterText = construct_filterText (item .name )
77
84
end
78
85
0 commit comments