lib/ruby_lsp/requests/workspace_symbol.rb in ruby-lsp-0.13.2 vs lib/ruby_lsp/requests/workspace_symbol.rb in ruby-lsp-0.13.3

- old
+ new

@@ -16,26 +16,27 @@ # class # class Foo # end # ``` # - class WorkspaceSymbol + class WorkspaceSymbol < Request extend T::Sig include Support::Common sig { params(query: T.nilable(String), index: RubyIndexer::Index).void } def initialize(query, index) + super() @query = query @index = index end - sig { returns(T::Array[Interface::WorkspaceSymbol]) } - def run + sig { override.returns(T::Array[Interface::WorkspaceSymbol]) } + def perform @index.fuzzy_search(@query).filter_map do |entry| # If the project is using Sorbet, we let Sorbet handle symbols defined inside the project itself and RBIs, but # we still return entries defined in gems to allow developers to jump directly to the source file_path = entry.file_path - next if defined_in_gem?(file_path) + next if DependencyDetector.instance.typechecker && not_in_dependencies?(file_path) # We should never show private symbols when searching the entire workspace next if entry.visibility == :private kind = kind_for_entry(entry)