Class FormattingOptions

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

public class FormattingOptions extends JSONBase
Value-object describing what options formatting should use.
  • Method Details

    • getTabSize

      public int getTabSize()
      Size of a tab in spaces.
    • setTabSize

      public FormattingOptions setTabSize(int tabSize)
    • isInsertSpaces

      public boolean isInsertSpaces()
      Prefer spaces over tabs.
    • setInsertSpaces

      public FormattingOptions setInsertSpaces(boolean insertSpaces)
    • getTrimTrailingWhitespace

      public Boolean getTrimTrailingWhitespace()
      Trim trailing whitespaces on a line.
      Since:
      3.15.0
    • setTrimTrailingWhitespace

      public FormattingOptions setTrimTrailingWhitespace(Boolean trimTrailingWhitespace)
    • getInsertFinalNewline

      public Boolean getInsertFinalNewline()
      Insert a newline character at the end of the file if one does not exist.
      Since:
      3.15.0
    • setInsertFinalNewline

      public FormattingOptions setInsertFinalNewline(Boolean insertFinalNewline)
    • getTrimFinalNewlines

      public Boolean getTrimFinalNewlines()
      Trim all newlines after the final newline at the end of the file.
      Since:
      3.15.0
    • setTrimFinalNewlines

      public FormattingOptions setTrimFinalNewlines(Boolean trimFinalNewlines)
    • get

      public Object get(String key)
      Signature for further properties.
    • set

      public FormattingOptions set(String key, Object value)
    • equals

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

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

      public static FormattingOptions create(int tabSize, boolean insertSpaces)
      Creates a new FormattingOptions literal.