MCPcopy Create free account
hub / github.com/openclaw/gogcli / applyDocsRequestTarget

Function applyDocsRequestTarget

internal/cmd/docs_target.go:32–59  ·  view source on GitHub ↗
(requests []*docs.Request, target docsRequestTarget)

Source from the content-addressed store, hash-verified

30}
31
32func applyDocsRequestTarget(requests []*docs.Request, target docsRequestTarget) {
33 for _, req := range requests {
34 if req == nil {
35 continue
36 }
37 if req.InsertText != nil {
38 if req.InsertText.Location != nil {
39 req.InsertText.Location.TabId = target.TabID
40 req.InsertText.Location.SegmentId = target.SegmentID
41 forceZeroLocationIndex(req.InsertText.Location)
42 }
43 if req.InsertText.EndOfSegmentLocation != nil {
44 req.InsertText.EndOfSegmentLocation.TabId = target.TabID
45 req.InsertText.EndOfSegmentLocation.SegmentId = target.SegmentID
46 }
47 }
48 for _, location := range docsRequestLocations(req) {
49 location.TabId = target.TabID
50 location.SegmentId = target.SegmentID
51 forceZeroLocationIndex(location)
52 }
53 for _, targetRange := range docsRequestRanges(req) {
54 targetRange.TabId = target.TabID
55 targetRange.SegmentId = target.SegmentID
56 forceZeroRangeStart(targetRange)
57 }
58 }
59}
60
61func forceZeroLocationIndex(location *docs.Location) {
62 if location != nil && location.Index == 0 && !docsContainsString(location.ForceSendFields, "Index") {

Callers 7

runDocsBodyMutationFunction · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85

Calls 4

forceZeroLocationIndexFunction · 0.85
docsRequestLocationsFunction · 0.85
docsRequestRangesFunction · 0.85
forceZeroRangeStartFunction · 0.85