-
Notifications
You must be signed in to change notification settings - Fork 236
Tree-sitter missing variable.language scope #618
Comments
@maxbrunsfeld can you give some more information here? |
Ok, #620 added back the scope for I'll leave this issue open because of the 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 |
@chbk You might be pleased to know: I developed a hackish solution to inject highlighting for # Extend the JavaScript tree-sitter grammar with additional highlighting
extendJavaScriptTSGrammar = ->
# All Atom grammars are loaded asynchronously, so use setImmediate() to
# ensure that the JS grammar is only modified when it has fully loaded
setImmediate ->
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() |
Description
this
,super
,arguments
anddefault
used to bevariable.language.js
. There is no corresponding scope with tree-sitter.Steps to Reproduce
Expected behavior:
arguments
,this
,super
anddefault
should bevariable.language.js
.Actual behavior:
arguments
,this
,super
anddefault
aresource.js
.Versions
Atom : 1.32.1
Electron: 2.0.9
Chrome : 61.0.3163.100
Node : 8.9.3
The text was updated successfully, but these errors were encountered: