From fc82f6c1d52932d86a29dc7dd7552ca29fb4984e Mon Sep 17 00:00:00 2001 From: Ryan Olson Date: Fri, 2 Nov 2018 20:45:12 -0600 Subject: [PATCH] Fix Tree-Sitter JavaScript highlighting for JSX file This should also apply to standard JavaScript files, but specifically, JSX syntax highlighting has been struggling. --- styles/syntax/_base.less | 4 +++ styles/syntax/javascript.less | 55 ++++++++++++++++++----------------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/styles/syntax/_base.less b/styles/syntax/_base.less index 9d66a1f..e176941 100644 --- a/styles/syntax/_base.less +++ b/styles/syntax/_base.less @@ -40,6 +40,10 @@ color: @green; } +.syntax--meta.syntax--class { + color: @blue; +} + .syntax--entity { &.syntax--name { &.syntax--class, diff --git a/styles/syntax/javascript.less b/styles/syntax/javascript.less index eb5d090..78f6d8e 100644 --- a/styles/syntax/javascript.less +++ b/styles/syntax/javascript.less @@ -1,8 +1,4 @@ .syntax--source.syntax--js { - .syntax--constant { - color: @green; - } - .syntax--comma { color: @syntax-text-color; } @@ -10,14 +6,29 @@ .syntax--support.syntax--class { color: @green; } - - .syntax--entity.syntax--name.syntax--type { - color: @yellow; - } - .syntax--entity.syntax--name { - color: @syntax-text-color; + + .syntax--entity { + &.syntax--name.syntax--type { + color: @yellow; + } + &.syntax--name { + color: @syntax-text-color; + + &.syntax--function { + color: @blue; + } + } + + &.syntax--name.syntax--tag { + color: @blue; + } + + &.syntax--other.syntax--attribute-name { + color: @yellow; + } } + .syntax--meta.syntax--brace { color: @syntax-text-color; } @@ -29,7 +40,7 @@ color: @green; } .syntax--keyword.syntax--control { - color: @green; + color: @orange; } .syntax--keyword.syntax--control.syntax--regexp { color: @cyan; @@ -64,12 +75,9 @@ .syntax--support.syntax--constant { color: @syntax-text-color; } - .syntax--storage { - color: @blue; - } - - .syntax--constant.syntax--numeric { - color: @syntax-text-color; + + .syntax--storage.syntax--modifier { + color: @yellow; } .syntax--punctuation.syntax--terminator.syntax--statement { @@ -85,10 +93,7 @@ .syntax--meta.syntax--brace.syntax--curly { color: @blue; } - .syntax--definition.syntax--begin.syntax--curly, - .syntax--definition.syntax--end.syntax--curly { - color: @blue; - } + .syntax--string.syntax--quoted.syntax--template { .syntax--embedded.syntax--source { color: @syntax-text-color; @@ -97,6 +102,7 @@ } } } + &.syntax--embedded .syntax--entity.syntax--name.syntax--tag { color: @blue; } @@ -106,9 +112,4 @@ color: @orange; } } -} -.syntax--source.syntax--js.syntax--jsx { - .syntax--entity.syntax--name.syntax--tag { - color: @blue; - } -} +} \ No newline at end of file