Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Improve TypeScript keyword syntax highlighting (#47435)

Andrew Currier987b140efa11
diff --git a/crates/languages/src/javascript/highlights.scm b/crates/languages/src/javascript/highlights.scm
index 3194b256a94..1a29f0134cf 100644
--- a/crates/languages/src/javascript/highlights.scm
+++ b/crates/languages/src/javascript/highlights.scm
@@ -246,20 +246,13 @@
"as"
"async"
"await"
- "class"
- "const"
"debugger"
"default"
"delete"
- "export"
"extends"
- "from"
- "function"
"get"
- "import"
"in"
"instanceof"
- "let"
"new"
"of"
"set"
@@ -267,11 +260,24 @@
"target"
"typeof"
"using"
- "var"
"void"
"with"
] @keyword
+[
+ "const"
+ "let"
+ "var"
+ "function"
+ "class"
+] @keyword.declaration
+
+[
+ "export"
+ "from"
+ "import"
+] @keyword.import
+
[
"break"
"case"
diff --git a/crates/languages/src/tsx/highlights.scm b/crates/languages/src/tsx/highlights.scm
index a9cac693cea..0f14438b94a 100644
--- a/crates/languages/src/tsx/highlights.scm
+++ b/crates/languages/src/tsx/highlights.scm
@@ -263,37 +263,58 @@
)
[
+ "abstract"
"as"
"async"
"await"
- "class"
- "const"
"debugger"
+ "declare"
"default"
"delete"
- "export"
"extends"
- "from"
- "function"
"get"
- "import"
+ "implements"
"in"
+ "infer"
"instanceof"
"is"
- "let"
+ "keyof"
+ "module"
+ "namespace"
"new"
"of"
+ "override"
+ "private"
+ "protected"
+ "public"
+ "readonly"
"satisfies"
"set"
"static"
"target"
"typeof"
"using"
- "var"
"void"
"with"
] @keyword
+[
+ "const"
+ "let"
+ "var"
+ "function"
+ "class"
+ "enum"
+ "interface"
+ "type"
+] @keyword.declaration
+
+[
+ "export"
+ "from"
+ "import"
+] @keyword.import
+
[
"break"
"case"
diff --git a/crates/languages/src/typescript/highlights.scm b/crates/languages/src/typescript/highlights.scm
index 2e26e25bf79..e38467626fe 100644
--- a/crates/languages/src/typescript/highlights.scm
+++ b/crates/languages/src/typescript/highlights.scm
@@ -383,27 +383,18 @@
"as"
"async"
"await"
- "class"
- "const"
"debugger"
"declare"
"default"
"delete"
- "enum"
- "export"
"extends"
- "from"
- "function"
"get"
"implements"
- "import"
"in"
"infer"
"instanceof"
- "interface"
"is"
"keyof"
- "let"
"module"
"namespace"
"new"
@@ -417,14 +408,29 @@
"set"
"static"
"target"
- "type"
"typeof"
"using"
- "var"
"void"
"with"
] @keyword
+[
+ "const"
+ "let"
+ "var"
+ "function"
+ "class"
+ "enum"
+ "interface"
+ "type"
+] @keyword.declaration
+
+[
+ "export"
+ "from"
+ "import"
+] @keyword.import
+
[
"break"
"case"