-
Notifications
You must be signed in to change notification settings - Fork 145
Ruby code is not getting the right colors. #252
Comments
Atom v1.32.0 enabled a new parsing system by default. If you have specific issues about how the syntax highlighting has changed that you feel are mistakes, please take a look at the open issues on atom/language-ruby. If the specific problem that you're experiencing is not already being tracked there, please open a new issue on that repository. If you think that this issue is related to this theme in particular could you outline what scopes aren't being colored? Tree-sitter is a new grammar system that enables a number of advanced features including more rigorous syntax highlighting, which means more tokens will be detected correctly or more correctly than in the past. This means that colors may change because of this new information. What we're mostly looking for are situations where the underlying scopes of tokens are incorrect, not that the color is different than it was before. Some differences may be expected, such as variables now being recognized the same in every location they appear instead of differently based on the context. In general, we don't consider that a bug. If you want to see how Tree-sitter identifies the token at the current cursor position, you can open the Command Palette using Cmd+Shift+P on macOS or Ctrl+Shift+P on other platforms, then search for and execute "Editor: Log Cursor Syntax Tree Scope". If the scope at the bottom is incorrect, please file an issue and describe what you expected instead. Thanks! |
@Arcanemagus I think everything being identified correctly but is not getting the proper colors. (checked with Log Cursor) Class names, for instance. The color should be is not being applied because it depends on parent container class I guess adding that class is a Thanks! |
I can reproduce this as well. It seems that the example code of class Article < ApplicationRecord
belongs_to :category, optional: true
end doesn't get wrapped with the Is that intentional? It means that all the styling in https://github.com/atom/solarized-dark-syntax/blob/c8a93df669e7a9a8ca062eb35426911bf864ed3b/styles/syntax/ruby.less#L1 doesn't get applied. Versions
I'll move this over to language-ruby. |
Nice! 🙌
Ouch.. sorry, this is embarrassing. 😅 I had some other example code above class Article < ApplicationRecord
belongs_to :category, optional: true
end ... which then probably messed up the highlighting. OK, works also in nightly12. 👍 Closing! And thanks for the checking. @Ben3eeE |
Yes, it seems that Removing it, makes |
Sorry, you're right. The scopes seem to be different:
But it's different for all themes, not just Solarized. Not sure if it's possible to change the Tree-sitter grammar so that it matches TextMate's? I'll re-open it here. It might be a duplicate of any of these tree-sitter . |
IMO the new behavior makes more sense. |
I don't know Ruby so I can't answer this question but if they are you can add them here and change it from language-ruby/grammars/tree-sitter-ruby.cson Line 155 in 0592946
This should be easy to fix by just adding: Here: language-ruby/grammars/tree-sitter-ruby.cson Line 160 in 0592946
Same thing. Add a line for it
Not as easy to fix as the other things.
... PRs are welcome to add these things. |
I believe this can be closed when #291 is merged. |
Description
Ruby code is not getting the right colors.
Light theme seems to be ok.
Steps to Reproduce
Expected behavior: Show the file like this
Actual behavior:
Reproduces how often: Always
Versions
Atom : 1.32.1
Electron: 2.0.9
Chrome : 61.0.3163.100
Node : 8.9.3
apm 2.1.2
npm 6.2.0
node 8.9.3 x64
atom 1.32.1
python 2.7.15+
git 2.19.1
Additional Information
Seems like syntax--ruby class is missing on hierarchy. Switching to Ruby On Rails syntax fix the problem.
The text was updated successfully, but these errors were encountered: