Apply additional edits if they exist

This commit is contained in:
Zachary Yedidia
2020-08-15 18:20:10 -04:00
parent 9999ef643f
commit 132630a9a5

View File

@@ -238,6 +238,14 @@ func LSPComplete(b *Buffer) []Completion {
Start: toLoc(item.TextEdit.Range.Start),
End: toLoc(item.TextEdit.Range.End),
}}
for _, e := range item.AdditionalTextEdits {
d := Delta{
Text: []byte(e.NewText),
Start: toLoc(e.Range.Start),
End: toLoc(e.Range.End),
}
completions[i].Edits = append(completions[i].Edits, d)
}
} else {
var t string
if len(item.InsertText) > 0 {