swiftlang / swift-docc

Documentation compiler that produces rich API reference documentation and interactive tutorials for your Swift framework or package.
https://swift.org/documentation/docc
Apache License 2.0
1.19k stars 127 forks source link

`@SupportedLanguage` support for symbols #465

Open franklinsch opened 1 year ago

franklinsch commented 1 year ago

Feature Name

@SupportedLanguage support for symbols

Description

With https://forums.swift.org/t/setting-programming-language-availability-for-articles-in-swift-docc/61435, the @SupportedLanguage directive was added to specify the programming languages an article is available in. It would make sense to bring it to symbols as well as part of a future PR. The @SupportedLanguage data would override data from symbol graphs, similar to how the @Available directive overrides the symbol graph information.

Motivation

Provide the ability of overriding the programming languages a symbol is available in. In practice, the use cases for wanting this will likely be very rare and will likely not apply when building Swift+ObjC documentation.

Importance

No response

Alternatives Considered

We could decide to not support this directive for symbols, in which case we'd want DocC to emit a diagnostic explaining that the use of the directive is not supported for symbols.

d-ronnqvist commented 11 months ago

Can you provide a use case for this?

"Provide the ability of overriding the programming languages a symbol is available in." is more a description of what @SupportedLanguage does than a motivation for supporting it for symbols.