The model (form language-configuration.json) accepts '-' as long as it is surrounded by '\w'.
However, the editor still uses '-' as word boundary. This combination sounds counter-intuitive, but works okish with highlighting: the model is used to find the initial word, and the editor then finds "whole" words by using the separators. This means that --foo-bar finds other foo-bars (and, more importantly, foo-bar also finds --foo-bar). However, it also means that foo-bar-gee will now also be highlighted for the foo-bar part.
A correct solution will use the LSP, which can provide a good list of the identifiers that are relevant. (Initially maybe just all identifiers that would match).
The model (form language-configuration.json) accepts '-' as long as it is surrounded by '\w'.
However, the editor still uses '-' as word boundary. This combination sounds counter-intuitive, but works okish with highlighting: the model is used to find the initial word, and the editor then finds "whole" words by using the separators. This means that
--foo-bar
finds otherfoo-bar
s (and, more importantly,foo-bar
also finds--foo-bar
). However, it also means thatfoo-bar-gee
will now also be highlighted for thefoo-bar
part.A correct solution will use the LSP, which can provide a good list of the identifiers that are relevant. (Initially maybe just all identifiers that would match).