MCPcopy
hub / github.com/codeaashu/claude-code / segment

Method segment

src/utils/textHighlighting.ts:76–94  ·  view source on GitHub ↗
(highlights: TextHighlight[])

Source from the content-addressed store, hash-verified

74 }
75
76 segment(highlights: TextHighlight[]): TextSegment[] {
77 const segments: TextSegment[] = []
78
79 for (const highlight of highlights) {
80 const before = this.segmentTo(highlight.start)
81 if (before) segments.push(before)
82
83 const highlighted = this.segmentTo(highlight.end)
84 if (highlighted) {
85 highlighted.highlight = highlight
86 segments.push(highlighted)
87 }
88 }
89
90 const after = this.segmentTo(Infinity)
91 if (after) segments.push(after)
92
93 return segments
94 }
95
96 private segmentTo(targetVisiblePos: number): TextSegment | null {
97 if (

Callers 15

GlimmerMessageFunction · 0.80
renderMethod · 0.80
getGraphemeBoundariesMethod · 0.80
getWordBoundariesMethod · 0.80
truncateToWidthFunction · 0.80
truncateStartToWidthFunction · 0.80
wrapTextFunction · 0.80
segmentTextByHighlightsFunction · 0.80
firstGraphemeFunction · 0.80
lastGraphemeFunction · 0.80

Calls 2

segmentToMethod · 0.95
pushMethod · 0.45

Tested by

no test coverage detected