From 786cc4838e38a25706a11b91ab9b01bcda4e89cc Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Fri, 6 Sep 2024 20:56:59 +0200 Subject: [PATCH] More detailed scopes in typescript.scm Part of #210475 --- .../languages/highlights/typescript.scm | 78 ++++++++++++------- 1 file changed, 51 insertions(+), 27 deletions(-) diff --git a/src/vs/editor/common/languages/highlights/typescript.scm b/src/vs/editor/common/languages/highlights/typescript.scm index e50bc9dec9727..4d3be97c14212 100644 --- a/src/vs/editor/common/languages/highlights/typescript.scm +++ b/src/vs/editor/common/languages/highlights/typescript.scm @@ -15,6 +15,8 @@ ; Keywords +("typeof") @keyword.operator.expression.typeof + [ "delete" "in" @@ -22,7 +24,6 @@ "instanceof" "keyof" "of" - "typeof" ] @keyword.operator.expression [ @@ -91,7 +92,7 @@ [ "void" -] @support.type +] @support.type.primitive [ "new" @@ -108,56 +109,79 @@ "?" ] @punctuation.delimiter +[ + "!" + "~" + "===" + "!==" + "&&" + "||" + "??" +] @keyword.operator.logical + [ "-" - "--" - "-=" "+" - "++" - "+=" "*" - "*=" - "**" - "**=" "/" - "/=" "%" - "%=" + "^" +] @keyword.operator.arithmetic + +(binary_expression ([ "<" "<=" + ">" + ">=" +]) @keyword.operator.relational) + +[ + "=" +] @keyword.operator.assignment + +(augmented_assignment_expression ([ + "-=" + "+=" + "*=" + "/=" + "%=" + "^=" + "&=" + "|=" + "&&=" + "||=" + "??=" +]) @keyword.operator.assignment.compound) + +[ + "++" +] @keyword.operator.increment + +[ + "--" +] @keyword.operator.decrement + +[ + "**" + "**=" "<<" "<<=" - "=" "==" - "===" - "!" "!=" - "!==" "=>" - ">" - ">=" ">>" ">>=" ">>>" ">>>=" "~" - "^" "&" "|" - "^=" - "&=" - "|=" - "&&" - "||" - "??" - "&&=" - "||=" - "??=" ] @keyword.operator ; Special identifiers (type_identifier) @entity.name.type +(predefined_type (["string" "boolean" "number"])) @support.type.primitive (predefined_type) @support.type (("const")