module analysis::diff::edits::AnnotatedTextEdits
Usage
import analysis::diff::edits::AnnotatedTextEdits;
Dependencies
extend analysis::diff::edits::TextEdits;
data TextEdit
A ((analysis::diff::edits::TextEdits::TextEdit)) with additional context for LSP.
data TextEdit (str label = "", str description = label, bool needsConfirmation = false)
In LSP, text edits can contain extra information w.r.t. TextEdit.
- label: Human-readable string that describes the change.
- description: Human-readable string that additionally describes the change, rendered less prominently.
- needsConfirmation: Flags whether the user should confirm this change. By default, this is false, which means that TextEdits are applied without user confirmation.
Typically, clients provide options to group edits by label/description when showing them to the user. See the LSP documentation for more details.
Note: to easily annotate all text edits in a FileSystemChange, use the convenience keywords on FileSystemChange.
Pitfalls
When needsConfirmation = false for all edits, the client will typically apply them without showing any information from the annotations to the user.
data FileSystemChange
A ((analysis::diff::edits::TextEdits::FileSystemChange)) with additional context for LSP.
data FileSystemChange (str label = "", str description = "", bool needsConfirmation = false)
Provides extra context for all contained TextEdits at once.
function changed
Shorthand for file changes, with additional context for LSP.
FileSystemChange changed(list[TextEdit] edits:[replace(loc l, str _), *_], str label = "", str description = "", bool needsConfirmation = false)
Provides extra context for all contained TextEdits at once.