Class: LanguageServer::Protocol::Interface::MarkdownClientCapabilities

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

Overview

Client capabilities specific to the used markdown parser.

Since:

  • 3.16.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parser:, version: nil, allowed_tags: nil) ⇒ MarkdownClientCapabilities

Returns a new instance of MarkdownClientCapabilities.

Since:

  • 3.16.0



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

def initialize(parser:, version: nil, allowed_tags: nil)
  @attributes = {}

  @attributes[:parser] = parser
  @attributes[:version] = version if version
  @attributes[:allowedTags] = allowed_tags if allowed_tags

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Since:

  • 3.16.0



47
48
49
# File 'lib/language_server/protocol/interface/markdown_client_capabilities.rb', line 47

def attributes
  @attributes
end

Instance Method Details

#allowed_tagsstring[] | nil

A list of HTML tags that the client allows / supports in Markdown.

Returns:

  • (string[] | nil)

Since:

  • 3.17.0



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

def allowed_tags
  attributes.fetch(:allowedTags)
end

#parserstring

The name of the parser.

Returns:

  • (string)

Since:

  • 3.16.0



24
25
26
# File 'lib/language_server/protocol/interface/markdown_client_capabilities.rb', line 24

def parser
  attributes.fetch(:parser)
end

#to_hashObject

Since:

  • 3.16.0



49
50
51
# File 'lib/language_server/protocol/interface/markdown_client_capabilities.rb', line 49

def to_hash
  attributes
end

#to_json(*args) ⇒ Object

Since:

  • 3.16.0



53
54
55
# File 'lib/language_server/protocol/interface/markdown_client_capabilities.rb', line 53

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

#versionstring | nil

The version of the parser.

Returns:

  • (string | nil)

Since:

  • 3.16.0



32
33
34
# File 'lib/language_server/protocol/interface/markdown_client_capabilities.rb', line 32

def version
  attributes.fetch(:version)
end