MCPcopy Index your code
hub / github.com/nodejs/node / emitTrailingComment

Function emitTrailingComment

test/fixtures/snapshot/typescript.js:114919–114932  ·  view source on GitHub ↗
(commentPos, commentEnd, _kind, hasTrailingNewLine)

Source from the content-addressed store, hash-verified

114917 forEachTrailingCommentToEmit(pos, emitTrailingComment);
114918 }
114919 function emitTrailingComment(commentPos, commentEnd, _kind, hasTrailingNewLine) {
114920 if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos))
114921 return;
114922 // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment2*/
114923 if (!writer.isAtStartOfLine()) {
114924 writer.writeSpace(" ");
114925 }
114926 emitPos(commentPos);
114927 ts.writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine);
114928 emitPos(commentEnd);
114929 if (hasTrailingNewLine) {
114930 writer.writeLine();
114931 }
114932 }
114933 function emitTrailingCommentsOfPosition(pos, prefixSpace, forceNoNewline) {
114934 if (commentsDisabled) {
114935 return;

Callers

nothing calls this directly

Calls 3

shouldWriteCommentFunction · 0.85
emitPosFunction · 0.85
getCurrentLineMapFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…