MCPcopy Create free account
hub / github.com/github/gh-aw / mapNestedLocationToOriginal

Function mapNestedLocationToOriginal

pkg/parser/json_path_locator.go:354–367  ·  view source on GitHub ↗
(subLocation JSONPathLocation, nestedSection NestedSection, baseIndent int)

Source from the content-addressed store, hash-verified

352}
353
354func mapNestedLocationToOriginal(subLocation JSONPathLocation, nestedSection NestedSection, baseIndent int) JSONPathLocation {
355 originalLine := nestedSection.startLine + subLocation.Line // +1 to skip section header, -1 for 0-based indexing
356 originalColumn := subLocation.Column
357
358 if baseIndent > 0 {
359 originalColumn += baseIndent
360 }
361
362 return JSONPathLocation{
363 Line: originalLine + 1, // Convert back to 1-based line numbers
364 Column: originalColumn,
365 Found: true,
366 }
367}
368
369// NestedSection represents a section of YAML content that corresponds to a nested object
370type NestedSection struct {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected