Skip to content

Add anchors to type extensions#684

Merged
jonludlam merged 1 commit intoocaml:masterfrom
Julow:anchor-type-ext
Jun 9, 2021
Merged

Add anchors to type extensions#684
jonludlam merged 1 commit intoocaml:masterfrom
Julow:anchor-type-ext

Conversation

@Julow
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator Author

Julow commented Jun 9, 2021

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

@Drup
Copy link
Copy Markdown
Contributor

Drup commented Jun 9, 2021

Right, we should anchor those eventually too.

@jonludlam
Copy link
Copy Markdown
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