Class: Solargraph::Pin::Constant
- Inherits:
-
BaseVariable
- Object
- Base
- BaseVariable
- Solargraph::Pin::Constant
- Defined in:
- lib/solargraph/pin/constant.rb
Constant Summary
Constants included from Logging
Logging::DEFAULT_LOG_LEVEL, Logging::LOG_LEVELS
Instance Attribute Summary collapse
-
#visibility ⇒ Object
readonly
Returns the value of attribute visibility.
Attributes inherited from BaseVariable
Attributes inherited from Base
#code_object, #combine_priority, #directives, #docstring, #location, #name, #source, #type_location
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
#==, #combine_with, #nil_assignment?, #probe, #return_types_from_node, #type_desc, #variable?
Methods inherited from Base
#==, #all_location_text, #all_rooted?, #assert_location_provided, #assert_same, #assert_same_array_content, #assert_same_count, #assert_same_macros, #assert_source_provided, #best_location, #choose, #choose_longer, #choose_node, #choose_pin_attr, #choose_pin_attr_with_same_name, #choose_priority, #closure, #combine_directives, #combine_name, #combine_return_type, #combine_with, #comments, #deprecated?, #desc, #dodgy_return_type_source?, #erase_generics, #filename, #identity, #infer, #inner_desc, #inspect, #macros, #maybe_directives?, #nearly?, #needs_consistent_name?, #prefer_rbs_location, #presence_certain?, #probe, #probed?, #proxied?, #proxy, #rbs_location?, #realize, #reset_generated!, #resolve_generics, #resolve_generics_from_context, #to_rbs, #to_s, #transform_types, #type_desc, #typify, #variable?
Methods included from Logging
Methods included from Documenting
#documentation, normalize_indentation, strip_html_comments
Methods included from Conversions
#completion_item, #deprecated?, #detail, #link_documentation, #probed?, #proxied?, #reset_conversions, #resolve_completion_item, #signature_help, #text_documentation
Methods included from Common
#binder, #closure, #comments, #name, #namespace, #source
Constructor Details
#initialize(visibility: :public, **splat) ⇒ Constant
Returns a new instance of Constant.
10 11 12 13 |
# File 'lib/solargraph/pin/constant.rb', line 10 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
19 20 21 |
# File 'lib/solargraph/pin/constant.rb', line 19 def completion_item_kind Solargraph::LanguageServer::CompletionItemKinds::CONSTANT end |
#path ⇒ Object
28 29 30 |
# File 'lib/solargraph/pin/constant.rb', line 28 def path @path ||= context.namespace.to_s.empty? ? name : "#{context.namespace}::#{name}" end |
#return_type ⇒ Object
15 16 17 |
# File 'lib/solargraph/pin/constant.rb', line 15 def return_type @return_type ||= generate_complex_type end |
#symbol_kind ⇒ Integer
24 25 26 |
# File 'lib/solargraph/pin/constant.rb', line 24 def symbol_kind LanguageServer::SymbolKinds::CONSTANT end |