Skip to content

Commit

Permalink
1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Nixinova committed Jun 5, 2020
1 parent 9e0f801 commit 552c587
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 102 deletions.
23 changes: 0 additions & 23 deletions CHANGELOG.md

This file was deleted.

10 changes: 0 additions & 10 deletions README.md

This file was deleted.

38 changes: 38 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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.
17 changes: 13 additions & 4 deletions language-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@
"blockComment": [ "/*", "*/" ]
},
"brackets": [
["(", ")"]
["(", ")"],
["[", "]"],
["{", "}"]
],
"autoCloseBefore": ";:.,=}])>` \n\t",
"autoClosingPairs": [
["(", ")"],
["[", "]"],
["{", "}"],
[":", ";"]
["\"", "\""],
["'", "'"]
],
"surroundingPairs": [
["(", ")"],
["[", "]"],
["{", "}"]
]
["{", "}"],
["\"", "\""],
["'", "'"]
],
"indentationRules": {
"decreaseIndentPattern": "^\\s*---\\s*$"
}
}
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
10 changes: 10 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -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.
157 changes: 95 additions & 62 deletions syntaxes/novasheets.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
"scopeName": "source.nss",
"patterns": [
{
"include": "#variables"
"include": "#variable_declaration"
},
{
"include": "#seperator"
"include": "#variable"
},
{
"include": "#parameter"
},
{
"include": "#separator"
},
{
"include": "#comments"
Expand All @@ -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": "(?<!\\||=)(?:\\||=)",
"name": "keyword.variable.substitutor.nss"
},
{
"include": "#variable"
},
{
"include": "#parameter"
},
{
"include": "#css"
},
{
"include": "#other"
}
]
},
"separator": {
"patterns": [
{
"match": "\\s*---\\s*",
"name": "header.seperator.nss"
"parameter": {
"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"
}
]
}
},
"separator": {
"match": "^\\s*---\\s*$",
"name": "header.separator.nss"
},
"comments": {
"patterns": [
{
"match": "(\\s|^)//.+$",
"match": "(?<!:)//.+$",
"name": "comment.inline.nss"
},
{
Expand All @@ -104,15 +129,15 @@
"css": {
"patterns": [
{
"match": "([^@][^{}]*){",
"match": "([^@{}]*){",
"captures": {
"1": {
"name": "entity.other.attribute-name.class.css"
}
}
},
{
"match": "([a-z-]+?([^a-z-; ]*?)[a-z-]+?[^\\\\]):",
"match": "([a-z-]+?(?!\\\\)):(?!//)",
"captures": {
"1": {
"name": "support.type.property-name.css"
Expand All @@ -131,17 +156,21 @@
}
},
{
"match": "@[a-z]+",
"match": "@[a-z-]+",
"name": "keyword.control.at-rule"
},
{
"match": "'.+?[^\\\\]'|\\\".+?[^\\\\]\\\"|\\\"\\\"|''",
"match": "'[^']*?[^\\\\]'|\\\"[^\"]*?[^\\\\]\\\"|\\\"\\\"|''",
"name": "string.quoted"
},
{
"match": "#[0-9a-fA-F]{8}|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3,4}",
"match": "#[0-9a-fA-F]{8}(?![0-9a-fA-F])|#[0-9a-fA-F]{6}(?![0-9a-fA-F])|#[0-9a-fA-F]{3,4}(?![0-9a-fA-F])",
"name": "string.unquoted.color.hash.css"
},
{
"match": "#[0-9a-fA-F]{9,}|#[0-9a-fA-F]{7}|#[0-9a-fA-F]{5}|#[0-9a-fA-F]{1,2}",
"name": "invalid.color.hash.css"
},
{
"match": "!\\s*important",
"name": "string.regexp"
Expand All @@ -151,9 +180,13 @@
"other": {
"patterns": [
{
"match": "[-;,.+*/!%(){}a-zA-Z0-9]",
"match": "[-;,.+*/!%(){}a-zA-Z]",
"name": "entity.constant.character"
},
{
"match": "[0-9]",
"name": "constant.numeric.css"
},
{
"match": ".",
"name": "invalid"
Expand Down

0 comments on commit 552c587

Please sign in to comment.