module YARD::Handlers::C::HandlerMethods
def find_method_body(object, symbol)
def find_method_body(object, symbol) file = statement.file in_file = false if statement.comments && statement.comments.source =~ /\A\s*in (\S+)\Z/ file = $1 in_file = true process_file(file, object) end src_stmt = symbols[symbol] if src_stmt register_file_info(object, src_stmt.file, src_stmt.line, true) register_source(object, src_stmt) record_parameters(object, symbol, src_stmt) unless src_stmt.comments.nil? || src_stmt.comments.source.empty? register_docstring(object, src_stmt.comments.source, src_stmt) return # found docstring end end # found source (possibly) but no docstring # so look in overrides return if override_comments.any? do |name, override_comment| next unless override_comment.file == file name = name.gsub(/::([^:\.#]+?)\Z/, '.\1') # explicit namespace in override comment path = (name =~ /\.|#/ ? object.path : object.name.to_s) if path == name || path == name.sub(/new$/, 'initialize') || path == name.sub('.', '#') register_docstring(object, override_comment.source, override_comment) true else false end end # use any comments on this statement as a last resort if !in_file && statement.comments && statement.comments.source =~ /\S/ register_docstring(object, statement.comments.source, statement) end end