Class CompletionItem

java.lang.Object
com.oracle.truffle.tools.dap.types.JSONBase
com.oracle.truffle.tools.dap.types.CompletionItem

public class CompletionItem extends JSONBase
CompletionItems are the suggestions returned from the CompletionsRequest.
  • Method Details

    • getLabel

      public String getLabel()
      The label of this completion item. By default this is also the text that is inserted when selecting this completion.
    • setLabel

      public CompletionItem setLabel(String label)
    • getText

      public String getText()
      If text is not falsy then it is inserted instead of the label.
    • setText

      public CompletionItem setText(String text)
    • getSortText

      public String getSortText()
      A string that should be used when comparing this item with other items. When `falsy` the label is used.
    • setSortText

      public CompletionItem setSortText(String sortText)
    • getType

      public String getType()
      The item's type. Typically the client uses this information to render the item in the UI with an icon.
    • setType

      public CompletionItem setType(String type)
    • getStart

      public Integer getStart()
      This value determines the location (in the CompletionsRequest's 'text' attribute) where the completion text is added. If missing the text is added at the location specified by the CompletionsRequest's 'column' attribute.
    • setStart

      public CompletionItem setStart(Integer start)
    • getLength

      public Integer getLength()
      This value determines how many characters are overwritten by the completion text. If missing the value 0 is assumed which results in the completion text being inserted.
    • setLength

      public CompletionItem setLength(Integer length)
    • getSelectionStart

      public Integer getSelectionStart()
      Determines the start of the new selection after the text has been inserted (or replaced). The start position must in the range 0 and length of the completion text. If omitted the selection starts at the end of the completion text.
    • setSelectionStart

      public CompletionItem setSelectionStart(Integer selectionStart)
    • getSelectionLength

      public Integer getSelectionLength()
      Determines the length of the new selection after the text has been inserted (or replaced). The selection can not extend beyond the bounds of the completion text. If omitted the length is assumed to be 0.
    • setSelectionLength

      public CompletionItem setSelectionLength(Integer selectionLength)
    • equals

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

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

      public static CompletionItem create(String label)