From 28e743b4d65f2bd92c5de25ad328c7504ca89eed Mon Sep 17 00:00:00 2001
From: ozacod <47009516+ozacod@users.noreply.github.com>
Date: Tue, 10 Feb 2026 03:01:56 +0300
Subject: [PATCH] languages: Add attribute highlighting in C++ (#47825)
Before:
After:
Release Notes:
- Added attribute highlighting in C++
---
crates/languages/src/cpp/highlights.scm | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/crates/languages/src/cpp/highlights.scm b/crates/languages/src/cpp/highlights.scm
index 42ac231b0efa343f37c33eb6005e504e1151f85d..234605409c16a97fa07f126cb79dbd3a1043202d 100644
--- a/crates/languages/src/cpp/highlights.scm
+++ b/crates/languages/src/cpp/highlights.scm
@@ -93,8 +93,17 @@
type: (primitive_type) @type.builtin
(sized_type_specifier) @type.builtin
+; GNU __attribute__
+(attribute_specifier) @attribute
+(attribute_specifier
+ (argument_list
+ (identifier) @attribute))
+
+; C++11 [[attributes]]
+(attribute
+ prefix: (identifier) @attribute)
(attribute
- name: (identifier) @attribute)
+ name: (identifier) @attribute)
((identifier) @constant.builtin
(#match? @constant.builtin "^_*[A-Z][A-Z\\d_]*$"))