MCPcopy Create free account
hub / github.com/nodejs/node / emitTrailingCommentOfPositionNoNewline

Function emitTrailingCommentOfPositionNoNewline

test/fixtures/snapshot/typescript.js:114941–114951  ·  view source on GitHub ↗
(commentPos, commentEnd, kind)

Source from the content-addressed store, hash-verified

114939 exitComment();
114940 }
114941 function emitTrailingCommentOfPositionNoNewline(commentPos, commentEnd, kind) {
114942 if (!currentSourceFile)
114943 return;
114944 // trailing comments of a position are emitted at /*trailing comment1 */space/*trailing comment*/space
114945 emitPos(commentPos);
114946 ts.writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);
114947 emitPos(commentEnd);
114948 if (kind === 2 /* SyntaxKind.SingleLineCommentTrivia */) {
114949 writer.writeLine(); // still write a newline for single-line comments, so closing tokens aren't written on the same line
114950 }
114951 }
114952 function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) {
114953 if (!currentSourceFile)
114954 return;

Callers

nothing calls this directly

Calls 2

emitPosFunction · 0.85
getCurrentLineMapFunction · 0.85

Tested by

no test coverage detected