completion_list (FastRI::RiService)

    # File lib/fastri/ri_service.rb, line 141
      def completion_list(keyw)
        return @ri_reader.full_class_names if keyw == ""

        descriptor = NameDescriptor.new(keyw)

        if descriptor.class_names.empty?
          # try partial matches
          meths = @ri_reader.methods_under_matching("", /(#|\.)#{descriptor.method_name}/, true)
          ret = meths.map{|x| x.name}.uniq.sort
          return ret.empty? ? nil : ret
        end

        # if we're here, some namespace was given
        full_ns_name = descriptor.class_names.join("::")
        if descriptor.method_name == nil && ! [?#, ?:, ?.].include?(keyw[-1])
          # partial match
          namespaces = @ri_reader.namespaces_under_matching("", /^#{full_ns_name}/, false)
          ret = namespaces.map{|x| x.full_name}.uniq.sort
          return ret.empty? ? nil : ret
        else
          if [?#, ?:, ?.].include?(keyw[-1])
            seps = case keyw[-1]
              when ?#; %w[#]
              when ?:; %w[.]
              when ?.; %w[. #]
            end
          else  # both namespace and method
            seps = separators(descriptor.is_class_method)
          end
          sep_re = "(" + seps.map{|x| Regexp.escape(x)}.join("|") + ")"
          # partial
          methods = @ri_reader.methods_under_matching(full_ns_name, /#{sep_re}#{descriptor.method_name}/, false)
          ret = methods.map{|x| x.full_name}.uniq.sort
          return ret.empty? ? nil : ret
        end
      rescue RiError
        return nil
      end