From 7d137b451bf05e91c315d1b81c1f8668ff1ebb73 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Mon, 18 Dec 2023 17:31:16 +0000 Subject: [PATCH] Update check_docs task Now that some requests don't even have parent classes, we can only use the class name to check if it's a request or not. --- lib/ruby_lsp/check_docs.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ruby_lsp/check_docs.rb b/lib/ruby_lsp/check_docs.rb index 07c1f9955..4b75af4dc 100644 --- a/lib/ruby_lsp/check_docs.rb +++ b/lib/ruby_lsp/check_docs.rb @@ -53,13 +53,16 @@ def run_task # documented features = ObjectSpace.each_object(Class).filter_map do |k| klass = T.unsafe(k) - klass if klass < Requests::BaseRequest || (klass < Listener && klass != ExtensibleListener) + klass_name = klass.name + next unless klass_name + + klass if klass_name.match?(/RubyLsp::Requests::\w[^:]+$/) && !klass_name.include?("Support") end missing_docs = T.let(Hash.new { |h, k| h[k] = [] }, T::Hash[String, T::Array[String]]) features.each do |klass| - class_name = T.must(klass.name) + class_name = klass.name file_path, line_number = Module.const_source_location(class_name) next unless file_path && line_number