Class: Solargraph::Pin::Constant
- Inherits:
-
BaseVariable
- Object
- Base
- BaseVariable
- Solargraph::Pin::Constant
- Defined in:
- lib/solargraph/pin/constant.rb
Instance Attribute Summary collapse
-
#visibility ⇒ Object
readonly
Returns the value of attribute visibility.
Attributes inherited from BaseVariable
Attributes inherited from Base
#code_object, #location, #name, #source
Attributes included from Common
Instance Method Summary collapse
- #completion_item_kind ⇒ Object
-
#initialize(visibility: :public, **splat) ⇒ Constant
constructor
A new instance of Constant.
- #path ⇒ Object
- #return_type ⇒ Object
- #symbol_kind ⇒ Integer
Methods inherited from BaseVariable
#==, #nil_assignment?, #probe, #try_merge!, #variable?
Methods inherited from Base
#==, #comments, #deprecated?, #directives, #docstring, #filename, #identity, #infer, #inspect, #macros, #maybe_directives?, #nearly?, #probe, #probed?, #proxied?, #proxy, #realize, #to_s, #try_merge!, #typify, #variable?
Methods included from Documenting
Methods included from Conversions
#completion_item, #detail, #link_documentation, #reset_conversions, #resolve_completion_item, #signature_help, #text_documentation
Methods included from Common
#binder, #comments, #context, #name, #namespace
Constructor Details
#initialize(visibility: :public, **splat) ⇒ Constant
Returns a new instance of Constant.
8 9 10 11 |
# File 'lib/solargraph/pin/constant.rb', line 8 def initialize visibility: :public, **splat super(**splat) @visibility = visibility end |
Instance Attribute Details
#visibility ⇒ Object (readonly)
Returns the value of attribute visibility.
6 7 8 |
# File 'lib/solargraph/pin/constant.rb', line 6 def visibility @visibility end |
Instance Method Details
#completion_item_kind ⇒ Object
17 18 19 |
# File 'lib/solargraph/pin/constant.rb', line 17 def completion_item_kind Solargraph::LanguageServer::CompletionItemKinds::CONSTANT end |
#path ⇒ Object
26 27 28 |
# File 'lib/solargraph/pin/constant.rb', line 26 def path @path ||= context.namespace.to_s.empty? ? name : "#{context.namespace}::#{name}" end |
#return_type ⇒ Object
13 14 15 |
# File 'lib/solargraph/pin/constant.rb', line 13 def return_type @return_type ||= generate_complex_type end |
#symbol_kind ⇒ Integer
22 23 24 |
# File 'lib/solargraph/pin/constant.rb', line 22 def symbol_kind LanguageServer::SymbolKinds::CONSTANT end |