class Solargraph::SourceMap::Clip

def package_completions result

Returns:
  • (Completion) -

Parameters:
  • result (Array) --
def package_completions result
  frag_start = cursor.start_of_word.to_s.downcase
  filtered = result.uniq(&:name).select { |s|
    s.name.downcase.start_with?(frag_start) &&
      (!s.is_a?(Pin::Method) || s.name.match(/^[a-z0-9_]+(\!|\?|=)?$/i))
  }
  Completion.new(filtered, cursor.range)
end