From 7c1ae0aa3d04a6f307b8c4c9d7880877ed251841 Mon Sep 17 00:00:00 2001 From: Zedritsch Date: Mon, 15 Jan 2024 13:28:37 +0100 Subject: [PATCH] Added temporary fix for variable highlighting --- CHANGELOG.md | 4 +++ package.json | 24 +++++++++++---- syntax/laye.tmLanguage.json | 58 +++++++++++++++++++++++++++---------- 3 files changed, 65 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a315e4..adde8b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +## v0.1.8 +### Bug fixes +* False highlighting of variables inside an expression + ## v0.1.7 ### Additions * Invalid numbers are highlighted diff --git a/package.json b/package.json index 4976448..8514562 100644 --- a/package.json +++ b/package.json @@ -4,21 +4,33 @@ "description": "Laye support for Visual Studio Code", "publisher": "laye-lang", "license": "MIT", - "version": "0.1.7", + "version": "0.1.8", "icon": "images/icon.png", "repository": { "type": "git", "url": "https://github.com/laye-lang/laye-vscode" }, - "engines": { "vscode": "^1.75.0" }, - "categories": [ "Programming Languages" ], - "keywords": [ "Laye", "laye" ], + "engines": { + "vscode": "^1.75.0" + }, + "categories": [ + "Programming Languages" + ], + "keywords": [ + "Laye", + "laye" + ], "contributes": { "languages": [ { "id": "laye", - "aliases": [ "Laye", "laye" ], - "extensions": [ ".laye" ], + "aliases": [ + "Laye", + "laye" + ], + "extensions": [ + ".laye" + ], "icon": { "dark": "images/dark.png", "light": "images/light.png" diff --git a/syntax/laye.tmLanguage.json b/syntax/laye.tmLanguage.json index a6c9961..f6664c7 100644 --- a/syntax/laye.tmLanguage.json +++ b/syntax/laye.tmLanguage.json @@ -1,17 +1,39 @@ { "name": "Laye", "patterns": [ - { "include": "#punctuation" }, - { "include": "#comment" }, - { "include": "#keyword" }, - { "include": "#operator" }, - { "include": "#number" }, - { "include": "#string" }, - { "include": "#namespace" }, - { "include": "#type" }, - { "include": "#function" }, - { "include": "#variable.readonly" }, - { "include": "#variable" } + { + "include": "#punctuation" + }, + { + "include": "#comment" + }, + { + "include": "#keyword" + }, + { + "include": "#operator" + }, + { + "include": "#number" + }, + { + "include": "#string" + }, + { + "include": "#namespace" + }, + { + "include": "#type" + }, + { + "include": "#function" + }, + { + "include": "#variable.readonly" + }, + { + "include": "#variable" + } ], "repository": { "punctuation": { @@ -37,7 +59,9 @@ "begin": "`", "end": "`", "patterns": [ - { "include": "$self" } + { + "include": "$self" + } ] }, { @@ -123,7 +147,9 @@ "name": "constant.character.escape.laye", "match": "\\\\\"" }, - { "include": "#escape" }, + { + "include": "#escape" + }, { "name": "constant.other.placeholder.laye", "match": "%[\\+#]*\\d*(?:\\.\\d+)?(?:hh|ll|l)?[%EGXc-gopsux]" @@ -143,7 +169,9 @@ "name": "constant.character.escape.laye", "match": "\\\\'" }, - { "include": "#escape" }, + { + "include": "#escape" + }, { "name": "invalid.laye", "match": "\\\\." @@ -158,7 +186,7 @@ }, "type": { "name": "entity.name.type.laye", - "match": "(?<=\\b(?:alias|const|enum|struct|variant)\\s+)[0-9A-Z_a-z]+\\b|(?)?[\\s&*?\\[\\]]*[0-9A-Z_a-z{])|(?<=<(?:[\\s,0-9A-Z_a-z]+,)?\\s*)[0-9A-Z_a-z]+(?=\\s*[,>])" + "match": "(?<=\\b(?:alias|const|enum|struct|variant)\\s+)[0-9A-Z_a-z]+\\b|(?)?[&*?\\[\\]]*\\s*[0-9A-Z_a-z{])|(?<=<(?:[\\s,0-9A-Z_a-z]+,)?\\s*)[0-9A-Z_a-z]+(?=\\s*[,>])" }, "function": { "name": "entity.name.function.laye",