-
Notifications
You must be signed in to change notification settings - Fork 286
Syntax highlighting issue with safe navigation operator #288
Comments
In case this helps: This issue might be related to / a dupe of #283. |
I'm going to guess that it is but until I'm sure I'm going to leave this open. I haven't gotten a chance to dive into this yet but my guess is the grammar doesn't have explicit support for that syntax given it is relatively new. Edit: yep, atom/language-ruby#167 confirms there's an issue with the scope. I'll dig in from this angle first. |
Confirmed, and it's quite annoying. Do we have any indications that this is going to be fixed any time soon? |
The indicator is the Atom issue linked above. Until semantic syntax highlighting lands in the language server protocol highlighting is based on coded grammars. As Atom is the upstream grammar for us, they need to fix so I can pull it in. |
According to this PR, they have support for the safe navigation operator since 2015: atom/language-ruby#125 Is there an easy way to enable it for this extension? |
It is already in the grammar https://github.com/rubyide/vscode-ruby/blob/master/syntaxes/ruby.cson.json#L2111-L2119 |
@wingrunr21 He added some lines in a coffee script file. Can this be the cause to this issue? |
The issue described in the original post is still present, though! My editor matches the screen shots. Variables using |
@minkir014 Potentially. VSCode activates grammars based on the detected language type at the bottom and whether that language declares other languages can be "embedded". If that parent language doesn't declare embedded languages then there's not much that can be done from a highlighting perspective. @bbugh |
Your environment
vscode-ruby
version: 0.17.0Expected behavior
When calling a method on a variable using the safe navigation operator (
&.
), the variable should be highlighted.Actual behavior
The variable is not highlighted.
Steps to reproduce the problem
Trivial:
![screen shot 2018-03-10 at 10 55 20 pm](https://user-images.githubusercontent.com/23086931/37247083-2e1b911a-24b6-11e8-91b7-d877692ee4aa.png)
The text was updated successfully, but these errors were encountered: