Improve syntax highlights (#18728)

狐狸 created

Closes #18722

- Replace the `@escape` capture name with `@string.escape` for escape
sequences in Go, Python, Regex, Racket, Ruby, and Scheme.
- Rust
  - Add syntax highlighting for escape sequences. Close #18722
- Fix the issue where `@punctuation.delimiter` is being overwritten by
`@operator`.
  - Add the period (".") to `@punctuation.delimiter`.

Release Notes:

- N/A

Change summary

crates/languages/src/go/highlights.scm            | 2 +-
crates/languages/src/python/highlights.scm        | 2 +-
crates/languages/src/regex/highlights.scm         | 2 +-
crates/languages/src/rust/highlights.scm          | 7 +++----
extensions/racket/languages/racket/highlights.scm | 2 +-
extensions/ruby/languages/ruby/highlights.scm     | 2 +-
extensions/scheme/languages/scheme/highlights.scm | 2 +-
7 files changed, 9 insertions(+), 10 deletions(-)

Detailed changes

crates/languages/src/rust/highlights.scm 🔗

@@ -65,6 +65,7 @@
   ">" @punctuation.bracket)
 
 [
+  "."
   ";"
   ","
   "::"
@@ -121,6 +122,8 @@
   (char_literal)
 ] @string
 
+(escape_sequence) @string.escape
+
 [
   (integer_literal)
   (float_literal)
@@ -147,20 +150,16 @@
   "&&"
   "*"
   "*="
-  "*"
   "+"
   "+="
-  ","
   "-"
   "-="
   "->"
-  "."
   ".."
   "..="
   "..."
   "/="
   ":"
-  ";"
   "<<"
   "<<="
   "<"