You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `@AlternateRepresentation` directive is not expected for non-symbol pages, and we now emit diagnostics for this case.
For example, if an `@AlternateDeclaration` directive is added to an article, the resulting diagnostic will be:
```
warning: Custom alternate representations are not supported for page kind 'Article'
Alternate representations are only supported for symbols.
--> ./SynonymSample.docc/Article.md:4:5-4:57
2 |
3 | @metadata {
4 + @AlternateRepresentation(``Synonyms/Synonym-5zxmc``)
| ╰─suggestion: Remove this alternate representation
5 | }
```
And if a custom alternate declaration to an article is specified, the resulting dia
gnostic will be:
```
warning: Page kind 'Article' is not allowed as a custom alternate language representation
Symbols can only specify other symbols as custom language representations.
--> ./SynonymSample.docc/Synonym-1wqxt.md:5:5-5:44
3 | @metadata {
4 | @AlternateRepresentation(``Synonyms/Synonym-5zxmc``)
5 + @AlternateRepresentation("doc:Article")
| ╰─suggestion: Remove this alternate representation
6 | }
```
0 commit comments