Skip to content

Commit b06c7d2

Browse files
committed
docs: add full docs for additionalTextEdits
1 parent 3c46aa1 commit b06c7d2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/adapters/autocomplete-adapter.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,15 @@ export default class AutocompleteAdapter {
496496
suggestion.text = textEdit.newText
497497
}
498498

499-
/** Handle additional text edits after a suggestion insert, e.g. `additionalTextEdits`. */
499+
/**
500+
* Handle additional text edits after a suggestion insert, e.g. `additionalTextEdits`.
501+
*
502+
* `additionalTextEdits` are An optional array of additional text edits that are applied when selecting this
503+
* completion. Edits must not overlap (including the same insert position) with the main edit nor with themselves.
504+
*
505+
* Additional text edits should be used to change text unrelated to the current cursor position (for example adding an
506+
* import statement at the top of the file if the completion item will insert an unqualified type).
507+
*/
500508
public static applyAdditionalTextEdits(event: ac.SuggestionInsertedEvent): void {
501509
const suggestion = event.suggestion as SuggestionBase
502510
const additionalEdits = suggestion.completionItem?.additionalTextEdits

0 commit comments

Comments
 (0)