Every now and then, I forget some dangerous code added for debugging which leads to trouble later on. It would be great if you could maintain a pattern (regexp) for such dangerous code which would be highlighted strikingly in the editor no matter what the current scope is.
This could of course be fitted in the grammar of each language, but people are using different tools and techniques, so “one size fits all” doesn’t seem right.
Here’s an example to illustrate this:
In order to work on an individual test of a Ruby test suite (say Minitest or RSpec), you can temporarily add
focus immediately before that test:
If you forget to remove it after debugging, the test suite runs without error and gives you green even if other tests fail.
A option such as “Preferences -> Editor” to define a pattern (regexp) which attaches an additional class e.g.
Highlight Dangerous Code
Code which matches this pattern is highlighted with class
.dangerous class can be decorated with colors fitting your template in
A possible result:
There is a package highlight-registered-keyword which does something similar, but it’s unmaintained since 2017, quite an overkill in terms of configuration and I didn’t get it to mark the defined keywords automatically at all.
In order to be useful, I guess such a feature has to be very easy to use: One setting in the editor preferences along with one style (either already part of your template or added by editing
What do you think, could this be a useful feature worth of creating an issue for? Or is there maybe another way to define such custom highlighting easily without having to drill open core packages?