Class WorkspaceEdit
- java.lang.Object
-
- org.eclipse.lsp4j.WorkspaceEdit
-
public class WorkspaceEdit extends java.lang.Object
A workspace edit represents changes to many resources managed in the workspace. The edit should either providechanges
ordocumentChanges
. If documentChanges are present they are preferred over changes if the client can handle versioned document edits.
-
-
Constructor Summary
Constructors Constructor Description WorkspaceEdit()
WorkspaceEdit(java.util.List<org.eclipse.lsp4j.jsonrpc.messages.Either<TextDocumentEdit,ResourceOperation>> documentChanges)
WorkspaceEdit(java.util.Map<java.lang.String,java.util.List<TextEdit>> changes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.util.Map<java.lang.String,ChangeAnnotation>
getChangeAnnotations()
A map of change annotations that can be referenced inAnnotatedTextEdit
s orResourceOperation
s.java.util.Map<java.lang.String,java.util.List<TextEdit>>
getChanges()
Holds changes to existing resources.java.util.List<org.eclipse.lsp4j.jsonrpc.messages.Either<TextDocumentEdit,ResourceOperation>>
getDocumentChanges()
Depending on the client capabilityWorkspaceEditCapabilities.resourceOperations
document changes are either an array ofTextDocumentEdit
s to express changes to n different text documents where each text document edit addresses a specific version of a text document.int
hashCode()
void
setChangeAnnotations(java.util.Map<java.lang.String,ChangeAnnotation> changeAnnotations)
A map of change annotations that can be referenced inAnnotatedTextEdit
s orResourceOperation
s.void
setChanges(java.util.Map<java.lang.String,java.util.List<TextEdit>> changes)
Holds changes to existing resources.void
setDocumentChanges(java.util.List<org.eclipse.lsp4j.jsonrpc.messages.Either<TextDocumentEdit,ResourceOperation>> documentChanges)
Depending on the client capabilityWorkspaceEditCapabilities.resourceOperations
document changes are either an array ofTextDocumentEdit
s to express changes to n different text documents where each text document edit addresses a specific version of a text document.java.lang.String
toString()
-
-
-
Constructor Detail
-
WorkspaceEdit
public WorkspaceEdit()
-
WorkspaceEdit
public WorkspaceEdit(java.util.Map<java.lang.String,java.util.List<TextEdit>> changes)
-
WorkspaceEdit
public WorkspaceEdit(java.util.List<org.eclipse.lsp4j.jsonrpc.messages.Either<TextDocumentEdit,ResourceOperation>> documentChanges)
-
-
Method Detail
-
getChanges
public java.util.Map<java.lang.String,java.util.List<TextEdit>> getChanges()
Holds changes to existing resources.
-
setChanges
public void setChanges(java.util.Map<java.lang.String,java.util.List<TextEdit>> changes)
Holds changes to existing resources.
-
getDocumentChanges
public java.util.List<org.eclipse.lsp4j.jsonrpc.messages.Either<TextDocumentEdit,ResourceOperation>> getDocumentChanges()
Depending on the client capabilityWorkspaceEditCapabilities.resourceOperations
document changes are either an array ofTextDocumentEdit
s to express changes to n different text documents where each text document edit addresses a specific version of a text document. Or it can contain aboveTextDocumentEdit
s mixed with create, rename and delete file / folder operations.Whether a client supports versioned document edits is expressed via
WorkspaceEditCapabilities.documentChanges
client capability.If a client neither supports
WorkspaceEditCapabilities.documentChanges
norWorkspaceEditCapabilities.resourceOperations
then only plainTextEdit
s using thechanges
property are supported.
-
setDocumentChanges
public void setDocumentChanges(java.util.List<org.eclipse.lsp4j.jsonrpc.messages.Either<TextDocumentEdit,ResourceOperation>> documentChanges)
Depending on the client capabilityWorkspaceEditCapabilities.resourceOperations
document changes are either an array ofTextDocumentEdit
s to express changes to n different text documents where each text document edit addresses a specific version of a text document. Or it can contain aboveTextDocumentEdit
s mixed with create, rename and delete file / folder operations.Whether a client supports versioned document edits is expressed via
WorkspaceEditCapabilities.documentChanges
client capability.If a client neither supports
WorkspaceEditCapabilities.documentChanges
norWorkspaceEditCapabilities.resourceOperations
then only plainTextEdit
s using thechanges
property are supported.
-
getChangeAnnotations
public java.util.Map<java.lang.String,ChangeAnnotation> getChangeAnnotations()
A map of change annotations that can be referenced inAnnotatedTextEdit
s orResourceOperation
s.Client support depends on
WorkspaceEditCapabilities.changeAnnotationSupport
.Since 3.16.0
-
setChangeAnnotations
public void setChangeAnnotations(java.util.Map<java.lang.String,ChangeAnnotation> changeAnnotations)
A map of change annotations that can be referenced inAnnotatedTextEdit
s orResourceOperation
s.Client support depends on
WorkspaceEditCapabilities.changeAnnotationSupport
.Since 3.16.0
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-