From 6fac1652764ee5bbdd09a4500904174cd83c8745 Mon Sep 17 00:00:00 2001 From: Nick Furfaro Date: Fri, 3 Jun 2022 06:03:25 -0600 Subject: [PATCH 1/4] feat: add storage to highlighted words --- syntaxes/sway.tmLanguage.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/sway.tmLanguage.json b/syntaxes/sway.tmLanguage.json index 0fcaad1..9da5db4 100644 --- a/syntaxes/sway.tmLanguage.json +++ b/syntaxes/sway.tmLanguage.json @@ -251,7 +251,7 @@ }, { "comment": "Type declaration", - "begin": "\\b(enum|struct|trait|abi)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", + "begin": "\\b(enum|struct|trait|abi|storage)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", "end": "[\\{\\(;]", "beginCaptures": { "1": { From e07e1aae24ccfa950d62365eb7a0f3ca95cd48a9 Mon Sep 17 00:00:00 2001 From: Nick Furfaro Date: Sun, 5 Jun 2022 08:21:35 -0600 Subject: [PATCH 2/4] Revert "feat: add storage to highlighted words" This reverts commit 6fac1652764ee5bbdd09a4500904174cd83c8745. --- syntaxes/sway.tmLanguage.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/sway.tmLanguage.json b/syntaxes/sway.tmLanguage.json index 9da5db4..0fcaad1 100644 --- a/syntaxes/sway.tmLanguage.json +++ b/syntaxes/sway.tmLanguage.json @@ -251,7 +251,7 @@ }, { "comment": "Type declaration", - "begin": "\\b(enum|struct|trait|abi|storage)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", + "begin": "\\b(enum|struct|trait|abi)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", "end": "[\\{\\(;]", "beginCaptures": { "1": { From b4a357e05d810d139890deee2ab93c76447c3ec2 Mon Sep 17 00:00:00 2001 From: Nick Furfaro Date: Sun, 5 Jun 2022 08:22:54 -0600 Subject: [PATCH 3/4] feat: add storage keyword to highlighted words --- syntaxes/sway.tmLanguage.json | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/syntaxes/sway.tmLanguage.json b/syntaxes/sway.tmLanguage.json index 0fcaad1..567a3d6 100644 --- a/syntaxes/sway.tmLanguage.json +++ b/syntaxes/sway.tmLanguage.json @@ -249,6 +249,36 @@ } } }, + { + "comment": "Type declaration without name", + "begin": "\\b(storage)", + "end": "[\\{\\(;]", + "beginCaptures": { + "1": { + "name": "storage.type.sway" + } + }, + "patterns": [ + { + "include": "#block_comment" + }, + { + "include": "#line_comment" + }, + { + "include": "#type_params" + }, + { + "include": "#core_types" + }, + { + "include": "#pub" + }, + { + "include": "#where" + } + ] + }, { "comment": "Type declaration", "begin": "\\b(enum|struct|trait|abi)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", From 2b4a6aad2ab6b7d52f2e09b703458cdd2225d57e Mon Sep 17 00:00:00 2001 From: Nick Furfaro Date: Mon, 6 Jun 2022 17:46:03 -0600 Subject: [PATCH 4/4] fix: remove where branch --- syntaxes/sway.tmLanguage.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/syntaxes/sway.tmLanguage.json b/syntaxes/sway.tmLanguage.json index 567a3d6..22a5f0c 100644 --- a/syntaxes/sway.tmLanguage.json +++ b/syntaxes/sway.tmLanguage.json @@ -273,9 +273,6 @@ }, { "include": "#pub" - }, - { - "include": "#where" } ] },