3

I'm trying to make a syntax file for Raku. The major challenge I'm running into is that I have no automated means to test that my highlighting works as expected. I have to keep another tab open, switch to it, source the syntax file, and then visually inspect the highlighting.

I would like some way to specify what I want the highlighting to look like and then run an automated test to verify that a syntax file does or does not produce the expected results.

  • 2
    My testing.vim program can test syntax files; AFAIK that's the easiest way (but I'm probably biased as I'm the author of that 😅) – Martin Tournoij Mar 3 at 15:23
  • 1
    I used some basic screen-testing for the xml-runtime files, see e.g. here. this is based havily on the Vim testing framework but much more simplified – Christian Brabandt Mar 3 at 18:07
  • 1
    Have you seen Swatch.vim (neovim only)? It doesn't do testing per se, but it should a). allow you to specify the highlighting, and b). presuming it works as described, make "testing" unnecessary? – Rich Mar 5 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.