public class WorkspaceEdit extends Object
Constructor and Description |
---|
WorkspaceEdit(List<Union2<TextDocumentEdit,ResourceOperation>> documentChanges)
Construct a new
WorkspaceEdit . |
Modifier and Type | Method and Description |
---|---|
static CompletableFuture<List<String>> |
applyEdits(List<WorkspaceEdit> edits,
boolean save)
Attempts to apply workspace edits to the resources.
|
List<Union2<TextDocumentEdit,ResourceOperation>> |
getDocumentChanges()
The changes to documents in the workspace that need to be performed.
|
public WorkspaceEdit(List<Union2<TextDocumentEdit,ResourceOperation>> documentChanges)
WorkspaceEdit
.documentChanges
- the changes to documents in the workspace that need to be performed.public List<Union2<TextDocumentEdit,ResourceOperation>> getDocumentChanges()
public static CompletableFuture<List<String>> applyEdits(List<WorkspaceEdit> edits, boolean save)
WorkspaceEdit
with TextDocumentEdit
s that have empty set of changes.
The implementation must apply edits so they result in the same result as if the contents
of the WorkspaceEdit are applied in the order.
Upon failure, the returned Future completes with ResourceModificationException
.
Completed WorkspaceEdits, the failed one and the index of a failed operation within it should be reported.
If any resource was saved before the failure, it should be reported as saved.edits
- edits to apply.save
- if true, resources are saved after they are modified.ResourceModificationException
.