sourcegraph/javascript-typescript-langserver

Use textEdit in completionItem

yeahio opened this issue · 0 comments

When requesting completions for JavaScript, CompletionItems are currently very simple, including only the label to specify the text to be inserted.

By contrast, for TypeScript they do include an insertText property, which, however, is deprecated in favor of textEdit.

TextEdits have the big advantage that they let the server specify a range to replace. This would particularly make sense in the context of issue #489 when proposing CompletionItems that replace existing content.