From 76c64061cf98eca28c7dd2d76b0d00403268108e Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Wed, 6 Nov 2024 15:35:07 -0500 Subject: [PATCH] TODO: use Spoom for docs Signed-off-by: Alexandre Terrasa --- lib/tapioca/gem/listeners/yard_doc.rb | 3 +++ lib/tapioca/gem/pipeline.rb | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/lib/tapioca/gem/listeners/yard_doc.rb b/lib/tapioca/gem/listeners/yard_doc.rb index 959fd13b4..8893019a4 100644 --- a/lib/tapioca/gem/listeners/yard_doc.rb +++ b/lib/tapioca/gem/listeners/yard_doc.rb @@ -23,6 +23,7 @@ class YardDoc < Base IGNORED_SIG_TAGS = T.let(["param", "return"], T::Array[String]) + # TODO: remove sig { params(pipeline: Pipeline).void } def initialize(pipeline) YARD::Registry.clear @@ -53,6 +54,8 @@ def on_method(event) sig { params(name: String, sigs: T::Array[RBI::Sig]).returns(T::Array[RBI::Comment]) } def documentation_comments(name, sigs: []) + # @pipeline.model.symbols[name].map { |symbol_def| symbol_def.comments }.join("\n") + yard_docs = YARD::Registry.at(name) return [] unless yard_docs diff --git a/lib/tapioca/gem/pipeline.rb b/lib/tapioca/gem/pipeline.rb index 2b1b655d3..709a66fd1 100644 --- a/lib/tapioca/gem/pipeline.rb +++ b/lib/tapioca/gem/pipeline.rb @@ -16,6 +16,8 @@ class Pipeline sig { returns(T.proc.params(error: String).void) } attr_reader :error_handler + # attr_reader :model + sig do params( gem: Gemfile::GemSpec, @@ -38,6 +40,9 @@ def initialize( @events = T.let([], T::Array[Gem::Event]) + # @model = Static::SymbolLoader.load_model(@gem) + # bootstrap_symbols = @model.symbols.keys.to_set + @payload_symbols = T.let(Static::SymbolLoader.payload_symbols, T::Set[String]) @bootstrap_symbols = T.let(load_bootstrap_symbols(@gem), T::Set[String])