Skip to content

Commit

Permalink
Update check_docs task
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
st0012 committed Dec 18, 2023
1 parent a92f441 commit 7d137b4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/ruby_lsp/check_docs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7d137b4

Please sign in to comment.