MCPcopy
hub / github.com/witheve/Eve / debugTokenWithContext

Function debugTokenWithContext

src/ide.ts:670–679  ·  view source on GitHub ↗
(text:string, start:number, end:number)

Source from the content-addressed store, hash-verified

668}
669
670function debugTokenWithContext(text:string, start:number, end:number):string {
671 let lineStart = text.lastIndexOf("\n", start) + 1;
672 let lineEnd = text.indexOf("\n", end);
673 if(lineEnd === -1) lineEnd = undefined;
674 let tokenStart = start - lineStart;
675 let tokenEnd = end - lineStart;
676 let line = text.substring(lineStart, lineEnd);
677
678 return line.substring(0, tokenStart) + "|" + line.substring(tokenStart, tokenEnd) + "|" + line.substring(tokenEnd);
679}
680
681interface HistoryItem { finalized?: boolean, changes:(Change|SpanChange)[] }
682interface CMEditor extends CodeMirror.Editor {

Callers 1

injectSpansMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected