TypeStrong / TypeStrong/typedoc

Link tags in line comments are not resolved via TypeScript

Open
#3,113 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
8.5k
Forks
775
PR merge metrics
No merged PRs in 30d

Description

Search terms

@link line comment useTsLinkResolution

Expected Behavior

If I use line comments for my doc comments, I'd expect TypeScript-driven resolution of @link targets to still work.

Actual Behavior

Only the old, built-in resolution is used in this case.

In fact, the machinery needed to do this seems to be entirely absent from lineLexer.ts. Is this intentional, or an oversight? (If you want, I can look into adding it. In that case, I'd like to know why these lexers exist as completely separate code, rather than being unified, since they seem very similar.)

Steps to reproduce the bug

Set commentStyle to "line", and use a @link that requires TypeScript to resolve (I ran across this trying to reference an import from a sibling package included in the build). TypeDoc will never call getSymbolAtLocation for it, and thus fail to resolve it.

Environment

  • TypeDoc version: 0.28.19
  • TypeScript version: 6.0.3
  • Node.js version: 22.20.0
  • OS: Debian Linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lineLexer.ts and trace how commentStyle set to "line" handles @link targets. Compare that path with the existing TypeScript-driven resolution, including the expected getSymbolAtLocation call. Done means line comments resolve links that require TypeScript, such as imports from a sibling package included in the build.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.