MCPcopy Create free account
hub / github.com/buggregator/server / originalSourceLines

Method originalSourceLines

modules/sentry/sourcemap.go:190–207  ·  view source on GitHub ↗

originalSourceLines returns the split content of the given source index.

(srcIndex int)

Source from the content-addressed store, hash-verified

188
189// originalSourceLines returns the split content of the given source index.
190func (sm *sourceMap) originalSourceLines(srcIndex int) ([]string, bool) {
191 if srcIndex < 0 || srcIndex >= len(sm.SourcesContent) {
192 return nil, false
193 }
194 content := sm.SourcesContent[srcIndex]
195 if content == "" {
196 return nil, false
197 }
198 if sm.origLineCache == nil {
199 sm.origLineCache = map[int][]string{}
200 }
201 if cached, ok := sm.origLineCache[srcIndex]; ok {
202 return cached, true
203 }
204 lines := strings.Split(content, "\n")
205 sm.origLineCache[srcIndex] = lines
206 return lines, true
207}
208
209// sourceName returns a display name for a resolved source index.
210func (sm *sourceMap) sourceName(srcIndex int) string {

Callers 2

enrichFrameFunction · 0.80

Calls

no outgoing calls

Tested by 1