From 47ce5ea581f3fe53a31e166c5feac6c64a8a97e4 Mon Sep 17 00:00:00 2001 From: George Fraser Date: Tue, 12 May 2020 21:58:51 -0700 Subject: Color attribute functions --- editors/code/package.json | 7 +++++++ editors/code/rust.tmGrammar.json | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'editors/code') diff --git a/editors/code/package.json b/editors/code/package.json index d899f60e3..d078f7472 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -603,6 +603,10 @@ } ], "semanticTokenModifiers": [ + { + "id": "attribute", + "description": "Style for elements within attributes" + }, { "id": "constant", "description": "Style for compile-time constants" @@ -630,6 +634,9 @@ "attribute": [ "meta.attribute.rust" ], + "function.attribute": [ + "entity.name.function.attribute.rust" + ], "builtinType": [ "support.type.primitive.rust" ], diff --git a/editors/code/rust.tmGrammar.json b/editors/code/rust.tmGrammar.json index aa0811326..cdcd557dc 100644 --- a/editors/code/rust.tmGrammar.json +++ b/editors/code/rust.tmGrammar.json @@ -75,8 +75,13 @@ { "comment": "Attribute", "name": "meta.attribute.rust", - "begin": "#\\!?\\[", + "begin": "#\\!?\\[(\\w*)", "end": "\\]", + "captures": { + "1": { + "name": "entity.name.function.attribute.rust" + } + }, "patterns": [ { "include": "#string_literal" -- cgit v1.2.3