Safe Navigation operator (&.) should be an operator
Support for this operator was added in https://github.com/atom/language-ruby/pull/125, but I think it should be classified different:
punctuation.separator.method.ruby- (what it is now)

- (what it is now)
keyword.operator.logical.ruby- This really makes the intent pop out
- Since it's called the "safe navigation operator", it should tokenized as an operator

If there's an agreement, I'd be happy to open a PR that changes it along with the test
I think "logical" is a bad scope name for &.:
- although
author&.postsis sort of used as a shorthand ofauthor && author.posts, they're different in that it only skips the invocations onnilbut notfalse - "logical" is shaky even for
&&for that it's essentially a flow control operator in Ruby (so as&.) - there's also a
.part in it
Is there any way to make progress with this? I don't have syntax highlighting for safe navigation operators in VSCode which uses this language server. Considering this is a few years old, it would be nice!
This issue was addressed for the vscode-ruby library, but it still has not been addressed for the atom/language-ruby library.
Here was the vscode-ruby solution, which I believe is still using TextMate:
{
"comment": "Safe navigation operator",
"match": "(&\\.)\\s*(?![A-Z])",
"captures": {
"1": {
"name": "keyword.operator.logical.ruby"
}
}
},
Can we get this applied to the Tree-sitter version for Atom, so that Safe Nav operators can be highlighted as operators, rather than as methods?