From 552c587117c52181e52994f66d8d718e0a87a57e Mon Sep 17 00:00:00 2001 From: Nixinova Date: Sat, 6 Jun 2020 10:01:22 +1200 Subject: [PATCH] 1.2.1 --- CHANGELOG.md | 23 ---- README.md | 10 -- changelog.md | 38 +++++++ language-configuration.json | 17 ++- package.json | 5 +- readme.md | 10 ++ syntaxes/novasheets.tmLanguage.json | 157 +++++++++++++++++----------- 7 files changed, 158 insertions(+), 102 deletions(-) delete mode 100644 CHANGELOG.md delete mode 100644 README.md create mode 100644 changelog.md create mode 100644 readme.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 4dd3316..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,23 +0,0 @@ -# Changelog - -## 1.2.0 -- Added argument syntax highlighting. -- Added error checking for illegal characters. -- Added syntax highlighting for CSS at-rules and `!important`. -- Changed color of variable declarator `@var`. -- Changed internal code to be more semantically correct. -- Changed string parsing to include the quotes in the syntax highlighting. -- Removed numeric syntax highlighting. -- Fixed string parsing allowing alternating quotation marks. - -## 1.1.1 -- Fixed syntax highlighting of comments appearing as variable contents. -- Fixed function and has color syntax highlighting. -- Fixed single quotes not applying quote syntax highlighting. -- Fixed hex colors now having syntax highlighting applied. - -## 1.1.0 -- Replaced themes with direct semantic colorization from the default theme. - -## 1.0.0 -- Added NovaSheets Light & Dark Themes which support syntax highlighting. \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index ad18429..0000000 --- a/README.md +++ /dev/null @@ -1,10 +0,0 @@ -This is a [VSCode](https://github.com/microsoft/vscode) extension for [NovaSheets](https://github.com/Nixinova/NovaSheets). - -# Features -- Syntax highlighting for NovaSheet syntax, including NovaSheets variables and comments as well as CSS content. - -# Installation -This extension is available in the [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=Nixinova.novasheets). - -# Usage -Just load a `.nss` or `.nss.txt` file in VSCode and NovaSheets syntax highlighting should occur. diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..7df3669 --- /dev/null +++ b/changelog.md @@ -0,0 +1,38 @@ +# Changelog + +## 0.2.1 +- Re-added numeric syntax highlighting. +- Added specific syntax highlighting for denoting built-in variables. +- Added `"` and `'` as auto-closing and auto-surrounding pairs. +- Changed argument syntax highlighting to color each segment separately. +- Removed `:`/`;` as auto-closing pairs. +- Fixed nested variables not having proper syntax highlighting applied. +- Fixed URLs having to be prefixed with a space to avoid the protocol being parsed as a property name. +- Fixed comments having to be prefixed with a space to avoid URLs being parsed as comments. +- Fixed the front matter separator `---` not having syntax highlighting applied. +- Fixed CSS at-rule declarators containing hyphens not having proper syntax highlighting applied. +- Fixed single-character strings not being treated as valid. +- Fixed invalid hex colors being treated as valid. +- Fixed general invalid characters now having syntax highlighting applied. + +## 1.2.0 +- Added argument syntax highlighting. +- Added error checking for illegal characters. +- Added syntax highlighting for CSS at-rules and `!important`. +- Changed color of variable declarator `@var`. +- Changed internal code to be more semantically correct. +- Changed string parsing to include the quotes in the syntax highlighting. +- Removed numeric syntax highlighting. +- Fixed string parsing allowing alternating quotation marks. + +## 1.1.1 +- Fixed syntax highlighting of comments appearing as variable contents. +- Fixed syntax highlighting of CSS functions. +- Fixed single quotes not applying quote syntax highlighting. +- Fixed hex colors not having syntax highlighting applied. + +## 1.1.0 +- Replaced themes with direct semantic colorization from the default theme. + +## 1.0.0 +- Added NovaSheets Light & Dark Themes which support syntax highlighting. \ No newline at end of file diff --git a/language-configuration.json b/language-configuration.json index aff5f9a..a0bd88c 100644 --- a/language-configuration.json +++ b/language-configuration.json @@ -4,17 +4,26 @@ "blockComment": [ "/*", "*/" ] }, "brackets": [ - ["(", ")"] + ["(", ")"], + ["[", "]"], + ["{", "}"] ], + "autoCloseBefore": ";:.,=}])>` \n\t", "autoClosingPairs": [ ["(", ")"], ["[", "]"], ["{", "}"], - [":", ";"] + ["\"", "\""], + ["'", "'"] ], "surroundingPairs": [ ["(", ")"], ["[", "]"], - ["{", "}"] - ] + ["{", "}"], + ["\"", "\""], + ["'", "'"] + ], + "indentationRules": { + "decreaseIndentPattern": "^\\s*---\\s*$" + } } \ No newline at end of file diff --git a/package.json b/package.json index f89c88d..04371b6 100644 --- a/package.json +++ b/package.json @@ -4,13 +4,12 @@ "description": "Syntax highligher for NovaSheet files", "publisher": "Nixinova", "repository": "NovaSheets-vscode", - "version": "1.2.0", + "version": "1.2.1", "engines": { "vscode": "^1.45.0" }, "categories": [ - "Programming Languages", - "Themes" + "Programming Languages" ], "contributes": { "languages": [ diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..908cb36 --- /dev/null +++ b/readme.md @@ -0,0 +1,10 @@ +This is a [VSCode](https://github.com/microsoft/vscode) extension for [NovaSheets](https://github.com/Nixinova/NovaSheets). + +# Features +This extension includes syntax highlighting for NovaSheet syntax, including NovaSheets variables and comments, as well as regular CSS content. + +# Installation +This extension is available in the [VSCode Marketplace](https://marketplace.visualstudio.com/items/Nixinova.novasheets); install it either from there, by searching "NovaSheets" inside VSCode, or by downloading the package found in the [releases tab](https://github.com/Nixinova/NovaSheets-vscode/releases). + +# Usage +Just load a `.nss` or `.nss.txt` file in VSCode and NovaSheets syntax highlighting should occur. diff --git a/syntaxes/novasheets.tmLanguage.json b/syntaxes/novasheets.tmLanguage.json index e85c5f4..9b8c566 100644 --- a/syntaxes/novasheets.tmLanguage.json +++ b/syntaxes/novasheets.tmLanguage.json @@ -4,10 +4,16 @@ "scopeName": "source.nss", "patterns": [ { - "include": "#variables" + "include": "#variable_declaration" }, { - "include": "#seperator" + "include": "#variable" + }, + { + "include": "#parameter" + }, + { + "include": "#separator" }, { "include": "#comments" @@ -16,83 +22,102 @@ "include": "#css" }, { - "include": "#patterns" + "include": "#other" } ], "repository": { - "variables": { + "variable_declaration": { + "match": "^\\s*(@var)\\s+([^=)\\]]+?)(\\|[^=)\\]]+?)?(\\s//.+|)$", + "captures": { + "1": { + "name": "keyword.variable.declarator" + }, + "2": { + "name": "support.type.variable.default.nss" + }, + "3": { + "name": "keyword.control.variable.attribute.nss" + }, + "4": { + "name": "comment.inline.nss" + } + } + }, + "variable": { + "begin": "(\\$\\()", + "beginCaptures": { + "1": { + "name": "keyword.variable.substitutor.nss" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "keyword.variable.substitutor.nss" + } + }, "patterns": [ { - "match": "^\\s*(@var)\\s([^\\]=)]+?)(\\|[^\\]=)]+?)?(\\s//.+|)$", + "match": "(?<=\\()(@)?([^|=)]+)(?=\\)|\\|)", "captures": { "1": { - "name": "keyword.variable.declarator" + "name" : "keyword.other.unit.variable.default.nss" }, "2": { - "name": "keyword.other.unit.variable.nsss" - }, - "3": { - "name": "keyword.control.variable.attribute.nss" - }, - "4": { - "name": "comment.inline.nss" + "name": "support.type.variable.default.nss" } } }, { - "match": "(\\$\\()(.+?)(\\|.*?)?(?:(\\s//.+$)|(\\)))", - "captures": { - "1": { - "name": "keyword.variable.substitutor.nss" - }, - "2": { - "name": "keyword.other.unit.variable.nss" - }, - "3": { - "name": "keyword.control.variable.attribute.nss" - }, - "4": { - "name": "comment.inline.nss" - }, - "5": { - "name": "keyword.variable.substitutor.nss" - } - } + "match": "[^|=]+?(?==)", + "name": "keyword.control.variable.attribute.nss" }, { - "match": "(\\$\\[)(.+?)(\\|.*?)?(?:(\\s//.+$)|(\\]))", - "captures": { - "1": { - "name": "keyword.variable.substitutor.nss" - }, - "2": { - "name": "keyword.control.variable.attribute.nss" - }, - "3": { - "name": "invalid.illegal.nss" - }, - "4": { - "name": "comment.inline.nss" - }, - "5": { - "name": "keyword.variable.substitutor.nss" - } - } + "match": "(?