Skip to content

Commit

Permalink
1.3.1
Browse files Browse the repository at this point in the history
- Add `<` and `>` as auto-enclosing characters
- Change parser constant syntax from `@const` to `@option`
- Remove `.novasheet` as file extension
- Fix bugs
  • Loading branch information
Nixinova committed Mar 14, 2021
1 parent 37d491d commit 292c421
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 71 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
*.local.*
5 changes: 3 additions & 2 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vscode/**
.git/**
.vscode/
.git/
node_modules/
.gitignore
*.local.*
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.3.1
- Added angle brackets as auto-enclosing characters.
- Changed syntax highlighting of parser constants from `@const` to `@option`.
- Removed `.novasheet` as an applicable file extension.
- Fixed variable syntax highlighting being broken by nested brackets.
- Fixed loop identifier syntax highlighting not being applied.
- Fixed simple breakpoint syntax highlighting not being applied when the width is set to a variable.

## 1.3.0
- Added code formatter.
- Added syntax highlighting for simple breakpoints.
Expand Down
2 changes: 2 additions & 0 deletions language-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
["(", ")"],
["[", "]"],
["{", "}"],
["<", ">"],
["\"", "\""],
["'", "'"]
],
"surroundingPairs": [
["(", ")"],
["[", "]"],
["{", "}"],
["<", ">"],
["\"", "\""],
["'", "'"]
]
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"description": "Syntax highlighter and formatter for NovaSheets files",
"publisher": "Nixinova",
"repository": "NovaSheets-vscode",
"version": "1.3.0",
"version": "1.3.1",
"license": "ISC",
"scripts": {
"compile": "yaml2json syntaxes/novasheets.tmLanguage.yaml --save"
},
"engines": {
"vscode": "^1.49.0"
"vscode": "^1.52.0"
},
"categories": [
"Programming Languages"
Expand All @@ -29,7 +29,6 @@
"nvss"
],
"extensions": [
".novasheet",
".nvss"
],
"configuration": "./language-configuration.json"
Expand Down
9 changes: 5 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
[![Downloads](https://img.shields.io/visual-studio-marketplace/d/Nixinova.novasheets?style=flat-square&logo=visual-studio)](https://marketplace.visualstudio.com/items/Nixinova.novasheets)
[![Installs](https://img.shields.io/visual-studio-marketplace/i/Nixinova.novasheets?style=flat-square&logo=visual-studio)](https://marketplace.visualstudio.com/items/Nixinova.novasheets)

This is a [VSCode](https://github.com/microsoft/vscode) extension for [NovaSheets](https://github.com/Nixinova/NovaSheets) syntax highlighting.
This is a [VSCode](https://github.com/microsoft/vscode) extension for [NovaSheets](https://github.com/NovaSheets/NovaSheets) formatting and syntax highlighting.

# Features
This extension includes syntax highlighting for NovaSheet syntax, including NovaSheets variables and comments, as well as regular CSS content.
This extension includes a code formatter and syntax highlighting for NovaSheets 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).
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/NovaSheets/vscode/releases).

# Usage
Just load a NovaSheets file with valid file extension in VSCode and NovaSheets syntax highlighting should occur. Valid extensions are `.nss.`, `.nss.txt.`, `.novasheet`, and `.novasheets`.
Just load a NovaSheets file with a `.nvss` file extension in VSCode and NovaSheets syntax highlighting should occur.
Format the file using the default formatting command (`Alt+Shift+F` by default).
43 changes: 20 additions & 23 deletions syntaxes/novasheets.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "NovaSheets",
"scopeName": "source.novasheets",
"fileTypes": [
".nvss"
],
"patterns": [
{
"include": "#variables"
Expand All @@ -10,7 +12,7 @@
"include": "#objects"
},
{
"include": "#constant"
"include": "#parser_constant"
},
{
"include": "#simple_breakpoint"
Expand Down Expand Up @@ -46,7 +48,7 @@
]
},
"variable_declaration": {
"match": "(@var)\\s+((?:[^|=)\\]](?!//))+)(\\|(?:[^=)\\]](?!//))+)*(=?)",
"match": "(@var)\\s+((?:[^|=)\\]](?!\\/\\/))+)(\\|(?:[^=)\\]](?!\\/\\/))+)*(=?)",
"captures": {
"1": {
"name": "keyword.variable.declarator.novasheets"
Expand Down Expand Up @@ -105,6 +107,9 @@
{
"include": "#parameter"
},
{
"include": "#loop_identifier"
},
{
"include": "#css"
},
Expand Down Expand Up @@ -168,40 +173,28 @@
}
]
},
"constant": {
"match": "(@const)(?:(\\s+[A-Z_]+)(\\s+(?:[0-9]+|true|false)))?",
"parser_constant": {
"match": "(@option)(?:(\\s+[A-Z_]+)(\\s+(?:[0-9]+|true|false)))?",
"captures": {
"1": {
"name": "keyword.variable.declarator.novasheets"
},
"2": {
"name": "support.type.constant.novasheets"
"name": "support.type.constant..parsernovasheets"
},
"3": {
"name": "keyword.control.constant.value.novasheets"
"name": "keyword.control.constant.parser.value.novasheets"
}
}
},
"simple_breakpoint": {
"match": "(@)\\s*(?:(\\d+)(px))\\s*(\\.\\.+)?\\s*(?:(\\d+)(px))?",
"match": "(@(?!\\w))|\\.{2,}",
"captures": {
"1": {
"name": "keyword.control.at-rule"
},
"2": {
"name": "constant.numeric.css"
},
"3": {
"name": "constant.numeric.unit.css"
},
"4": {
"name": "constant.character.novasheets"
},
"5": {
"name": "constant.numeric.css"
},
"6": {
"name": "constant.numeric.unit.css"
}
}
},
Expand Down Expand Up @@ -277,12 +270,16 @@
"match": "(?<=\\$\\(\\s*@(?:bitwise|boolean|if)[^)]+)(&|\\||!|not|&|and|nand|or|nor|xor|xnor)",
"name": "support.function.bitwise.novasheets"
},
{
"match": "(?<!\\$)\\([^)]*?\\)",
"name": "meta.brackets.novasheets"
},
{
"match": "'[^']*?[^\\\\]'|\"[^\"]*?[^\\\\]\"|\"\"|''",
"name": "string.quoted"
"name": "string.quoted.novasheets"
},
{
"match": "\b(true|false)\b",
"match": "\\b(true|false)\\b",
"name": "keyword.constant.logic.novasheets"
},
{
Expand All @@ -294,7 +291,7 @@
"name": "invalid.color.hash.css"
},
{
"match": "(?<=\\d\\s*)(em|rem|en|ex|px|pt|pc|cm|mm|m|ft|in|%)\b",
"match": "(?<=\\d\\s*)(em|rem|en|ex|px|pt|pc|cm|mm|m|ft|in|%)\\b",
"name": "constant.numeric.unit.css"
},
{
Expand Down
Loading

0 comments on commit 292c421

Please sign in to comment.