Skip to content

Commit

Permalink
Add low priority resolution for class members links
Browse files Browse the repository at this point in the history
Resolves #2031
  • Loading branch information
Gerrit0 committed Aug 13, 2022
1 parent 295c97f commit a12573d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,7 @@
### Bug Fixes

- Readme files within monorepos now have `@link` tags resolved, #2029.
- Correctly resolve unqualified links to class members within parameters, #2031.

## v0.23.10 (2022-07-31)

Expand Down
2 changes: 2 additions & 0 deletions src/lib/converter/comments/declarationReferenceResolver.ts
Expand Up @@ -42,6 +42,8 @@ export function resolveDeclarationReference(
refl = refl.parent;
if (refl.kindOf(ReflectionKind.ExportContainer)) {
high.push(refl);
} else {
low.push(refl);
}
}

Expand Down
10 changes: 10 additions & 0 deletions src/test/converter2/issues/gh2031.ts
@@ -0,0 +1,10 @@
export class MyClass {
/**
* {@link anotherMethod}
*
* @param aParam {@link anotherMethod}
*/
aMethod(aParam: number) {}

anotherMethod() {}
}
14 changes: 14 additions & 0 deletions src/test/issueTests.ts
Expand Up @@ -712,4 +712,18 @@ export const issueTests: {
"Desc3"
);
},

gh2031(project, logger) {
const sig = query(project, "MyClass.aMethod").signatures![0];
const summaryLink = sig.comment?.summary[0];
ok(summaryLink?.kind === "inline-tag");
ok(summaryLink.target);

const paramLink = sig.parameters![0].comment?.summary[0];
ok(paramLink?.kind === "inline-tag");
ok(paramLink.target);

logger.discardDebugMessages();
logger.expectNoOtherMessages();
},
};

0 comments on commit a12573d

Please sign in to comment.