MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / applyColor

Function applyColor

src/debug/colors.ts:13–19  ·  view source on GitHub ↗
(text: string, color: (text: string) => string)

Source from the content-addressed store, hash-verified

11/// when sending OutputEvents() to VS Code, it won't allow source locations to be attached (since
12/// they can only be attached to single-line messages).
13export function applyColor(text: string, color: (text: string) => string) {
14 const match = text && whitespacePattern.exec(text);
15 if (!match)
16 return color(text);
17
18 return `${match[1]}${color(match[2])}${match[3]}`;
19}

Callers 2

util.test.tsFile · 0.90
logToUserFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected