From da5ce254c4d657589409ee95cfe8cdf4133aa55c Mon Sep 17 00:00:00 2001 From: sobolevn Date: Wed, 22 Jan 2025 00:40:29 +0300 Subject: [PATCH] Fix `enum` and `union` in C, closes #32 --- CHANGELOG.md | 4 ++++ test/C.c | 4 ++++ themes/pustota-color-theme.json | 2 ++ 3 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd88d60..9a18f15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to the "pustota" extension will be documented in this file. Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. +## 0.0.22 + +- Improve `C` highlight: fix `union` and `enum`, #32 + ## 0.0.21 - Improve `CSS` highlight: fix `@keyframes` highlight, #30 diff --git a/test/C.c b/test/C.c index e803b68..b88246e 100644 --- a/test/C.c +++ b/test/C.c @@ -23,6 +23,10 @@ struct student float marks; } s; +enum Color chosenColor = GREEN; +struct Point pt = { 10, 20 }; +union DataValue val; + bool object_hash(/*const*/ json_object *j, byte hash[HASH_SIZE]); static void hash_update(hash_ctx * const c, const byte * const b, diff --git a/themes/pustota-color-theme.json b/themes/pustota-color-theme.json index 60c9178..918b2ad 100644 --- a/themes/pustota-color-theme.json +++ b/themes/pustota-color-theme.json @@ -335,6 +335,8 @@ // C: "constant.character.escape.line-continuation.c", // `\` operator "storage.type.struct.c", // `struct` keyword + "storage.type.enum.c", // `enum` + "storage.type.union.c", // `union` // JS: "meta.method.declaration storage.type", // `constructor` // TS: