Open JustinAiken opened 8 years ago
I think "logical" is a bad scope name for &.
:
author&.posts
is sort of used as a shorthand of author && author.posts
, they're different in that it only skips the invocations on nil
but not false
&&
for that it's essentially a flow control operator in Ruby (so as &.
).
part in itIs 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?
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
keyword.operator.logical.ruby
If there's an agreement, I'd be happy to open a PR that changes it along with the test