autocomplete+ vNext, I’d like to find a way to build a regular expression to identify words in a file in a way that is grammar-aware.
I’ve tried using a similar approach to cursor.wordRegExp but this failed pretty badly because it doesn’t take into account things like
- in a css property. (i.e.
text-align would resolve
align as words, but not
It feels like this should be something that is squarely in the wheelhouse of
Grammar, but aside from implementing some pretty crazy logic after tokenizing the body of text - I’m not sure what the right solution is.
This would drastically improve the quality of
autocomplete+ - currently it uses the really basic
/\b\w*[a-zA-Z_-]+\w*\b/g. Aside from being a little too generic, it’s also not unicode aware, which is badness.
/cc @nathansobo @ProbablyCorey @kevinsawicki @thedaniel @maxbrunsfeld (by the way, now would be a great time to review https://github.com/atom-community/autocomplete-plus/pull/186 - it will be shipping in the next 24 hours pending no major objections).