This PR aims to enhance the customization of syntax highlighting for the OpenFgaDsl language definition.
Changes:
Restructured the tokens in the language definition to use the default PrismJS tokens.
Added alias mappings to maintain the connection with the original OpenFgaDslThemeTokenType enum values.
This change will make it easier for users to customize the highlighting colors without needing to add the OpenFGA specific CSS. It provides a more seamless integration with the default PrismJS themes and improves the overall DevX when working with OpenFgaDsl code.
Why this approach?
In this, each token in the languageDefinition object has been given a more descriptive name that aligns with the default PrismJS tokens. The alias property is used to maintain the mapping to the original OpenFgaDslThemeTokenType enum values.
This approach allows for easier customization of the highlighting colors by utilizing the default PrismJS tokens, while still keeping the internal mapping to the specific OpenFgaDslThemeTokenType enum values.
[ ] I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
[x] The correct base branch is being used, if not main
[ ] I have added tests to validate that the change in functionality is working as expected
Description
This PR aims to enhance the customization of syntax highlighting for the OpenFgaDsl language definition.
Changes:
OpenFgaDslThemeTokenType
enum values.This change will make it easier for users to customize the highlighting colors without needing to add the OpenFGA specific CSS. It provides a more seamless integration with the default PrismJS themes and improves the overall DevX when working with
OpenFgaDsl
code.Why this approach?
In this, each token in the
languageDefinition
object has been given a more descriptive name that aligns with the default PrismJS tokens. Thealias
property is used to maintain the mapping to the originalOpenFgaDslThemeTokenType
enum values.This approach allows for easier customization of the highlighting colors by utilizing the default PrismJS tokens, while still keeping the internal mapping to the specific
OpenFgaDslThemeTokenType
enum values.References
fixes #177
Review Checklist
main