Module: SimpleCov::SourceFile::BuilderContext

Included in:
SimpleCov::SourceFile
Defined in:
lib/simplecov/source_file/builder_context.rb,
sig/simplecov.rbs

Instance Method Summary collapse

Instance Method Details

#filename ⇒ String

Returns:

  • (String)


974
# File 'sig/simplecov.rbs', line 974

def filename: () -> String

#real_source_positions ⇒ real_positions?

Memoized set of real source positions extracted via Prism. Nil when Prism is unavailable or parsing fails, signaling callers to keep every Coverage entry rather than risk false drops. The defined? guard preserves a nil memoization across calls.

Returns:

  • (real_positions, nil)


14
15
16
17
18
# File 'lib/simplecov/source_file/builder_context.rb', line 14

def real_source_positions
  return @real_source_positions if instance_variable_defined?(:@real_source_positions)

  @real_source_positions = StaticCoverageExtractor.real_source_positions(src.join)
end

#skip_chunks_for(criterion) ⇒ Array[Range[Integer]]

Parameters:

  • (criterion)

Returns:

  • (Array[Range[Integer]])


6
7
8
# File 'lib/simplecov/source_file/builder_context.rb', line 6

def skip_chunks_for(criterion)
  (@skip_chunks ||= SkipChunks.new(filename, src)).chunks_for(criterion)
end

#src ⇒ Array[String]

Returns:

  • (Array[String])


975
# File 'sig/simplecov.rbs', line 975

def src: () -> Array[String]