RFC: Syntax for "declaration references" (hyperlinks)
See original GitHub issueCertain tags such as {@inheritdoc}
contain references to other API items. AEDoc supports two notations for API item references:
-
For internal references, we use:
Example:exportName.memberName
{@inheritdoc BaseWidget.draw}
The “.memberName
” is optional and included e.g. if the API item is a member of a class or interface. -
For external references, we use:
Example:@scopeName/packageName:exportName.memberName
{@inheritdoc @microsoft/widget-lib:BaseWidget.draw}
The “@scopeName/
” and “.memberName
” are optional. The “@scopeName/
” is used for scoped NPM packages.
This might be a reasonable starting point. However, it doesn’t consider nesting members such as namespaces (which has turned out to be surprisingly common for legacy SDKs, despite all the downsides and attempts to deprecate them).
Also, AEDoc today overlooks an interesting edge case:
export class A {
public b: string = 'hello';
}
export namespace A {
export let b: number = 123;
}
let a = new A();
// a.b is a string
// A.b is a number
In this example, an expression such as {@link A.b}
would be ambiguous. Which declaration is it referring to? How to handle this?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:55 (10 by maintainers)
Top Results From Across the Web
RFC 1866 Hypertext Markup Language - IETF
syntax -reference character set A coded character set whose range includes all characters used for markup; e.g. name characters and delimiter characters. tag ......
Read more >HTML 3.2 Reference Specification - W3C
This specification defines the intended interpretation of HTML 3.2 elements, and places further constraints on the permitted syntax which are ...
Read more >KML Reference | Keyhole Markup Language
Each reference entry includes a Syntax section that lists the elements ... Declaring new typed fields using the <Schema> element and then instancing...
Read more >PHP RFC: Lexical Scope Support for Anonymous Classes
Proposal. We allow anonymous classes to import variables into their property table using the familiar syntax. The following syntax is used: new ...
Read more >IETF RFC Citation List for OASIS Editors Version 1.0
To cite to a specific RFC, simply locate it in this file (Cntr-f in your browser) and copy and paste it into the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I like option 2 because it looks like URL hashtag. Like an anchorlink it points to a section of a bigger package/file.
Will the upcoming private fields readily follow such syntax?
Container.#id
(private static)Container##id
(private instance)Per sec. 4 of the proposal: