Class WorkspaceEdit


  • public class WorkspaceEdit
    extends java.lang.Object
    A workspace edit represents changes to many resources managed in the workspace. The edit should either provide changes or documentChanges. If documentChanges are present they are preferred over changes if the client can handle versioned document edits.
    • Constructor Detail

      • WorkspaceEdit

        public WorkspaceEdit()
      • WorkspaceEdit

        public WorkspaceEdit​(java.util.Map<java.lang.String,​java.util.List<TextEdit>> changes)
    • 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 capability WorkspaceEditCapabilities.resourceOperations document changes are either an array of TextDocumentEdits 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 above TextDocumentEdits 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 nor WorkspaceEditCapabilities.resourceOperations then only plain TextEdits using the changes property are supported.

      • setDocumentChanges

        public void setDocumentChanges​(java.util.List<org.eclipse.lsp4j.jsonrpc.messages.Either<TextDocumentEdit,​ResourceOperation>> documentChanges)
        Depending on the client capability WorkspaceEditCapabilities.resourceOperations document changes are either an array of TextDocumentEdits 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 above TextDocumentEdits 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 nor WorkspaceEditCapabilities.resourceOperations then only plain TextEdits using the changes property are supported.

      • getChangeAnnotations

        public java.util.Map<java.lang.String,​ChangeAnnotation> getChangeAnnotations()
        A map of change annotations that can be referenced in AnnotatedTextEdits or ResourceOperations.

        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 in AnnotatedTextEdits or ResourceOperations.

        Client support depends on WorkspaceEditCapabilities.changeAnnotationSupport.

        Since 3.16.0

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object