Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/transformation/utils/annotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export function getFileAnnotations(sourceFile: ts.SourceFile): AnnotationsMap {
function getTagArgsFromComment(tag: ts.JSDocTag): string[] {
if (tag.comment) {
if (typeof tag.comment === "string") {
return tag.comment.split(" ");
const firstLine = tag.comment.split("\n")[0];
return firstLine.trim().split(" ");
} else {
return tag.comment.map(part => part.text);
}
Expand Down
2 changes: 2 additions & 0 deletions test/translation/__snapshots__/transformation.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ escapedCharsInTemplateString = "\\\\ \\0 \\b \\t \\n \\v \\f \\" ' \`"
nonEmptyTemplateString = ("Level 0: \\n\\t " .. ("Level 1: \\n\\t\\t " .. ("Level 3: \\n\\t\\t\\t " .. "Last level \\n --") .. " \\n --") .. " \\n --") .. " \\n --""
`;

exports[`Transformation (customNameWithExtraComment) 1`] = `"TestNamespace.pass()"`;

exports[`Transformation (customNameWithNoSelf) 1`] = `"TestNamespace.pass()"`;

exports[`Transformation (exportStatement) 1`] = `
Expand Down
10 changes: 10 additions & 0 deletions test/translation/transformation/customNameWithExtraComment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/** @noSelf */
declare namespace TestNamespace {
/**
* @customName pass
* The first word should not be included.
**/
function fail(): void;
}

TestNamespace.fail();
Loading