Class: Solargraph::Pin::Constant

Inherits:
BaseVariable show all
Defined in:
lib/solargraph/pin/constant.rb

Direct Known Subclasses

YardPin::Constant

Instance Attribute Summary collapse

Attributes inherited from BaseVariable

#assignment, #context

Attributes inherited from Base

#location, #name, #namespace

Instance Method Summary collapse

Methods inherited from BaseVariable

#==, #infer, #nil_assignment?, #return_complex_type, #signature, #try_merge!, #variable?

Methods included from Source::NodeMethods

const_from, drill_signature, get_node_end_position, get_node_start_position, infer_literal_node_type, pack_name, resolve_node_signature, unpack_name

Methods inherited from Base

#==, #comments, #context, #deprecated?, #directives, #docstring, #filename, #infer, #macros, #maybe_directives?, #nearly?, #return_complex_type, #return_type, #to_s, #try_merge!, #variable?

Methods included from Documenting

#documentation, #helper

Methods included from Conversions

#completion_item, #detail, #link_documentation, #reset_conversions, #resolve_completion_item, #signature_help

Constructor Details

#initialize(location, namespace, name, comments, assignment, literal, context, visibility) ⇒ Constant

Returns a new instance of Constant.



6
7
8
9
# File 'lib/solargraph/pin/constant.rb', line 6

def initialize location, namespace, name, comments, assignment, literal, context, visibility
  super(location, namespace, name, comments, assignment, literal, context)
  @visibility = visibility
end

Instance Attribute Details

#visibilityObject (readonly)

Returns the value of attribute visibility.



4
5
6
# File 'lib/solargraph/pin/constant.rb', line 4

def visibility
  @visibility
end

Instance Method Details

#completion_item_kindObject



15
16
17
# File 'lib/solargraph/pin/constant.rb', line 15

def completion_item_kind
  Solargraph::LanguageServer::CompletionItemKinds::CONSTANT
end

#kindObject



11
12
13
# File 'lib/solargraph/pin/constant.rb', line 11

def kind
  Pin::CONSTANT
end

#pathObject



24
25
26
# File 'lib/solargraph/pin/constant.rb', line 24

def path
  "#{namespace}::#{name}"
end

#symbol_kindInteger

Returns:

  • (Integer)


20
21
22
# File 'lib/solargraph/pin/constant.rb', line 20

def symbol_kind
  LanguageServer::SymbolKinds::CONSTANT
end