Closed mitranim closed 3 years ago
This also annoys me in YAML syntaxes. It's too late to fix that in YAML, but not too late for SBNF.
loads of false positives like name-constraint because according to \b\b, hyphen is a word delimiter.
That's an issue in the core of ST, see: https://github.com/sublimehq/sublime_text/issues/4901. I'm going to close this as kebab-case is the accepted standard for syntax definitions (which are affected by the same issue) and it's clearly easier to write.
I agree this should be fixed in the core to support syntaxes already committed to kebab-case. But I don't think it fully absolves kebab-case. Users may want to use regex search with \b\b
for refactoring. Admittedly that's an edge case, but it shows that this word break problem "leaks" into many places.
The core fix would make all search regexes use the correct word boundaries.
I have usability complaints about kebab identifiers.
First off:
_
in place of=
, so typing snake_case doesn't require Shift. I recommend that to everyone.Now for the ergonomic annoyance. Excerpt from the code:
constraint
.slurp_find_string
(⌘E for me).find_next
(⌘G for me).\b\b
(muscle memory from other syntaxes).name-constraint
because according to\b\b
, hyphen is a word delimiter.Addendum: this particular case is solvable by using dots in names:The compiler doesn't let me do that.name.constraint
. In this case, that's a better naming scheme anyway. But this is not viable in all cases, and the dot may end up repurposed for namespacing when imports are added.