MCPcopy Create free account
hub / github.com/ChromeDevTools/devtools-frontend / replaceRange

Method replaceRange

front_end/models/text_utils/Text.ts:76–80  ·  view source on GitHub ↗
(range: TextRange, replacement: string)

Source from the content-addressed store, hash-verified

74 }
75
76 replaceRange(range: TextRange, replacement: string): string {
77 const sourceRange = this.toSourceRange(range);
78 return this.#value.substring(0, sourceRange.offset) + replacement +
79 this.#value.substring(sourceRange.offset + sourceRange.length);
80 }
81
82 extract(range: TextRange): string {
83 const sourceRange = this.toSourceRange(range);

Callers 3

setTextMethod · 0.95
Text.test.tsFile · 0.45

Calls 2

toSourceRangeMethod · 0.95
substringMethod · 0.80

Tested by

no test coverage detected