Class: LSP::PublishDiagnosticsParams

Inherits:
LSPBase
  • Object
show all
Defined in:
lib/lsp/lsp_protocol.rb

Overview

export interface PublishDiagnosticsParams

/**
 * The URI for which diagnostic information is reported.
 */
uri: DocumentUri;
/**
 * Optional the version number of the document the diagnostics are published for.
 *
 * @since 3.15.0
 */
version?: number;
/**
 * An array of diagnostic information items.
 */
diagnostics: Diagnostic[];

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ PublishDiagnosticsParams

Returns a new instance of PublishDiagnosticsParams.



866
867
868
869
# File 'lib/lsp/lsp_protocol.rb', line 866

def initialize(initial_hash = nil)
  super
  @optional_method_names = %i[version]
end

Instance Attribute Details

#diagnosticsObject

type: DocumentUri # type: number # type: Diagnostic[]



864
865
866
# File 'lib/lsp/lsp_protocol.rb', line 864

def diagnostics
  @diagnostics
end

#uriObject

type: DocumentUri # type: number # type: Diagnostic[]



864
865
866
# File 'lib/lsp/lsp_protocol.rb', line 864

def uri
  @uri
end

#versionObject

type: DocumentUri # type: number # type: Diagnostic[]



864
865
866
# File 'lib/lsp/lsp_protocol.rb', line 864

def version
  @version
end

Instance Method Details

#from_h!(value) ⇒ Object



871
872
873
874
875
876
877
# File 'lib/lsp/lsp_protocol.rb', line 871

def from_h!(value)
  value = {} if value.nil?
  self.uri = value['uri'] # Unknown type
  self.version = value['version']
  self.diagnostics = value['diagnostics'].map { |val| val } unless value['diagnostics'].nil? # Unknown array type
  self
end