From 93eeafc79feaf974d5ef2310e2e4be414ff0bf0b Mon Sep 17 00:00:00 2001
From: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
Date: Wed, 21 Oct 2020 10:38:31 +1100
Subject: [PATCH] fix: require matching hash quantities for raw strings

---
 editors/code/rust.tmGrammar.json | 25 +++----------------------
 1 file changed, 3 insertions(+), 22 deletions(-)

diff --git a/editors/code/rust.tmGrammar.json b/editors/code/rust.tmGrammar.json
index 18fad628884..3be56519511 100644
--- a/editors/code/rust.tmGrammar.json
+++ b/editors/code/rust.tmGrammar.json
@@ -958,28 +958,9 @@
                     ]
                 },
                 {
-                    "comment": "double-quoted raw strings and raw byte strings (no hash)",
+                    "comment": "double-quoted raw strings and raw byte strings",
                     "name": "string.quoted.double.rust",
-                    "begin": "(b?r)(\")",
-                    "beginCaptures": {
-                        "1": {
-                            "name": "string.quoted.byte.raw.rust"
-                        },
-                        "2": {
-                            "name": "punctuation.definition.string.rust"
-                        }
-                    },
-                    "end": "\"",
-                    "endCaptures": {
-                        "0": {
-                            "name": "punctuation.definition.string.rust"
-                        }
-                    }
-                },
-                {
-                    "comment": "double-quoted raw strings and raw byte strings (with hash)",
-                    "name": "string.quoted.double.rust",
-                    "begin": "(b?r)(#+)(\")",
+                    "begin": "(b?r)(#*)(\")",
                     "beginCaptures": {
                         "1": {
                             "name": "string.quoted.byte.raw.rust"
@@ -991,7 +972,7 @@
                             "name": "punctuation.definition.string.rust"
                         }
                     },
-                    "end": "(\")(#+)",
+                    "end": "(\")(\\2)",
                     "endCaptures": {
                         "1": {
                             "name": "punctuation.definition.string.rust"