-
Notifications
You must be signed in to change notification settings - Fork 708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hyperlink not generated for {@link type#property} #2808
Comments
2/3. That's... weird. A very Quick Look before heading to bed seems to indicate that TypeDoc isn't actually resolving the link correctly and should be producing a warning, though it also ought to be producing a link there, so there might be two things wrong here. |
@Gerrit0 - Thanks for the quick reply and initial thoughts. 1 - Makes sense and what I was expecting, just wanted to be sure 😄 Have a good night and thanks again! |
@Gerrit0 - I came across a couple other situations that produce an identical result with the property not hyperlinked but the declaration page itself containing the anchor tag. I can't be certain these are the same underlying problem, but they are equally as weird and likely the same as the repro in the OP.
Important If you comment out this line and replace it with this line, problem 1 & 2 do not happen although 3 still does. Hope this helps, thank you! |
1 - Yes, interfaces vs types makes no difference here. Expected result. 2.i / 2.ii - Looks like it's probably the same issue as with types. 2.iii - Working as expected. If you use TypeDoc's markdownItOptions option, you can disable linkify to disable this behavior. 3.iv - Yes, when redeclaring the type there you introduce new symbols, so they have their own identity. |
Thanks @Gerrit0!
Makes sense.
Makes sense and as suspected - wanted to mention specifically since I thought the issue was related to type property resolution specifically but it seems it may be otherwise. Have you had any luck tracking this down further?
Very interesting and good to know. Was not aware of this but makes sense, thanks for pointing it out and the playground to see it in action.
Assuming you were referring to the information in the "important" section for this, correct? Assuming yes, would agree that redeclaring the types would introduce new symbols but the Thanks! |
Well that was an interesting multi-hour debugging adventure... there's never a good answer for anything... Notes:
|
Sleeping on a problem is always a good idea. The answer for no. 3 is rather obvious now. TypeDoc should just check if anchor properties for a type are directly within a type literal on a variable/type alias. If they are, it should assign a URL, and always render those properties in a way that they'll have a URL on the page. |
@Gerrit0 - Thank you for your persistence and for the fixes, greatly appreciated! I tested all three repros and my actual project and all generate correctly now with 0.27.5. Apologies again for the repro's including Thank you again!! |
Search terms
anchor, hyperlink, property, member
Expected Behavior
Per the release notes for v0.27.0, it indicates that "TypeDoc can now link to type alias properties, #2524." Unless I'm misunderstanding what was fixed and what scenarios the fix covers, when using
{@link type#property}
, the generated HTML should contain a hyperlink to the corresponding anchor tag on the type declaration page.Actual Behavior
foo.a
instead ofFooTypeDT.a
. I'm not 100% sure if it should link toFooTypeDT.a
but mentioning this as a potential bug/issue since I would think it should link toFooTypeDT.a
sinceFooTypeDT
is decorated with@useDeclaredType
.For 2 & 3, I was unable to narrow this down any further except for when
zod
is used, apologies for that. Although I could be mistaken, I do not think this is azod
and/ortypedoc-plugin-zod
issue because the anchor tag is emitted on theZodFoo
&ZodFooDT
declaration pages, the{@link}
reference does not error meaning it finds the corresponding type/property, it's only that the hyperlink is not emitted.Steps to reproduce the bug
Repro: https://stackblitz.com/edit/vitejs-vite-gbh2bhqb
npm run docs
docs/functions/doSomething.html
Environment
The text was updated successfully, but these errors were encountered: