Skip to content

Feature Request: Create tests for syntax highlighter YAML files #3903

@px-64

Description

@px-64

When creating or updating syntax files for languages that have complex syntax rules (such as nested formatting types in Markdown, $\LaTeX$, or AsciiDoc), it may be helpful to have syntax examples and their correct parsings to compare changes against.

For example, I am working on updating the Markdown syntax file to fix some style nesting bugs, such as the following bug that incorrectly renders bold text inside an italicized sentence:

The string `*This italicized sentence has **bold text** inside.*` which has been rendered partially incorrectly by micro's syntax provider

In this case, once a solution has been found, it would be quick to test a few strings of italicized and bold text and verify that a fix works. However, when combined with other rules, this case would become more time-consuming to manually verify that fixes have been made and existing cases have not been broken.

Would it be possible to implement some sort of parsing validation system to ensure code is broken down into the correct "pieces"?

One related example that comes to mind is CommonMark's spec tests that include pairs of Markdown source strings and their proper HTML renderings. I'm not sure how Micro handles parsed code or if a system like this would be possible, but I wanted to bring up the idea in case others may find it useful as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions