micro-editor / micro-editor/micro
Feature Request: Create tests for syntax highlighter YAML files
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 29.6k
- Forks
- 1.4k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 10
Description
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:
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting runtime/syntax/markdown.yaml and the existing syntax parsing behavior for nested Markdown formatting. Compare the proposed approach with CommonMark's spec.json examples, then define representative syntax cases and a validation mechanism whose results can be checked against expected parsed pieces.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100