Taking a fresh look at the syntax definition code revealed two things:
- sublime-syntax files are still really confusing to me.
- I was able to accomplish a lot of what I wanted by just adding some scopes and deleting a few rules. The changes I've made are immensely helpful, but I'm not done just yet. (I may also be able to simplify my color scheme.)
I'd like to now focus on creating a custom reporter for coverage collected using the function context. (Ideally, there'd be a module-level context...) There are a few things to check for/do:
- For each file in the src, its first statement was executed by the first context. (Warn if not, with an option to make this an error.)
- It is possible to associate a list of contexts to each source file. (There should be some mechanism for overriding the default logic, using some kind of pragma, maybe?) (I just checked something, and it looks like munging this myself would be unreliable enough that I'm going to ask for a "test_module" context.)
- Considering only the first context and the associated contexts, calculate the coverage for the file, and pass this result to the various reporters.
- Possibly instead this would be a post-processing step on the coverage database, so everything that reads it just sees the munged data and is fine with it.
Things are feeling nice from all of this. (It's just too bad I can't figure out how to hook Sublime Text into my publishing pipeline so I can inflict my syntax definition and color scheme on the world.)
I'll try to write some of this stuff up tomorrow. Good night.