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.
Ok, #620 added back the scope for arguments and super. The default keyword is intentionally highlighted as keyword.control.
I'll leave this issue open because of the this variable. We're intentionally not highlighting this as language.variable because it causes this to be highlighted the same as object properties in most themes, and that was something we wanted to fix when updating from TextMate to Tree-sitter.
We have a PR open to figure out a different color for these kinds of special variables. When we finish that, we'll circle back here and update this to use that class.
@chbk You might be pleased to know: I developed a hackish solution to inject highlighting for this and super into the built-in language-javascript grammar. This absolves you of any need to fork the language-javascript package, compile tree-sitter grammars, or rebuild Atom. Just place the following code in your init.coffee:
# Extend the JavaScript tree-sitter grammar with additional highlightingextendJavaScriptTSGrammar=-># All Atom grammars are loaded asynchronously, so use setImmediate() to# ensure that the JS grammar is only modified when it has fully loadedsetImmediate->jsGrammar=atom.grammars.treeSitterGrammarsById['source.js']
if jsGrammar
# Colorize `this`, `super`, and `arguments` in red (like other language keywords)jsGrammar.scopeMap.addSelector('this', 'variable.language.js')
jsGrammar.scopeMap.addSelector('super', 'variable.language.js')
jsGrammar.scopeMap.addSelector('super', 'variable.language.js')
jsGrammar.scopeMap.addSelector('identifier', {
match:/^arguments$/,
scopes:'variable.language.js'
});
extendJavaScriptTSGrammar()
Activity
lee-dohm commentedon Nov 13, 2018
@maxbrunsfeld can you give some more information here?
maxbrunsfeld commentedon Nov 13, 2018
Ok, #620 added back the scope for
argumentsandsuper. Thedefaultkeyword is intentionally highlighted askeyword.control.I'll leave this issue open because of the
thisvariable. We're intentionally not highlightingthisaslanguage.variablebecause it causesthisto be highlighted the same as object properties in most themes, and that was something we wanted to fix when updating from TextMate to Tree-sitter.We have a PR open to figure out a different color for these kinds of special variables. When we finish that, we'll circle back here and update
thisto use that class.caleb531 commentedon Mar 31, 2019
@chbk You might be pleased to know: I developed a hackish solution to inject highlighting for
thisandsuperinto the built-in language-javascript grammar. This absolves you of any need to fork the language-javascript package, compile tree-sitter grammars, or rebuild Atom. Just place the following code in yourinit.coffee: