Class: CodeSnippetTool
- Defined in:
- lib/yardmcp.rb
Overview
Tool: Fetch code snippet for a YARD object from installed gems
Instance Method Summary collapse
Methods inherited from YardTool
Instance Method Details
#call(path:, gem_name: nil, max_chars: YardUtils::MAX_SOURCE_CHARS) ⇒ Object
793 794 795 796 797 798 |
# File 'lib/yardmcp.rb', line 793 def call(path:, gem_name: nil, max_chars: YardUtils::MAX_SOURCE_CHARS) with_yard_errors do snippet = YardUtils.instance.code_snippet(path, gem_name, max_chars:) ok({ path:, gem_name:, resource_uris: resource_uris(gem_name, path), snippet: }, text: snippet.to_s) end end |