You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
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.
is not being applied because it depends on parent container class syntax--ruby, but that class is missing in the hierarchy.
I guess adding that class is a language-ruby responsibility, or it was before, but if they have changed that class, this package will need to change that styles, right?
If some of the colors still don't look right on the solarized dark theme, but the syntax--ruby classes are being populated on the hierarchy, does that mean this issue needs to go back to the atom/solarized-dark-syntax repository?
@josephchoe does that mean this issue needs to go back to the atom/solarized-dark-syntax repository? @josephchoe I think it's supposed to be like this?
Sorry, you're right. The scopes seem to be different:
Before (TextMate)
After (Tree-sitter)
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. require isn't a keyword; it's a built-in function, so I think support.function is the right scope. If solarized doesn't highlight support.function, then I think a lot of languages are going to look wrong, not just Ruby, because that's the scope used for "special" functions in many languages.
Aren't include and extend built-in functions same as require?
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 exact to match so it's a regex. There are quite a few built in functions that are not scoped.
Activity
Arcanemagus commentedon Nov 8, 2018
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!
cristianstu commentedon Nov 8, 2018
@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
@yellowhttps://github.com/atom/solarized-dark-syntax/blob/c4ed1ac41a5dd2120b912a766f4989e5b346bc33/styles/syntax/ruby.less#L37
is not being applied because it depends on parent container class
syntax--ruby, but that class is missing in the hierarchy.I guess adding that class is a
language-rubyresponsibility, or it was before, but if they have changed that class, this package will need to change that styles, right?Thanks!
simurai commentedon Nov 14, 2018
I can reproduce this as well. It seems that the example code of
doesn't get wrapped with the
syntax--source syntax--rubyclasses on the parent<span>: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.
Ben3eeE commentedon Nov 14, 2018
@simurai The missing
syntax--source syntax--rubyshould be fixed in Atom 1.32.2 and later via 0208636.Which version of the package is nightly12 using?
Ben3eeE commentedon Nov 14, 2018
Running a build from latest master looks like this with solarized-dark-syntax:

simurai commentedon Nov 14, 2018
Nice! 🙌
Ouch.. sorry, this is embarrassing. 😅 I had some other example code above
... which then probably messed up the highlighting. OK, works also in nightly12. 👍 Closing! And thanks for the checking. @Ben3eeE
josephchoe commentedon Nov 19, 2018
If some of the colors still don't look right on the solarized dark theme, but the
syntax--rubyclasses are being populated on the hierarchy, does that mean this issue needs to go back to theatom/solarized-dark-syntaxrepository?For example:
simurai commentedon Nov 20, 2018
Yes, it seems that
requiregets intentionally overridden here: https://github.com/atom/solarized-dark-syntax/blob/74bc0df24ca7493d9d8bcfcaedccb5cc05c2c2f9/styles/syntax/ruby.less#L123-L125Removing it, makes
requireblue. Not sure if that is prefered?josephchoe commentedon Nov 23, 2018
I think it's supposed to be like this? Though I might be remembering wrong.
simurai commentedon Dec 3, 2018
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 .
maxbrunsfeld commentedon Dec 4, 2018
IMO the new behavior makes more sense.
requireisn't a keyword; it's a built-in function, so I thinksupport.functionis the right scope. If solarized doesn't highlightsupport.function, then I think a lot of languages are going to look wrong, not just Ruby, because that's the scope used for "special" functions in many languages.gsmetal commentedon Apr 12, 2019
Hello, any updates here? There are a lot of problems with highlighting on tree sitter. For example:

includeandextendbuilt-in functions same asrequire?superis not highlighted at all.varis highlighted as function, but it's definitely not a function.Edited: I am using atom 1.36.0, it's monokai syntax theme, but that problems on all themes including builtin.
Ben3eeE commentedon Apr 12, 2019
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
exacttomatchso it's a regex. There are quite a few built in functions that are not scoped.language-ruby/grammars/tree-sitter-ruby.cson
Line 155 in 0592946
This should be easy to fix by just adding:
'optional_parameter > identifier': 'variable.parameter.function'Here:
language-ruby/grammars/tree-sitter-ruby.cson
Line 160 in 0592946
Same thing. Add a line for it
'super': 'the-scope.i-want'or'"super"': 'the-scope.i-want'. The one that works is the correct one.Not as easy to fix as the other things.
...
PRs are welcome to add these things.
chbk commentedon Apr 28, 2021
I believe this can be closed when #291 is merged.