diff --git a/lib/solargraph/parser/rubyvm/class_methods.rb b/lib/solargraph/parser/rubyvm/class_methods.rb index a208f4e8e..2533eb79e 100644 --- a/lib/solargraph/parser/rubyvm/class_methods.rb +++ b/lib/solargraph/parser/rubyvm/class_methods.rb @@ -108,9 +108,13 @@ def is_ast_node? node end def node_range node + if node.nil? + nil + else st = Position.new(node.first_lineno - 1, node.first_column) en = Position.new(node.last_lineno - 1, node.last_column) Range.new(st, en) + end end def recipient_node tree diff --git a/lib/solargraph/pin/search.rb b/lib/solargraph/pin/search.rb index 5564fac7c..da1de116d 100644 --- a/lib/solargraph/pin/search.rb +++ b/lib/solargraph/pin/search.rb @@ -49,7 +49,7 @@ def do_query # @return [Float] def fuzzy_string_match str1, str2 return (1.0 + (str2.length.to_f / str1.length.to_f)) if str1.downcase.include?(str2.downcase) - JaroWinkler.distance(str1, str2, ignore_case: true) + JaroWinkler.similarity(str1, str2, ignore_case: true) end end end diff --git a/solargraph.gemspec b/solargraph.gemspec index 7be8dcb73..31a80b4c9 100755 --- a/solargraph.gemspec +++ b/solargraph.gemspec @@ -29,8 +29,11 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'diff-lcs', '~> 1.4' s.add_runtime_dependency 'e2mmap' s.add_runtime_dependency 'jaro_winkler', '~> 1.5' + s.add_runtime_dependency 'logger', '~> 1.6' s.add_runtime_dependency 'kramdown', '~> 2.3' s.add_runtime_dependency 'kramdown-parser-gfm', '~> 1.1' + s.add_runtime_dependency 'observer', '~> 0.1' + s.add_runtime_dependency 'ostruct', '~> 0.6' s.add_runtime_dependency 'parser', '~> 3.0' s.add_runtime_dependency 'rbs', '~> 2.0' s.add_runtime_dependency 'reverse_markdown', '~> 2.0' @@ -41,6 +44,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'pry' s.add_development_dependency 'public_suffix', '~> 3.1' + s.add_development_dependency 'rake', '~> 13.2' s.add_development_dependency 'rspec', '~> 3.5' s.add_development_dependency 'simplecov', '~> 0.14' s.add_development_dependency 'webmock', '~> 3.6'