From 4e66fc57bd825eca2e0510a58ff0e4bb6d646df1 Mon Sep 17 00:00:00 2001 From: Dusty Pomerleau Date: Tue, 3 Nov 2020 23:47:15 +1100 Subject: fix: distinguish turbofish function calls from namespaces --- editors/code/rust.tmGrammar.json | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'editors/code') diff --git a/editors/code/rust.tmGrammar.json b/editors/code/rust.tmGrammar.json index 1d11d2c19..77595aa00 100644 --- a/editors/code/rust.tmGrammar.json +++ b/editors/code/rust.tmGrammar.json @@ -544,9 +544,66 @@ { "include": "#lvariables" }, + { + "include": "#constants" + }, + { + "include": "#gtypes" + }, + { + "include": "#functions" + }, + { + "include": "#lifetimes" + }, + { + "include": "#macros" + }, { "include": "#namespaces" }, + { + "include": "#punctuation" + }, + { + "include": "#strings" + }, + { + "include": "#types" + }, + { + "include": "#variables" + } + ] + }, + { + "comment": "function/method calls with turbofish", + "name": "meta.function.call.rust", + "begin": "((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)(?=::<.*>\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.rust" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.brackets.round.rust" + } + }, + "patterns": [ + { + "include": "#block-comments" + }, + { + "include": "#comments" + }, + { + "include": "#keywords" + }, + { + "include": "#lvariables" + }, { "include": "#constants" }, @@ -562,6 +619,9 @@ { "include": "#macros" }, + { + "include": "#namespaces" + }, { "include": "#punctuation" }, -- cgit v1.2.3