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

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

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

Returns a new instance of ClientCapabilities.



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 5

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.



66
67
68
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 66

def attributes
  @attributes
end

Instance Method Details

#experimentalLSPAny

Experimental client capabilities.

Returns:

  • (LSPAny)


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

def experimental
  attributes.fetch(:experimental)
end

#general{ staleRequestSupport?: { cancel: boolean; retryOnContentModified: string[]; }; regularExpressions?: RegularExpressionsClientCapabilities; markdown?: any; positionEncodings?: string[]; }

General client capabilities.

Returns:

  • ({ staleRequestSupport?: { cancel: boolean; retryOnContentModified: string[]; }; regularExpressions?: RegularExpressionsClientCapabilities; markdown?: any; positionEncodings?: string[]; })


54
55
56
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 54

def general
  attributes.fetch(:general)
end

#notebook_documentNotebookDocumentClientCapabilities

Capabilities specific to the notebook document support.



38
39
40
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 38

def notebook_document
  attributes.fetch(:notebookDocument)
end

#text_documentTextDocumentClientCapabilities

Text document specific client capabilities.



30
31
32
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 30

def text_document
  attributes.fetch(:textDocument)
end

#to_hashObject



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



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

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

#window{ workDoneProgress?: boolean; showMessage?: ShowMessageRequestClientCapabilities; showDocument?: ShowDocumentClientCapabilities; }

Window specific client capabilities.

Returns:



46
47
48
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 46

def window
  attributes.fetch(:window)
end

#workspace{ applyEdit?: boolean; workspaceEdit?: WorkspaceEditClientCapabilities; didChangeConfiguration?: DidChangeConfigurationClientCapabilities; ... 10 more ...; diagnostics?: DiagnosticWorkspaceClientCapabilities; }

Workspace specific client capabilities.

Returns:



22
23
24
# File 'lib/language_server/protocol/interface/client_capabilities.rb', line 22

def workspace
  attributes.fetch(:workspace)
end