Skip to content
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

Add anchors to type extensions #684

Merged
merged 1 commit into from
Jun 9, 2021
Merged

Conversation

Julow
Copy link
Collaborator

@Julow Julow commented Jun 8, 2021

Fixes #601

This PR adds anchors to type extensions but doesn't allow them to be referenced.
The anchor looks like extension-decl-FirstConstructor. This is enough because it's not possible to have two constructors with the same name in a signature.

The other part of the issue is fixed since #615

This is the simplest fix for the issue. An alternative is to add an internal name and a new syntax for references to extensions.

This only adds the anchor in the html backend, it is not possible to
reference type extensions.

The anchor is "extension-decl-FirstConstructor". This should be enough
because it is not possible to have two constructors of the same name in
the same signature.
@Drup
Copy link
Contributor

Drup commented Jun 8, 2021

The anchor looks like extension-decl-FirstConstructor. This is enough because it's not possible to have two constructors with the same name in a signature.

Huh, that's actually probably right, I somehow didn't realized that.

I think it's the last one! Can you try to get rid of the option type for anchors ? :)

@Julow
Copy link
Collaborator Author

Julow commented Jun 9, 2021

There are some other None in class fields (inherit, constraint).

@Drup
Copy link
Contributor

Drup commented Jun 9, 2021

Right, we should anchor those eventually too.

@jonludlam
Copy link
Member

I don't think this completely fixes #601 as there's no way to refer to these things from within the doc itself (ie, there's no {!type-extension-Constructor} syntax yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type extensions are no anchorable and should be classified as type
3 participants