From 43bde36ef9bf30c2700a52fd8de80825ef720cb0 Mon Sep 17 00:00:00 2001 From: dezza <402927+dezza@users.noreply.github.com> Date: Sat, 21 May 2022 04:02:53 +0200 Subject: [PATCH] Fix query_symbols changed to exact match I could not find anything about the lsp spec suggesting to use fuzzy matching for this function. Currently it breaks jumping to function in vim with `:tag` which is mapped to `workspace/symbol` in solargraph-lsp since all substring matches are also considered. This is how it works in `gopls` as well. Issues that could be related #292 --- lib/solargraph/source_map.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/solargraph/source_map.rb b/lib/solargraph/source_map.rb index ad5162837..a3930e15d 100644 --- a/lib/solargraph/source_map.rb +++ b/lib/solargraph/source_map.rb @@ -77,7 +77,8 @@ def document_symbols # @return [Array] def query_symbols query return document_symbols if query && query.empty? - document_symbols.select{ |pin| fuzzy_string_match(pin.path, query) || fuzzy_string_match(pin.name, query) } + document_symbols.select{ |pin| pin.name == query } + #document_symbols.select{ |pin| fuzzy_string_match(pin.path, query) || fuzzy_string_match(pin.name, query) } end # @param position [Position]