From beeba7ad94d54d2f03c2185b9eeea9978db523ed Mon Sep 17 00:00:00 2001 From: Arseniy Terekhin Date: Sun, 12 May 2024 12:11:11 +0300 Subject: [PATCH 1/3] dev: recommend `tmlanguage` extension --- .vscode/extensions.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..2f9fbe2 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "RedCMD.tmlanguage-syntax-highlighter", + ] +} \ No newline at end of file From dfdc091a7d2732f77f4a47db6daec52bcee3745c Mon Sep 17 00:00:00 2001 From: Arseniy Terekhin Date: Sun, 12 May 2024 12:15:34 +0300 Subject: [PATCH 2/3] refactor: format pikchr.tmLanguage.json using tight formatter --- .vscode/settings.json | 3 +- pikchr/codeblock.pikchr.tmLanguage.json | 24 +- pikchr/pikchr.tmLanguage.json | 558 ++++++------------------ 3 files changed, 130 insertions(+), 455 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e6e98e4..43ba2d1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -22,5 +22,6 @@ "Technote", "unstage", "userid" - ] + ], + "tmlanguage-syntax-highlighter.formattingStyle": "tight" } \ No newline at end of file diff --git a/pikchr/codeblock.pikchr.tmLanguage.json b/pikchr/codeblock.pikchr.tmLanguage.json index 4cecf44..fb18d68 100644 --- a/pikchr/codeblock.pikchr.tmLanguage.json +++ b/pikchr/codeblock.pikchr.tmLanguage.json @@ -12,29 +12,15 @@ "begin": "(^|\\G)(\\s*)(.*)", "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", "contentName": "meta.embedded.block.pikchr", - "patterns": [ - { - "include": "source.pikchr" - } - ] + "patterns": [{"include": "source.pikchr"}] } ], "beginCaptures": { - "3": { - "name": "punctuation.definition.markdown" - }, - "4": { - "name": "fenced_code.block.language.markdown" - }, - "5": { - "name": "fenced_code.block.language.attributes.markdown" - } + "3": {"name": "punctuation.definition.markdown"}, + "4": {"name": "fenced_code.block.language.markdown"}, + "5": {"name": "fenced_code.block.language.attributes.markdown"} }, - "endCaptures": { - "1": { - "name": "punctuation.definition.markdown" - } - } + "endCaptures": {"1": {"name": "punctuation.definition.markdown"}} } ], "scopeName": "markdown.pikchr.codeblock" diff --git a/pikchr/pikchr.tmLanguage.json b/pikchr/pikchr.tmLanguage.json index eea7def..ba06edc 100644 --- a/pikchr/pikchr.tmLanguage.json +++ b/pikchr/pikchr.tmLanguage.json @@ -2,36 +2,22 @@ "scopeName": "source.pikchr", "comment": "regexp test https://rubular.com/", "patterns": [ - { - "include": "#statement-list" - } + {"include": "#statement-list"} ], "repository": { "statement-list": { "patterns": [ - { - "include": "#comment" - }, + {"include": "#comment"}, { "begin": "(?<=^|[;:{]|\\*/|\\G)\\s*", "patterns": [ - { - "include": "#statement" - }, - { - "include": "#continuation" - } + {"include": "#statement"}, + {"include": "#continuation"} ], "end": "(?:(? macto is incomplete", "begin": "([$_@a-zA-Z]\\w*)\\s*(\\()", "beginCaptures": { - "1": { - "name": "entity.name.function.pikchr" - }, - "2": { - "name": "punctuation.parenthesis.begin.pikchr" - } + "1": {"name": "entity.name.function.pikchr"}, + "2": {"name": "punctuation.parenthesis.begin.pikchr"} }, "patterns": [ - { - "include": "#whitespace" - }, - { - "include": "#string" - }, - { - "include": "#expr" - }, + {"include": "#whitespace"}, + {"include": "#string"}, + {"include": "#expr"}, { "match": ",", "name": "punctuation.separator.pikchr" @@ -133,65 +79,35 @@ ], "name": "meta.macro.call.pikchr", "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.parenthesis.end.pikchr" - } - } + "endCaptures": {"0": {"name": "punctuation.parenthesis.end.pikchr"}} }, "statement-placename": { "begin": "\\G(:?[A-Z]\\w*|\\$[1-9])[ \\t\\f]*(:)[ \\t\\f]*", "beginCaptures": { - "1": { - "name": "variable.language.place.pikchr" - }, - "2": { - "name": "punctuation.separator.pikchr" - } + "1": {"name": "variable.language.place.pikchr"}, + "2": {"name": "punctuation.separator.pikchr"} }, "patterns": [ - { - "include": "#unnamed-statement" - }, + {"include": "#unnamed-statement"}, { "comment": "insert attributes, for when somebode uses a macro", "include": "#attribute" }, - { - "include": "#position" - } + {"include": "#position"} ], "end": "(?DOT_L->{numproperty,dashproperty,colorproperty}", "match": "\\b(\\.)(diameter|ht|height|radius|rad|thickness|width|wid|dashed|dotted|fill|color)\\b", "captures": { - "1": { - "name": "punctuation.separator.period.pikchr" - }, - "2": { - "name": "support.constant.property-value.pikchr" - } + "1": {"name": "punctuation.separator.period.pikchr"}, + "2": {"name": "support.constant.property-value.pikchr"} } }, { "begin": "(\\()", - "beginCaptures": { - "1": { - "name": "punctuation.parenthesis.begin.pikch" - } - }, - "patterns": [ - { - "include": "#expr" - } - ], + "beginCaptures": {"1": {"name": "punctuation.parenthesis.begin.pikch"}}, + "patterns": [{"include": "#expr"}], "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.parenthesis.end.pikchr" - } - } + "endCaptures": {"1": {"name": "punctuation.parenthesis.end.pikchr"}} } ] }, "object": { "patterns": [ - { - "include": "#objctname" - }, - { - "include": "#nth" - }, + {"include": "#objctname"}, + {"include": "#nth"}, { "patterns": [ { "comment": "dot_u->placename", "match": "(\\.)(:?[A-Z]\\w*)", "captures": { - "1": { - "name": "punctuation.separator.period.pikchr" - }, - "2": { - "name": "entity.name.tag.pikchr" - } + "1": {"name": "punctuation.separator.period.pikchr"}, + "2": {"name": "entity.name.tag.pikchr"} } } ] @@ -421,22 +245,14 @@ "match": "\\bthis\\b", "name": "entity.pikchr" }, - { - "include": "#placename" - } + {"include": "#placename"} ] }, "attribute-then": { "begin": "\\b(?:then|go)\\b", - "beginCaptures": { - "0": { - "name": "keyword.pikchr" - } - }, + "beginCaptures": {"0": {"name": "keyword.pikchr"}}, "patterns": [ - { - "include": "#edge" - }, + {"include": "#edge"}, { "match": "\\bheading\\b", "name": "keyword.pikchr" @@ -459,12 +275,8 @@ { "match": "((?:\\d*\\.)?\\d+(in|cm|px|pt|pc|mm|%)?)\\b", "captures": { - "1": { - "name": "constant.numeric.pikchr" - }, - "2": { - "name": "keyword.other.unit.$2.pikchr" - } + "1": {"name": "constant.numeric.pikchr"}, + "2": {"name": "keyword.other.unit.$2.pikchr"} } } ] @@ -487,30 +299,14 @@ }, "attribute": { "patterns": [ - { - "include": "#dashproperty" - }, - { - "include": "#boolproperty" - }, - { - "include": "#numproperty" - }, - { - "include": "#attribute-then" - }, - { - "include": "#until-even" - }, - { - "include": "#colorproperty-then-rvalue" - }, - { - "include": "#percent-sign" - }, - { - "include": "#string-then-text-attributes" - }, + {"include": "#dashproperty"}, + {"include": "#boolproperty"}, + {"include": "#numproperty"}, + {"include": "#attribute-then"}, + {"include": "#until-even"}, + {"include": "#colorproperty-then-rvalue"}, + {"include": "#percent-sign"}, + {"include": "#string-then-text-attributes"}, { "match": "\\b(:?close|chop|from|to|at|behind)\\b", "name": "keyword.pikchr" @@ -519,12 +315,8 @@ "match": "\\bwith\\b", "name": "keyword.pikchr" }, - { - "include": "#direction" - }, - { - "include": "#position" - } + {"include": "#direction"}, + {"include": "#position"} ] }, "dashproperty": { @@ -546,9 +338,7 @@ "match": "\\b\\d+(?:nd|rd|st|th)", "name": "constant.language.pikchr" }, - { - "include": "#object-class" - } + {"include": "#object-class"} ] }, "object-class": { @@ -577,17 +367,9 @@ }, "string": { "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.pikchr" - } - }, + "beginCaptures": {"0": {"name": "punctuation.definition.string.begin.pikchr"}}, "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.pikchr" - } - }, + "endCaptures": {"0": {"name": "punctuation.definition.string.end.pikchr"}}, "name": "string.quoted.double.pikchr", "patterns": [ { @@ -598,16 +380,8 @@ }, "statement-direction": { "begin": "\\G(?:down|left|right|up)\\b", - "captures": { - "0": { - "name": "support.constant.direction.pikchr" - } - }, - "patterns": [ - { - "include": "#syntax-error" - } - ], + "captures": {"0": {"name": "support.constant.direction.pikchr"}}, + "patterns": [{"include": "#syntax-error"}], "end": "(?", - "beginCaptures": { - "0": { - "name": "punctuation.bracket.angle.begin.pikchr" - } - }, - "endCaptures": { - "0": { - "name": "punctuation.bracket.angle.end.pikchr" - } - }, + "beginCaptures": {"0": {"name": "punctuation.bracket.angle.begin.pikchr"}}, + "endCaptures": {"0": {"name": "punctuation.bracket.angle.end.pikchr"}}, "patterns": [ { "match": ",", "name": "punctuation.separator.pikchr" }, - { - "include": "#position" - } + {"include": "#position"} ] }, - { - "include": "#expr" - } + {"include": "#expr"} ] }, "place": { "patterns": [ - { - "include": "#place2" - }, - { - "include": "#edge" - }, + {"include": "#place2"}, + {"include": "#edge"}, { "comment": "edge-OF-object", "match": "\\bof\\b", @@ -773,33 +483,19 @@ }, "place2": { "patterns": [ - { - "include": "#object" - }, - { - "include": "#dot_e-edge" - }, - { - "include": "#nth" - }, + {"include": "#object"}, + {"include": "#dot_e-edge"}, + {"include": "#nth"}, { "begin": "\\bvertex\\b", - "beginCaptures": { - "0": { - "name": "keyword.pikchr" - } - }, + "beginCaptures": {"0": {"name": "keyword.pikchr"}}, "patterns": [ - { - "match": "[ \\t]+" - }, + {"match": "[ \\t]+"}, { "match": "\\bof\\b", "name": "keyword.pikchr" }, - { - "include": "#comment" - } + {"include": "#comment"} ], "applyEndPatternLast": true, "end": "(?:)" @@ -809,12 +505,8 @@ "dot_e-edge": { "match": "(\\.)(bot|bottom|c|center|e|east|end|left|n|ne|north|nw|right|s|se|south|start|sw|t|top|w|west)\\b", "captures": { - "1": { - "name": "punctuation.separator.period.pikchr" - }, - "2": { - "name": "constant.language.pikchr" - } + "1": {"name": "punctuation.separator.period.pikchr"}, + "2": {"name": "constant.language.pikchr"} } }, "comment": { @@ -833,12 +525,8 @@ "whitespace": { "comment": "match T_WHITESPACE as seen in pikchr.y", "patterns": [ - { - "match": "[ \\t\\f\\r]+" - }, - { - "include": "#comment" - } + {"match": "[ \\t\\f\\r]+"}, + {"include": "#comment"} ] } } From 62ef5a90c99e92ff3556cb47e714e3b1ce7a3290 Mon Sep 17 00:00:00 2001 From: Arseniy Terekhin Date: Sun, 12 May 2024 12:28:48 +0300 Subject: [PATCH 3/3] release: 0.5.7 --- CHANGELOG.md | 11 +++++++++++ docs/dev/release.md | 2 +- package.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f45069d..8b6bf8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +# v0.5.7 + +### What's New + +- add github/git export in a wizard-like style + +### Bug Fix + +- simplify and fixed minor issues in pikchr syntax highlighting + + # v0.5.6 ### What's New diff --git a/docs/dev/release.md b/docs/dev/release.md index d86eb4b..34801fb 100644 --- a/docs/dev/release.md +++ b/docs/dev/release.md @@ -9,7 +9,7 @@ 1. Run tests: `npm run test` 1. Remove out directory: `rm -rf out` 1. Create package (.vsix file): `npm run package` -1. Ensure all files are there: `unzip -l fossil-#.#.#.vsix`. There should only be TWO .js files. +1. Ensure all files are there: `unzip -l fossil-#.#.#.vsix`. There should be FOUR .js files. ## Make commits diff --git a/package.json b/package.json index 9c8b1b2..7ee7835 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "bugs": { "url": "https://github.com/koog1000/vscode-fossil/issues" }, - "version": "0.5.6", + "version": "0.5.7", "engines": { "vscode": "^1.36.0" },