From 04cd9e404693c8f53d99db0b759a5546038a0624 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 15 Jan 2022 09:22:47 -0800 Subject: [PATCH] Fix space between function call and parentheses. --- RustEnhanced.sublime-syntax | 2 +- tests/syntax-rust/syntax_test_expr.rs | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/RustEnhanced.sublime-syntax b/RustEnhanced.sublime-syntax index 6b4990a0..5d83a8b2 100644 --- a/RustEnhanced.sublime-syntax +++ b/RustEnhanced.sublime-syntax @@ -214,7 +214,7 @@ contexts: scope: punctuation.separator.rust push: after-operator - - match: '\b[[:lower:]_][[:lower:][:digit:]_]*(?=\()' + - match: '\b[[:lower:]_][[:lower:][:digit:]_]*\s*(?=\()' scope: variable.function.rust - match: '{{identifier}}' diff --git a/tests/syntax-rust/syntax_test_expr.rs b/tests/syntax-rust/syntax_test_expr.rs index a3c5d29e..7edb4b21 100644 --- a/tests/syntax-rust/syntax_test_expr.rs +++ b/tests/syntax-rust/syntax_test_expr.rs @@ -167,3 +167,22 @@ a <<= b; //^^^ keyword.operator.assignment a >>= b; //^^^ keyword.operator.assignment + +fn call_expressions() { + call(); +// ^^^^ variable.function +// ^ meta.group punctuation.section.group.begin +// ^ meta.group punctuation.section.group.end +// ^ punctuation.terminator + + call_with_space (); +// ^^^^^^^^^^^^^^^^ meta.function meta.block variable.function +// ^ meta.group punctuation.section.group.begin +// ^ meta.group punctuation.section.group.end + self.method(); +// ^^^^ variable.language +// ^ punctuation.accessor.dot +// ^^^^^^ variable.function +// ^ meta.group punctuation.section.group.begin +// ^ meta.group punctuation.section.group.end +}