Skip to content

Commit 0da6cc2

Browse files
committed
SymDB scope: restore wire-format-vs-Ruby-identifier comment
The Scope :targetable_lines comment at scope.rb:25 was rewritten in #5717 in a way that lost the distinction between the Ruby identifier (targetable_lines) and the wire-format key (has_injectible_lines). The same file at lines 83-88 still serializes with the historical +injectible+ spelling for backend compatibility, so the line-25 comment contradicted the actual implementation in the same file. Restore the original comment so the wire-format key name is documented next to the Struct member it describes. Also rename the scope_spec.rb test description that propagated the same wrong wording ("includes targetable_lines?: false") to match what the test body actually asserts ("emits has_injectible_lines: false").
1 parent 87c5373 commit 0da6cc2

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

lib/datadog/symbol_database/scope.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ class Scope
2222
# - nil: not computed (source unreadable, native/C-extension method)
2323
# - []: computed but no executable lines found (comments/whitespace only)
2424
# - non-empty: computed, contains executable line ranges
25-
# nil and [] both serialize as targetable_lines?: false on METHOD
26-
# scopes. Key is absent on non-METHOD scopes.
25+
# nil and [] both serialize as has_injectible_lines: false on METHOD
26+
# scopes. Key is absent on non-METHOD scopes. The wire format key
27+
# name keeps the historical spelling +injectible+ for backend
28+
# compatibility; the Ruby identifier is +targetable_lines+.
2729
:targetable_lines,
2830
:language_specifics, :symbols, :scopes
2931

spec/datadog/symbol_database/scope_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
expect(hash[:injectible_lines]).to eq([{start: 10, end: 12}, {start: 15, end: 15}])
261261
end
262262

263-
it 'includes targetable_lines?: false on METHOD scope without ranges' do
263+
it 'emits has_injectible_lines: false on METHOD scope without ranges' do
264264
scope = described_class.new(
265265
scope_type: 'METHOD',
266266
name: 'native_method',

0 commit comments

Comments
 (0)