Class: LanguageServer::Protocol::Interface::Moniker

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

Overview

Moniker definition to match LSIF 0.5 moniker definition.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject (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

#identifierstring

The identifier of the moniker. The value is opaque in LSIF however schema owners are allowed to define the structure if they want.

Returns:

  • (string)


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

def identifier
  attributes.fetch(:identifier)
end

#kindMonikerKind

The moniker kind if known.

Returns:

  • (MonikerKind)


48
49
50
# File 'lib/language_server/protocol/interface/moniker.rb', line 48

def kind
  attributes.fetch(:kind)
end

#schemestring

The scheme of the moniker. For example tsc or .Net

Returns:

  • (string)


23
24
25
# File 'lib/language_server/protocol/interface/moniker.rb', line 23

def scheme
  attributes.fetch(:scheme)
end

#to_hashObject



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

#uniqueUniquenessLevel

The scope in which the moniker is unique

Returns:

  • (UniquenessLevel)


40
41
42
# File 'lib/language_server/protocol/interface/moniker.rb', line 40

def unique
  attributes.fetch(:unique)
end