Skip to content
Closed
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
18 changes: 18 additions & 0 deletions tsdoc/src/parser/TSDocParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ export class TSDocParser {
}
}

/**
* Creates a TSDocParser instance that supports the beta declaration reference format.
* This format uses double curly braces `{{...}}` to enclose the reference, and a `!` character
* as a separator for package names.
*
* @remarks
* This is an opt-in feature. By default, the TSDocParser does not support this beta syntax.
* The returned parser instance will have its {@link TSDocParser.configuration}
* pre-configured to recognize the beta declaration reference syntax.
*/
public static createWithBetaDeclarationReferences(): TSDocParser {
const configuration: TSDocConfiguration = new TSDocConfiguration();
// This method (assumed to exist in TSDocConfiguration) would internally modify
// the parsing rules for declaration references to recognize the beta syntax.
configuration.configureForBetaDeclarationReferences();
return new TSDocParser(configuration);
}
Comment on lines +39 to +45
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces a new public API surface (createWithBetaDeclarationReferences) but there are no tests exercising it. Please add parser tests covering at least the examples from #202 (e.g., {@link {package!MyClass}}, {@link {Merged:interface}}, and the | link text form) to ensure the opt-in behavior works and doesn’t regress existing @link parsing.

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +45
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description/issue call for parsing support for {@link {…}} beta declaration references, but this change only adds a factory method and does not modify the actual parsing logic (e.g., NodeParser._parseLinkTagCodeDestination() / _parseDeclarationReference()) to recognize {...} destinations or the ! package separator. As written, opting in via this method will not change behavior even if the configuration call existed.

Copilot uses AI. Check for mistakes.

Comment on lines +40 to +46
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

configureForBetaDeclarationReferences() is not defined on TSDocConfiguration (no such method exists in tsdoc/src/configuration/TSDocConfiguration.ts), so this new factory will not compile. Either add the configuration API and its implementation (and include it in this PR), or remove this call and implement beta parsing via an existing/introduced configuration flag.

Suggested change
const configuration: TSDocConfiguration = new TSDocConfiguration();
// This method (assumed to exist in TSDocConfiguration) would internally modify
// the parsing rules for declaration references to recognize the beta syntax.
configuration.configureForBetaDeclarationReferences();
return new TSDocParser(configuration);
}
return new TSDocParser();
}

Copilot uses AI. Check for mistakes.
public parseString(text: string): ParserContext {
return this.parseRange(TextRange.fromString(text));
}
Expand Down
Loading