lib/ruby_indexer/lib/ruby_indexer/index.rb in ruby-lsp-0.17.17 vs lib/ruby_indexer/lib/ruby_indexer/index.rb in ruby-lsp-0.18.0
- old
+ new
@@ -310,25 +310,26 @@
if block && index % progress_step == 0
progress = (index / progress_step) + 1
break unless block.call(progress)
end
- index_single(path)
+ index_single(path, collect_comments: false)
end
end
- sig { params(indexable_path: IndexablePath, source: T.nilable(String)).void }
- def index_single(indexable_path, source = nil)
+ sig { params(indexable_path: IndexablePath, source: T.nilable(String), collect_comments: T::Boolean).void }
+ def index_single(indexable_path, source = nil, collect_comments: true)
content = source || File.read(indexable_path.full_path)
dispatcher = Prism::Dispatcher.new
result = Prism.parse(content)
listener = DeclarationListener.new(
self,
dispatcher,
result,
indexable_path.full_path,
+ collect_comments: collect_comments,
enhancements: @enhancements,
)
dispatcher.dispatch(result.value)
indexing_errors = listener.indexing_errors.uniq
@@ -605,10 +606,10 @@
singleton = Entry::SingletonClass.new(
[full_singleton_name],
attached_ancestor.file_path,
attached_ancestor.location,
attached_ancestor.name_location,
- [],
+ nil,
nil,
)
add(singleton, skip_prefix_tree: true)
end