You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vscode.executeCompletionItemProvider results are missing additionalTextEdits #87346
apibugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiessuggestIntelliSense, Auto Complete
If you return additionalTextEdits in a completion item, the property is undefined when calling through vscode.executeCompletionItemProvider.
Setup:
constpos=newvscode.Position(0,0);constrange=newvscode.Range(pos,pos);context.subscriptions.push(vscode.languages.registerCompletionItemProvider({language: "markdown"},{provideCompletionItems: (document: vscode.TextDocument,position: vscode.Position,token: vscode.CancellationToken,context: vscode.CompletionContext)=>{// Build a string like `test(onPressed: [null])` where [null] is// a placeholder containing "null".constitem=newvscode.CompletionItem("dantup");item.insertText="dantup";item.additionalTextEdits=[newvscode.TextEdit(range,"additional-dantup"),];return[item];}}));
The doc states that additionalTextEdits should not overlap with the main edit range or each other, should that be checked or is that done when the edits are carried out?
Adding this:
works, unless the range intersections need to be checked.
apibugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiessuggestIntelliSense, Auto Complete
Activity
jzyrobert commentedon Dec 24, 2019
Johannes Rieken (@jrieken) It looks like the conversion here is missing.
The doc states that additionalTextEdits should not overlap with the main edit range or each other, should that be checked or is that done when the edits are carried out?
Adding this:

works, unless the range intersections need to be checked.
jrieken commentedon Dec 24, 2019
No checks required - this is already the way back from the UX and check should have been carried out already