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
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 | nil
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.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 10 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)
54 55 56 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 54 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.
34 35 36 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 34 def identifier attributes.fetch(:identifier) end |
#kind ⇒ MonikerKind | nil
The moniker kind if known.
50 51 52 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 50 def kind attributes.fetch(:kind) end |
#scheme ⇒ string
The scheme of the moniker. For example tsc or .Net
25 26 27 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 25 def scheme attributes.fetch(:scheme) end |
#to_hash ⇒ Object
56 57 58 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 56 def to_hash attributes end |
#to_json(*args) ⇒ Object
60 61 62 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 60 def to_json(*args) to_hash.to_json(*args) end |
#unique ⇒ UniquenessLevel
The scope in which the moniker is unique
42 43 44 |
# File 'lib/language_server/protocol/interface/moniker.rb', line 42 def unique attributes.fetch(:unique) end |