Skip to content
This repository was archived by the owner on Feb 9, 2025. It is now read-only.

Commit 4e7e662

Browse files
committed
1.2.4
- Update to 0.5.x - Add syntax highlighting for argument defaults, units, and URLs
1 parent 3d484ed commit 4e7e662

5 files changed

Lines changed: 71 additions & 17 deletions

File tree

.vscodeignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.vscode/**
2-
.vscode-test/**
2+
.git/**
33
.gitignore
44
colors.txt

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 1.2.4
4+
- Added syntax highlighting for static comments (`/*/ text /*/`) and parsed comments (`/*[ ]*/`).
5+
- Added syntax highlighting for loop indentifiers `$i`, `$v`, and `$v[n]`.
6+
- Added syntax highlighting for default argument content.
7+
- Added syntax highlighting for CSS units.
8+
- Added syntax highlighting for all numeric types.
9+
- Added syntax highlighting for URLs.
10+
311
## 1.2.3
412
- Changed syntax highlighting rules to always apply to `@var`, `@endvar`, and `@const` anywhere in a line
513
- Changed syntax highlighting of `@const` declarations to allow boolean values and to apply syntax highlighting to the value of the constant.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "novasheets",
33
"displayName": "NovaSheets",
4-
"description": "Syntax highligher for NovaSheet files",
4+
"description": "Syntax highlighter for NovaSheets files",
55
"publisher": "Nixinova",
66
"repository": "NovaSheets-vscode",
7-
"version": "1.2.3",
7+
"version": "1.2.4",
88
"engines": {
99
"vscode": "^1.45.0"
1010
},

readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
[![Latest version](https://img.shields.io/github/v/release/Nixinova/NovaSheets-vscode?label=latest&style=flat-square)](https://github.com/Nixinova/NovaSheets-vscode/releases)
22
[![Marketplace version](https://img.shields.io/visual-studio-marketplace/v/Nixinova.novasheets?label=marketplace&style=flat-square)](https://marketplace.visualstudio.com/items/Nixinova.novasheets)
33
[![Last updated](https://img.shields.io/github/release-date/Nixinova/NovaSheets-vscode?label=updated&style=flat-square)](https://github.com/Nixinova/NovaSheets-vscode/releases)
4+
[![Downloads](https://img.shields.io/visual-studio-marketplace/d/Nixinova.novasheets?style=flat-square)](https://marketplace.visualstudio.com/items/Nixinova.novasheets)
5+
[![Installs](https://img.shields.io/visual-studio-marketplace/i/Nixinova.novasheets?style=flat-square)](https://marketplace.visualstudio.com/items/Nixinova.novasheets)
46

5-
This is a [VSCode](https://github.com/microsoft/vscode) extension for [NovaSheets](https://github.com/Nixinova/NovaSheets).
7+
This is a [VSCode](https://github.com/microsoft/vscode) extension for [NovaSheets](https://github.com/Nixinova/NovaSheets) syntax highlighting.
68

79
# Features
810
This extension includes syntax highlighting for NovaSheet syntax, including NovaSheets variables and comments, as well as regular CSS content.

syntaxes/novasheets.tmLanguage.json

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
{
2222
"include": "#separator"
2323
},
24+
{
25+
"include": "#loop_identifier"
26+
},
2427
{
2528
"include": "#comments"
2629
},
@@ -79,13 +82,13 @@
7982
"begin": "(\\$\\()",
8083
"beginCaptures": {
8184
"1": {
82-
"name": "keyword.variable.substitutor.nss"
85+
"name": "constant.character.nss"
8386
}
8487
},
8588
"end": "(\\))",
8689
"endCaptures": {
8790
"1": {
88-
"name": "keyword.variable.substitutor.nss"
91+
"name": "constant.character.nss"
8992
}
9093
},
9194
"patterns": [
@@ -106,7 +109,7 @@
106109
},
107110
{
108111
"match": "\\|+|(?<!@.*|=)=",
109-
"name": "keyword.variable.substitutor.nss"
112+
"name": "constant.character.nss"
110113
},
111114
{
112115
"include": "#variable"
@@ -123,31 +126,60 @@
123126
]
124127
},
125128
"parameter": {
126-
"match": "(\\$\\[)(.+?)(\\|.*?)?(?:(\\s//.+$)|(\\]))",
129+
"match": "(\\$\\[)(.+?)(\\|(.*?))?(?:(\\s//.+$)|(\\]))",
127130
"captures": {
128131
"1": {
129-
"name": "keyword.variable.substitutor.nss"
132+
"name": "constant.character.nss"
130133
},
131134
"2": {
132135
"name": "keyword.control.variable.attribute.nss"
133136
},
134137
"3": {
135-
"name": "invalid.illegal.nss"
138+
"name": "constant.character.nss"
136139
},
137140
"4": {
138-
"name": "comment.inline.nss"
141+
"name": "constant.character.escape.default_argument.nss"
139142
},
140143
"5": {
141-
"name": "keyword.variable.substitutor.nss"
144+
"name": "comment.inline.nss"
145+
},
146+
"6": {
147+
"name": "constant.character.nss"
142148
}
143149
}
144150
},
151+
"loop_identifier": {
152+
"match": "\\$i|\\$v\\[?|(?<=\\$v\\[[^\\]]*?)\\]",
153+
"name": "keyword.variable.identifier.loop.nss"
154+
},
145155
"comments": {
146156
"patterns": [
147157
{
148-
"match": "(?<!:)//.*$",
158+
"match": "##!.*",
159+
"name": "comment.block.documentation"
160+
},
161+
{
162+
"match": "(?<![a-z]+:)//.*$",
149163
"name": "comment.inline.nss"
150164
},
165+
{
166+
"match": "(/\\*/)(.*?)(/\\*/)",
167+
"captures": {
168+
"1": {
169+
"name": "comment.static.nss"
170+
},
171+
"2": {
172+
"name": "markup.italic.content.nss"
173+
},
174+
"3": {
175+
"name": "comment.static.nss"
176+
}
177+
}
178+
},
179+
{
180+
"match": "(/\\*\\[|\\]\\*/)",
181+
"name": "comment.block.css"
182+
},
151183
{
152184
"match": "/\\*.*?\\*/",
153185
"name": "comment.block.css"
@@ -156,6 +188,10 @@
156188
},
157189
"css": {
158190
"patterns": [
191+
{
192+
"match": "[a-z]+://\\w+(\\.\\w+)+(/\\S+?)?(?!\\))",
193+
"name": "markup.underline.link"
194+
},
159195
{
160196
"match": "([^@{}]*){",
161197
"captures": {
@@ -201,7 +237,7 @@
201237
},
202238
{
203239
"match": "!\\s*important",
204-
"name": "string.regexp"
240+
"name": "string.regexp.important.css"
205241
}
206242
]
207243
},
@@ -216,12 +252,20 @@
216252
"name": "keyword.constant.logic.nss"
217253
},
218254
{
219-
"match": "[-:;,.+~^*/!%(){}a-zA-Z]",
220-
"name": "entity.constant.character"
255+
"match": "(?<=\\d\\s*)(em|rem|en|ex|px|pt|pc|cm|mm|m|ft|in|%)\\b",
256+
"name": "constant.numeric.unit.css"
257+
},
258+
{
259+
"match": "\\d+e\\d+",
260+
"name": "constant.numeric.css"
221261
},
222262
{
223-
"match": "[0-9]",
263+
"match": "0x[0-9a-f]*\\.?[0-9a-f]+|0b[01]*\\.?[01]+|0o[0-7]*\\.?[0-7]+|[0-9]*\\.?[0-9]+",
224264
"name": "constant.numeric.css"
265+
},
266+
{
267+
"match": "[-:;,.+~^*/!%(){}a-zA-Z]",
268+
"name": "entity.constant.character"
225269
}
226270
]
227271
}

0 commit comments

Comments
 (0)