Send correct replacement range information (use OptionalReplacementSpan)
jasonwilliams opened this issue · 2 comments
Raised from: microsoft/vscode#134328
and: microsoft/vscode#134328 (comment)
It looks like this plugin doesn't send back the proper range information. meaning replacements and edits are a bit screwed up. OptionalReplacementSpan
could help with this.
Looking at CompletionInfo theres a new property OptionalReplacementSpan I think maybe this needs adding. It could help with this issue
You can see we don't send it here:
typescript-styled-plugin/src/_language-service.ts
Lines 379 to 392 in cd59030
Also, try setting the replacementSpan property for each CompletionEntry
https://github.com/microsoft/TypeScript/blob/main/lib/tsserverlibrary.d.ts#L6295
From speaking to Andrew branch it sounds like this needs to be set then checked here
https://github.com/microsoft/TypeScript/blob/9766757ee6b4df479330c170bec3a8951dd95744/src/server/session.ts#L1873
See microsoft/vscode#134328 (comment) for update. ReplacementSpan needs to be set inside of completionEntry