Module: Prism::Merge::RSpec::ProviderSnapshotExtension
- Defined in:
- lib/prism/merge/rspec/provider_snapshot_extension.rb
Overview
Reuses Prism::Merge's established directive and node-path projection as native evidence for portable provider contract snapshots.
Class Method Summary collapse
-
.call(source:) ⇒ Object
rubocop:disable Metrics/MethodLength -- the extension envelope keeps all native evidence explicit.
Class Method Details
.call(source:) ⇒ Object
rubocop:disable Metrics/MethodLength -- the extension envelope keeps all native evidence explicit
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/prism/merge/rspec/provider_snapshot_extension.rb', line 14 def call(source:, **) normalized = Prism::Merge.parse_ruby_normalized(source) nodes = normalized.fetch(:nodes) { schema: 'structuredmerge.extension/ruby-prism/v1', namespace: 'ruby-prism', capabilities: %w[comment-directives magic-comments native-node-kinds node-paths], payload: { parser_metadata: normalized.fetch(:metadata), nodes: nodes.map { |node| native_node_evidence(node) }, native_tree_visibility: 'provider_internal' } } end |