module Solargraph::Pin::Common
Attributes
@return [Location]
Public Instance Methods
Source
# File lib/solargraph/pin/common.rb, line 44 def binder @binder || context end
@return [ComplexType]
Source
# File lib/solargraph/pin/common.rb, line 16 def closure Solargraph.assert_or_log(:closure, "Closure not set on #{self.class} #{name.inspect} from #{source.inspect}") unless @closure @closure end
@sg-ignore Solargraph::Pin::Common#closure return type could not be inferred @return [Pin::Closure, nil]
Source
# File lib/solargraph/pin/common.rb, line 49 def comments @comments ||= '' end
@return [String]
Source
# File lib/solargraph/pin/common.rb, line 32 def context # Get the static context from the nearest namespace @context ||= find_context end
@return [ComplexType]
Also aliased as: full_context
Source
# File lib/solargraph/pin/common.rb, line 22 def name @name ||= '' end
@return [String]
Source
# File lib/solargraph/pin/common.rb, line 39 def namespace context.namespace.to_s end
@return [String]
Source
# File lib/solargraph/pin/common.rb, line 54 def path @path ||= name.empty? ? context.namespace : "#{context.namespace}::#{name}" end
@return [String]
Source
# File lib/solargraph/pin/common.rb, line 27 def return_type @return_type ||= ComplexType::UNDEFINED end
@return [ComplexType]
Private Instance Methods
Source
# File lib/solargraph/pin/common.rb, line 65 def find_context here = closure until here.nil? if here.is_a?(Pin::Namespace) return here.return_type elsif here.is_a?(Pin::Method) return here.context end here = here.closure end ComplexType::ROOT end
@return [ComplexType]