You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmm, I would be willing to try a different word pattern and I think including operators is not a bad idea. Are you saying the new pattern you propose is just the one copied from the syntax file?
For the most part. I've adapted it slightly, as JS regex doesn't support range boolean operations, so it's using negative lookbehind in the operator pattern instead. I've also merged data/type constructor pattern [\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']* and identifier/tyvar pattern [\p{Ll}_][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']* (notice the only difference is in the first range).
FWIW I've patched language-haskell locally, and it works well enough for my purposes (i.e. autocomplete). However, operator pattern picks up things like .., which can be a little annoying sometimes. Perhaps limiting operators to length 3 and up (i.e. use {3,} instead of +) could be beneficial.
Currently, language-haskell sets the word pattern to
language-haskell/src/extension.ts
Line 17 in d20d1c7
Would be nice to use something that matches the syntax definition itself, f.ex.
/(?:[\p{Ll}_\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*)|(?:[\p{S}\p{P}](?<![(),;\[\]`{}_"']))+/u
Feel free to omit operator regex if you feel it's extraneous, I'm on the fence about it.
Side note: numbers are apparently filtered by vscode anyway, so matching on numeric literals is kinda pointless.
The text was updated successfully, but these errors were encountered: