class Solargraph::Bench
A container of source maps and workspace data to be cataloged in an ApiMap.
Attributes
@return [Set<String>]
@return [SourceMap]
@return [Set<SourceMap>]
@return [Workspace]
Public Class Methods
Source
# File lib/solargraph/bench.rb, line 24 def initialize source_maps: [], workspace: Workspace.new, live_map: nil, external_requires: [] @source_maps = source_maps.to_set @workspace = workspace @live_map = live_map @external_requires = external_requires.reject { |path| workspace.would_require?(path) } .compact .to_set end
@param source_maps [Array<SourceMap>, Set<SourceMap>] @param workspace [Workspace] @param live_map [SourceMap, nil] @param external_requires [Array<String>, Set<String>]
Public Instance Methods
Source
# File lib/solargraph/bench.rb, line 41 def icebox @icebox ||= (source_maps - [live_map]) end
@return [Set<SourceMap>]
Source
# File lib/solargraph/bench.rb, line 34 def source_map_hash # @todo Work around #to_h bug in current Ruby head (3.5) with #map#to_h @source_map_hash ||= source_maps.map { |s| [s.filename, s] } .to_h end
@return [Hash{String => SourceMap}]