Class CodeActionContext

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

public class CodeActionContext extends JSONBase
Contains additional diagnostic information about the context in which a [code action](#CodeActionProvider.provideCodeActions) is run.
  • Method Details

    • getDiagnostics

      public List<Diagnostic> getDiagnostics()
      An array of diagnostics known on the client side overlapping the range provided to the `textDocument/codeAction` request. They are provied so that the server knows which errors are currently presented to the user for the given range. There is no guarantee that these accurately reflect the error state of the resource. The primary parameter to compute code actions is the provided range.
    • setDiagnostics

      public CodeActionContext setDiagnostics(List<Diagnostic> diagnostics)
    • getOnly

      public List<CodeActionKind> getOnly()
      Requested kind of actions to return. Actions not of this kind are filtered out by the client before being shown. So servers can omit computing them.
    • setOnly

      public CodeActionContext setOnly(List<CodeActionKind> only)
    • equals

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

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

      public static CodeActionContext create(List<Diagnostic> diagnostics, List<CodeActionKind> only)
      Creates a new CodeActionContext literal.