Class TextEdit

java.lang.Object
org.graalvm.tools.lsp.server.types.JSONBase
org.graalvm.tools.lsp.server.types.TextEdit

public class TextEdit extends JSONBase
A text edit applicable to a text document.
  • Method Details

    • getRange

      public Range getRange()
      The range of the text document to be manipulated. To insert text into a document create a range where start === end.
    • setRange

      public TextEdit setRange(Range range)
    • getNewText

      public String getNewText()
      The string to be inserted. For delete operations use an empty string.
    • setNewText

      public TextEdit setNewText(String newText)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • replace

      public static TextEdit replace(Range range, String newText)
      Creates a replace text edit.
      Parameters:
      range - The range of text to be replaced.
      newText - The new text.
    • insert

      public static TextEdit insert(Position position, String newText)
      Creates a insert text edit.
      Parameters:
      position - The position to insert the text at.
      newText - The text to be inserted.
    • del

      public static TextEdit del(Range range)
      Creates a delete text edit.
      Parameters:
      range - The range of text to be deleted.