MCPcopy Create free account
hub / github.com/microsoft/vscode-cpptools / scanCodeFence

Method scanCodeFence

Extension/src/Utility/Text/scanner.ts:889–902  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

887 }
888
889 private scanCodeFence() {
890 // skip to the end of this line first
891 const fenceStart = this.scanUntil((ch, chNext) => ch === CharacterCodes.lineFeed || (ch === CharacterCodes.carriageReturn && chNext === CharacterCodes.lineFeed));
892
893 // end when the first column is triple backtick
894 const code = this.scanUntil((ch, chNext, chNextNext) => this.#column === 0 && (ch === CharacterCodes.backtick && chNext === CharacterCodes.backtick && chNextNext === CharacterCodes.backtick));
895
896 this.text = fenceStart + code;
897
898 // code is just the inside contents
899 this.stringValue = code.substring(0, code.length - 3);
900
901 return this.kind = Kind.CodeFence;
902 }
903
904 private unescapeString(text: string) {
905 let result = '';

Callers 1

scanMethod · 0.95

Calls 1

scanUntilMethod · 0.95

Tested by

no test coverage detected