Class: LanguageServer::Protocol::Interface::Moniker
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::Moniker
- Defined in:
- lib/language_server/protocol/interface/moniker.rb
Overview
Moniker definition to match LSIF 0.5 moniker definition.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#identifier ⇒ string
The identifier of the moniker.
-
#initialize(scheme:, identifier:, unique:, kind: nil) ⇒ Moniker
constructor
A new instance of Moniker.
-
#kind ⇒ MonikerKind
The moniker kind if known.
-
#scheme ⇒ string
The scheme of the moniker.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#unique ⇒ UniquenessLevel
The scope in which the moniker is unique.
Constructor Details
#initialize(scheme:, identifier:, unique:, kind: nil) ⇒ Moniker
Returns a new instance of Moniker.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 8 def initialize(scheme:, identifier:, unique:, kind: nil) @attributes = {} @attributes[:scheme] = scheme @attributes[:identifier] = identifier @attributes[:unique] = unique @attributes[:kind] = kind if kind @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
52 53 54 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 52 def attributes @attributes end |
Instance Method Details
#identifier ⇒ string
The identifier of the moniker. The value is opaque in LSIF however schema owners are allowed to define the structure if they want.
32 33 34 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 32 def identifier attributes.fetch(:identifier) end |
#kind ⇒ MonikerKind
The moniker kind if known.
48 49 50 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 48 def kind attributes.fetch(:kind) end |
#scheme ⇒ string
The scheme of the moniker. For example tsc or .Net
23 24 25 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 23 def scheme attributes.fetch(:scheme) end |
#to_hash ⇒ Object
54 55 56 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 54 def to_hash attributes end |
#to_json(*args) ⇒ Object
58 59 60 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 58 def to_json(*args) to_hash.to_json(*args) end |
#unique ⇒ UniquenessLevel
The scope in which the moniker is unique
40 41 42 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 40 def unique attributes.fetch(:unique) end |