Class: LSP::InitializeResult

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

Overview

export interface InitializeResult<T = any> {

/**
 * The capabilities the language server provides.
 */
capabilities: ServerCapabilities<T>;
/**
 * Information about the server.
 *
 * @since 3.15.0
 */
serverInfo?: {
    /**
     * The name of the server as defined by the server.
     */
    name: string;
    /**
     * The servers's version as defined by the server.
     */
    version?: string;
};
/**
 * Custom initialization results.
 */
[custom: string]: any;

}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ InitializeResult

/**

     * The name of the server as defined by the server.
     */
    name: string;
    /**
     * The servers's version as defined by the server.
     */
    version?: string;
}


271
272
273
274
# File 'lib/lsp/lsp_protocol.rb', line 271

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

Instance Attribute Details

#capabilitiesObject

type: ServerCapabilities<T> # type: {



259
260
261
# File 'lib/lsp/lsp_protocol.rb', line 259

def capabilities
  @capabilities
end

#serverInfoObject

type: ServerCapabilities<T> # type: {



259
260
261
# File 'lib/lsp/lsp_protocol.rb', line 259

def serverInfo
  @serverInfo
end

Instance Method Details

#from_h!(value) ⇒ Object



276
277
278
279
280
281
# File 'lib/lsp/lsp_protocol.rb', line 276

def from_h!(value)
  value = {} if value.nil?
  self.capabilities = value['capabilities'] # Unknown type
  self.serverInfo = value['serverInfo'] # Unknown type
  self
end