From 63446a4f32566e730a27c9237abdaf0e819eecf6 Mon Sep 17 00:00:00 2001 From: Atomie CHEN Date: Sun, 28 Jul 2024 14:56:10 +0800 Subject: [PATCH 1/7] feat: support enclose with backticks --- language-configuration.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/language-configuration.json b/language-configuration.json index a563d9c..7c9df51 100644 --- a/language-configuration.json +++ b/language-configuration.json @@ -16,7 +16,8 @@ ["[", "]"], ["(", ")"], ["\"", "\""], - ["'", "'"] + ["'", "'"], + ["`", "`"] ], // symbols that can be used to surround a selection "surroundingPairs": [ @@ -24,6 +25,7 @@ ["[", "]"], ["(", ")"], ["\"", "\""], - ["'", "'"] + ["'", "'"], + ["`", "`"] ] } \ No newline at end of file From cf00a2e715935de0be531659f213a3bab7913662 Mon Sep 17 00:00:00 2001 From: Atomie CHEN Date: Thu, 8 Aug 2024 21:58:53 +0800 Subject: [PATCH 2/7] feat: add * and _ to surrounding pairs; remove ` from auto closing pairs --- language-configuration.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/language-configuration.json b/language-configuration.json index 7c9df51..80be873 100644 --- a/language-configuration.json +++ b/language-configuration.json @@ -16,8 +16,7 @@ ["[", "]"], ["(", ")"], ["\"", "\""], - ["'", "'"], - ["`", "`"] + ["'", "'"] ], // symbols that can be used to surround a selection "surroundingPairs": [ @@ -26,6 +25,8 @@ ["(", ")"], ["\"", "\""], ["'", "'"], - ["`", "`"] + ["`", "`"], + ["*", "*"], + ["_", "_"] ] } \ No newline at end of file From 5ef94c24f29d0649c3dd69940aeee174eca6d513 Mon Sep 17 00:00:00 2001 From: Atomie CHEN Date: Fri, 9 Aug 2024 17:57:05 +0800 Subject: [PATCH 3/7] feat: support keywords in extra properties (tool and array) --- syntaxes/hprompt.tmLanguage.json | 40 +++++++++++++++++++------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/syntaxes/hprompt.tmLanguage.json b/syntaxes/hprompt.tmLanguage.json index 2c25c48..1d98ea0 100644 --- a/syntaxes/hprompt.tmLanguage.json +++ b/syntaxes/hprompt.tmLanguage.json @@ -99,25 +99,33 @@ ] }, "extra_properties": { - "match": "(\\w+)\\s*=\\s*(\"[^\"]*\"|\\'[^\\']*\\')", - "captures": { - "1": { - "name": "entity.other.attribute-name" - }, - "2": { - "name": "string.quoted", - "patterns": [ - { - "match": "(?<=\")[^\"]*(?=\")", - "name": "string.quoted.double" + "patterns": [ + { + "match": "(\\w+)\\s*=\\s*(\"[^\"]*\"|\\'[^\\']*\\')", + "captures": { + "1": { + "name": "entity.other.attribute-name" }, - { - "match": "(?<=')[^']*(?=')", - "name": "string.quoted.single" + "2": { + "name": "string.quoted", + "patterns": [ + { + "match": "(?<=\")[^\"]*(?=\")", + "name": "string.quoted.double" + }, + { + "match": "(?<=')[^']*(?=')", + "name": "string.quoted.single" + } + ] } - ] + } + }, + { + "match": "(?<=\\s|{|\\$)(tool|array)(?=\\s|}|$)", + "name": "keyword" } - } + ] }, "plain_text": { "match": ".", From 4f0f712200243da6e3bc1e0a5d22d4c2bb7ff58a Mon Sep 17 00:00:00 2001 From: Atomie CHEN Date: Fri, 9 Aug 2024 18:10:26 +0800 Subject: [PATCH 4/7] feat: detect keywords for yaml message format --- syntaxes/hprompt.tmLanguage.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxes/hprompt.tmLanguage.json b/syntaxes/hprompt.tmLanguage.json index 1d98ea0..7bb6885 100644 --- a/syntaxes/hprompt.tmLanguage.json +++ b/syntaxes/hprompt.tmLanguage.json @@ -37,7 +37,7 @@ ] }, "block_yaml": { - "begin": "^(\\$\\w+\\$)[^\\S\\r\\n]*({[^{}]*?type\\s*=[^{}]*})[^\\S\\r\\n]*$", + "begin": "^(\\$\\w+\\$)[^\\S\\r\\n]*({[^{}]*?(?:type\\s*=|(?<=\\s|{|\\$)(?:tool|array)(?=\\s|}|$))[^{}]*})[^\\S\\r\\n]*$", "end": "(?=^(\\$\\w+\\$)[^\\S\\r\\n]*({[^{}]*?})?[^\\S\\r\\n]*$)", "beginCaptures": { "0": { From cab1ac15a6ca82e85ea497135f53959a2359f0cb Mon Sep 17 00:00:00 2001 From: Atomie CHEN Date: Fri, 9 Aug 2024 18:54:25 +0800 Subject: [PATCH 5/7] perf: remove unused regex branch --- syntaxes/hprompt.tmLanguage.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/hprompt.tmLanguage.json b/syntaxes/hprompt.tmLanguage.json index 7bb6885..1989aa8 100644 --- a/syntaxes/hprompt.tmLanguage.json +++ b/syntaxes/hprompt.tmLanguage.json @@ -37,7 +37,7 @@ ] }, "block_yaml": { - "begin": "^(\\$\\w+\\$)[^\\S\\r\\n]*({[^{}]*?(?:type\\s*=|(?<=\\s|{|\\$)(?:tool|array)(?=\\s|}|$))[^{}]*})[^\\S\\r\\n]*$", + "begin": "^(\\$\\w+\\$)[^\\S\\r\\n]*({[^{}]*?(?:type\\s*=|(?<=\\s|{)(?:tool|array)(?=\\s|}))[^{}]*})[^\\S\\r\\n]*$", "end": "(?=^(\\$\\w+\\$)[^\\S\\r\\n]*({[^{}]*?})?[^\\S\\r\\n]*$)", "beginCaptures": { "0": { @@ -122,8 +122,8 @@ } }, { - "match": "(?<=\\s|{|\\$)(tool|array)(?=\\s|}|$)", - "name": "keyword" + "match": "(?<=\\s|{)(tool|array)(?=\\s|})", + "name": "keyword.other" } ] }, From d3874ca2f5be63e235bf9b30dbec335502e75cd2 Mon Sep 17 00:00:00 2001 From: Atomie CHEN Date: Sat, 10 Aug 2024 14:23:32 +0800 Subject: [PATCH 6/7] doc(CHANGELOG): update about v0.2.1 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d44ee1b..1b55c9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to the "vscode-handyllm" extension will be documented in thi Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. +## [0.2.1] - 2024-08-10 + +### Added + +- highlight extra property keywords (`tool` and `array`) for convenience +- add `, * and _ to surrounding pairs + + ## [0.2.0] - 2024-07-05 ### Changed From 4b7caf859ad4d677d27b1fa15d5357f78306aeb6 Mon Sep 17 00:00:00 2001 From: Atomie CHEN Date: Sat, 10 Aug 2024 14:24:37 +0800 Subject: [PATCH 7/7] bump version to v0.2.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c79ef75..6bbbc25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "handyllm", - "version": "0.2.0", + "version": "0.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "handyllm", - "version": "0.2.0", + "version": "0.2.1", "license": "MIT", "dependencies": { "lodash.debounce": "^4.0.8" diff --git a/package.json b/package.json index 99c906d..88b9c4c 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "url": "https://github.com/atomiechen/vscode-handyllm" }, "private": true, - "version": "0.2.0", + "version": "0.2.1", "engines": { "vscode": "^1.66.0" },