Class: LSP::FormattingOptions
Overview
export interface FormattingOptions
/**
* Size of a tab in spaces.
*/
tabSize: number;
/**
* Prefer spaces over tabs.
*/
insertSpaces: boolean;
/**
* Trim trailing whitespaces on a line.
*
* @since 3.15.0
*/
trimTrailingWhitespace?: boolean;
/**
* Insert a newline character at the end of the file if one does not exist.
*
* @since 3.15.0
*/
insertFinalNewline?: boolean;
/**
* Trim all newlines after the final newline at the end of the file.
*
* @since 3.15.0
*/
trimFinalNewlines?: boolean;
/**
* Signature for further properties.
*/
[key: string]: boolean | number | string | undefined;
Instance Attribute Summary collapse
-
#insertFinalNewline ⇒ Object
type: number # type: boolean # type: boolean # type: boolean # type: boolean.
-
#insertSpaces ⇒ Object
type: number # type: boolean # type: boolean # type: boolean # type: boolean.
-
#tabSize ⇒ Object
type: number # type: boolean # type: boolean # type: boolean # type: boolean.
-
#trimFinalNewlines ⇒ Object
type: number # type: boolean # type: boolean # type: boolean # type: boolean.
-
#trimTrailingWhitespace ⇒ Object
type: number # type: boolean # type: boolean # type: boolean # type: boolean.
Instance Method Summary collapse
- #from_h!(value) ⇒ Object
-
#initialize(initial_hash = nil) ⇒ FormattingOptions
constructor
A new instance of FormattingOptions.
Methods inherited from LSPBase
Constructor Details
#initialize(initial_hash = nil) ⇒ FormattingOptions
Returns a new instance of FormattingOptions.
1335 1336 1337 1338 |
# File 'lib/lsp/lsp_types.rb', line 1335 def initialize(initial_hash = nil) super @optional_method_names = %i[trimTrailingWhitespace insertFinalNewline trimFinalNewlines] end |
Instance Attribute Details
#insertFinalNewline ⇒ Object
type: number # type: boolean # type: boolean # type: boolean # type: boolean
1333 1334 1335 |
# File 'lib/lsp/lsp_types.rb', line 1333 def insertFinalNewline @insertFinalNewline end |
#insertSpaces ⇒ Object
type: number # type: boolean # type: boolean # type: boolean # type: boolean
1333 1334 1335 |
# File 'lib/lsp/lsp_types.rb', line 1333 def insertSpaces @insertSpaces end |
#tabSize ⇒ Object
type: number # type: boolean # type: boolean # type: boolean # type: boolean
1333 1334 1335 |
# File 'lib/lsp/lsp_types.rb', line 1333 def tabSize @tabSize end |
#trimFinalNewlines ⇒ Object
type: number # type: boolean # type: boolean # type: boolean # type: boolean
1333 1334 1335 |
# File 'lib/lsp/lsp_types.rb', line 1333 def trimFinalNewlines @trimFinalNewlines end |
#trimTrailingWhitespace ⇒ Object
type: number # type: boolean # type: boolean # type: boolean # type: boolean
1333 1334 1335 |
# File 'lib/lsp/lsp_types.rb', line 1333 def trimTrailingWhitespace @trimTrailingWhitespace end |
Instance Method Details
#from_h!(value) ⇒ Object
1340 1341 1342 1343 1344 1345 1346 1347 1348 |
# File 'lib/lsp/lsp_types.rb', line 1340 def from_h!(value) value = {} if value.nil? self.tabSize = value['tabSize'] self.insertSpaces = value['insertSpaces'] # Unknown type self.trimTrailingWhitespace = value['trimTrailingWhitespace'] # Unknown type self.insertFinalNewline = value['insertFinalNewline'] # Unknown type self.trimFinalNewlines = value['trimFinalNewlines'] # Unknown type self end |