module Solargraph::YardMap::ToMethod::InnerMethods

def get_parameters code_object, location, comments

Returns:
  • (Array) -

Parameters:
  • comments (String) --
  • location (Solargraph::Location) --
  • code_object (YARD::CodeObjects::Base) --
def get_parameters code_object, location, comments
  return [] unless code_object.is_a?(YARD::CodeObjects::MethodObject)
  # HACK: Skip `nil` and `self` parameters that are sometimes emitted

  # for methods defined in C

  # See https://github.com/castwide/solargraph/issues/345

  code_object.parameters.select { |a| a[0] && a[0] != 'self' }.map do |a|
    Solargraph::Pin::Parameter.new(
      location: location,
      closure: self,
      comments: comments,
      name: arg_name(a),
      presence: nil,
      decl: arg_type(a),
      asgn_code: a[1]
    )
  end
end