Skip to content

Commit a12573d

Browse files
committed
Add low priority resolution for class members links
Resolves #2031
1 parent 295c97f commit a12573d

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Bug Fixes
44

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

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

src/lib/converter/comments/declarationReferenceResolver.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export function resolveDeclarationReference(
4242
refl = refl.parent;
4343
if (refl.kindOf(ReflectionKind.ExportContainer)) {
4444
high.push(refl);
45+
} else {
46+
low.push(refl);
4547
}
4648
}
4749

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export class MyClass {
2+
/**
3+
* {@link anotherMethod}
4+
*
5+
* @param aParam {@link anotherMethod}
6+
*/
7+
aMethod(aParam: number) {}
8+
9+
anotherMethod() {}
10+
}

src/test/issueTests.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,4 +712,18 @@ export const issueTests: {
712712
"Desc3"
713713
);
714714
},
715+
716+
gh2031(project, logger) {
717+
const sig = query(project, "MyClass.aMethod").signatures![0];
718+
const summaryLink = sig.comment?.summary[0];
719+
ok(summaryLink?.kind === "inline-tag");
720+
ok(summaryLink.target);
721+
722+
const paramLink = sig.parameters![0].comment?.summary[0];
723+
ok(paramLink?.kind === "inline-tag");
724+
ok(paramLink.target);
725+
726+
logger.discardDebugMessages();
727+
logger.expectNoOtherMessages();
728+
},
715729
};

0 commit comments

Comments
 (0)