Skip to content

Commit

Permalink
Correct check_docs task's filtering logic
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 committed Jan 9, 2024
1 parent 82eaab9 commit 7882c73
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/ruby_lsp/check_docs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,15 @@ def run_task

# Find all classes that inherit from BaseRequest or Listener, which are the ones we want to make sure are
# documented
features = ObjectSpace.each_object(Class).filter_map do |k|
features = ObjectSpace.each_object(Class).select do |k|
klass = T.unsafe(k)
klass_name = klass.name
next unless klass_name

klass if klass.ancestors.include?(Request) && !klass == Request
klass < Requests::Request && klass != Listener && klass != ExtensibleListener
end

missing_docs = T.let(Hash.new { |h, k| h[k] = [] }, T::Hash[String, T::Array[String]])

features.each do |klass|
class_name = klass.name
class_name = T.unsafe(klass).name
file_path, line_number = Module.const_source_location(class_name)
next unless file_path && line_number

Expand Down

0 comments on commit 7882c73

Please sign in to comment.