Skip to content

Commit

Permalink
1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nixinova committed Jun 1, 2020
1 parent 6621405 commit 9e0f801
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
colors.txt
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode/**
.vscode-test/**
.gitignore
colors.txt
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# 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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is a [VSCode](https://github.com/microsoft/vscode) extension for [NovaSheet
- Syntax highlighting for NovaSheet syntax, including NovaSheets variables and comments as well as CSS content.

# Installation
Search "NovaSheets" in the VSCode Marketplace ([direct link](https://marketplace.visualstudio.com/items?itemName=Nixinova.novasheets)), then click "Install".
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.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Syntax highligher for NovaSheet files",
"publisher": "Nixinova",
"repository": "NovaSheets-vscode",
"version": "1.1.1",
"version": "1.2.0",
"engines": {
"vscode": "^1.45.0"
},
Expand Down
125 changes: 95 additions & 30 deletions syntaxes/novasheets.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,94 +4,159 @@
"scopeName": "source.nss",
"patterns": [
{
"include": "#keywords"
"include": "#variables"
},
{
"include": "#seperator"
},
{
"include": "#comments"
},
{
"include": "#css"
},
{
"include": "#patterns"
}
],
"repository": {
"keywords": {
"variables": {
"patterns": [
{
"match": "^\\s*(@var)\\s(.+?)(\\s//.+|)$",
"match": "^\\s*(@var)\\s([^\\]=)]+?)(\\|[^\\]=)]+?)?(\\s//.+|)$",
"captures": {
"1": {
"name": "keyword.control.at-rule.media.css"
"name": "keyword.variable.declarator"
},
"2": {
"name": "keyword.other.unit.css"
"name": "keyword.other.unit.variable.nsss"
},
"3": {
"name": "comment.block.css"
"name": "keyword.control.variable.attribute.nss"
},
"4": {
"name": "comment.inline.nss"
}
}
},
{
"match": "(\\$\\()(.+?)(?:(\\s//.+$)|(\\)))",
"match": "(\\$\\()(.+?)(\\|.*?)?(?:(\\s//.+$)|(\\)))",
"captures": {
"1": {
"name": "entity.name.tag.wildcard.css"
"name": "keyword.variable.substitutor.nss"
},
"2": {
"name": "keyword.other.unit.css"
"name": "keyword.other.unit.variable.nss"
},
"3": {
"name": "comment.block.css"
"name": "keyword.control.variable.attribute.nss"
},
"4": {
"name": "entity.name.tag.wildcard.css"
"name": "comment.inline.nss"
},
"5": {
"name": "keyword.variable.substitutor.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"
}
}
}
]
},
"separator": {
"patterns": [
{
"match": "\\s*---\\s*",
"name": "header"
},
"name": "header.seperator.nss"
}
]
},
"comments": {
"patterns": [
{
"match": "(\\s|^)//.+$",
"name": "comment.block.css"
"name": "comment.inline.nss"
},
{
"match": "/\\*.+\\*/",
"name": "comment.block.css"
},
{
"match": "[0-9]+",
"name": "constant.numeric.css"
},
}
]
},
"css": {
"patterns": [
{
"match": "(.+){",
"match": "([^@][^{}]*){",
"captures": {
"1": {
"name": "entity.other.attribute-name.class.css"
}
}
},
{
"match": "([a-z-]+):",
"match": "([a-z-]+?([^a-z-; ]*?)[a-z-]+?[^\\\\]):",
"captures": {
"1": {
"name": "support.type.property-name.css"
},
"2": {
"name": "invalid.illegal.css"
}
}
},
{
"match": "(?:\\\"|')(.+)?(?:\\\"|')",
"match": "([a-z-]+)\\s*\\(",
"captures": {
"1": {
"name": "string.quoted.double.css"
"name": "support.function.css"
}
}
},
{
"match": "([a-z-]+)\\s*\\(",
"captures": {
"1": {
"name": "support.function.misc.css"
}
}
"match": "@[a-z]+",
"name": "keyword.control.at-rule"
},
{
"match": "'.+?[^\\\\]'|\\\".+?[^\\\\]\\\"|\\\"\\\"|''",
"name": "string.quoted"
},
{
"match": "#[0-9a-fA-F]{8}|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3,4}",
"name": "support.constant.color.current.css"
"name": "string.unquoted.color.hash.css"
},
{
"match": "!\\s*important",
"name": "string.regexp"
}
]
},
"other": {
"patterns": [
{
"match": "[-;,.+*/!%(){}a-zA-Z0-9]",
"name": "entity.constant.character"
},
{
"match": ".",
"name": "invalid"
}
]
}
Expand Down

0 comments on commit 9e0f801

Please sign in to comment.