Class: LanguageServer::Protocol::Interface::ClientCapabilities

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/client_capabilities.rb

Overview

Defines the capabilities provided by the client.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(workspace: nil, text_document: nil, notebook_document: nil, window: nil, general: nil, experimental: nil) ⇒ ClientCapabilities



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 8

def initialize(workspace: nil, text_document: nil, notebook_document: nil, window: nil, general: nil, experimental: nil)
  @attributes = {}

  @attributes[:workspace] = workspace if workspace
  @attributes[:textDocument] = text_document if text_document
  @attributes[:notebookDocument] = notebook_document if notebook_document
  @attributes[:window] = window if window
  @attributes[:general] = general if general
  @attributes[:experimental] = experimental if experimental

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



73
74
75
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 73

def attributes
  @attributes
end

Instance Method Details

#experimentalLSPAny | nil

Experimental client capabilities.



69
70
71
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 69

def experimental
  attributes.fetch(:experimental)
end

#generalGeneralClientCapabilities | nil

General client capabilities.

Since:

  • 3.16.0



61
62
63
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 61

def general
  attributes.fetch(:general)
end

#notebook_documentNotebookDocumentClientCapabilities | nil

Capabilities specific to the notebook document support.

Since:

  • 3.17.0



43
44
45
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 43

def notebook_document
  attributes.fetch(:notebookDocument)
end

#text_documentTextDocumentClientCapabilities | nil

Text document specific client capabilities.



33
34
35
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 33

def text_document
  attributes.fetch(:textDocument)
end

#to_hashObject



75
76
77
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 75

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



79
80
81
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 79

def to_json(*args)
  to_hash.to_json(*args)
end

#windowWindowClientCapabilities | nil

Window specific client capabilities.



51
52
53
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 51

def window
  attributes.fetch(:window)
end

#workspaceWorkspaceClientCapabilities | nil

Workspace specific client capabilities.



25
26
27
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 25

def workspace
  attributes.fetch(:workspace)
end