Skip to content

Commit 26823e9

Browse files
authored
Merge pull request #48 from fdncred/060_tweaks
fixed some bugs
2 parents 8126e99 + 9f2fad2 commit 26823e9

11 files changed

+1261
-1317
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,8 @@ All notable changes to the "vscode-nushell-lang" extension will be documented in
8181
- fixed some bugs with highlighting
8282
- separated keywords for easier regex debugging
8383
- updated dependency versions
84+
- 0.5.1 - TODO
85+
- add `not-in` as a pseudo keyword to go with `in` and `else`
86+
- update screenshots showing else keyword
87+
- add `on-Enter` rules
88+
- fixed a bug with variable syntax coloring

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ This [extension for VSCode](https://code.visualstudio.com/docs/introvideos/exten
44

55
## Features
66

7-
* Syntax highlighting grammar for Nushell scripts (`.nu` files)
8-
* Nushell theme that tries to match Nushell's coloring
7+
- Syntax highlighting grammar for Nushell scripts (`.nu` files)
8+
- Nushell theme that tries to match Nushell's coloring
99

10-
## Screenshot (v0.3.0)
10+
## Screenshot (v0.5.1)
1111

1212
With Nushell-Dark Color Theme
13-
![Nushell script with Nushell color theme](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/032-dark.png)
13+
![Nushell script with Nushell color theme](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/051-dark.png)
1414
With Nushell-Light Color Theme
15-
![Nushell script with VSDark+ color theme](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/032-light.png)
15+
![Nushell script with VSDark+ color theme](https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/assets/051-light.png)
1616

1717
## Known Issues
1818

assets/051-dark.png

94.5 KB
Loading

assets/051-light.png

93.1 KB
Loading

language-configuration.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,11 @@
4040
"indentationRules": {
4141
"increaseIndentPattern": "^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$",
4242
"decreaseIndentPattern": "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"
43-
}
43+
},
44+
"onEnterRules": [
45+
{
46+
"beforeText": "^\\s*(?:alias|def|def-env|else|extern|for|if|let|let-env|with-env).*?:\\s*$",
47+
"action": { "indent": "indent" }
48+
}
49+
]
4450
}
File renamed without changes.

nushell.theme-minimal-dark.json

Lines changed: 78 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"$schema": "vscode://schemas/color-theme",
33
"type": "dark",
4-
// "include": "./dark_vs.json",
4+
// "include": "./dark_vs.json",
55
"tokenColors": [
66
// "FlatShape__InternalCommand": "#61d6d6", //"Cyan.bold"
77
{
8-
"scope": [ "keyword.control.nushell", ],
8+
"scope": ["keyword.control.nushell"],
99
"settings": {
1010
"foreground": "#61d6d6"
1111
}
@@ -14,15 +14,15 @@
1414
// I used this for things like
1515
// alias <this_word> = blah
1616
{
17-
"scope": [ "source.nushell", ],
17+
"scope": ["source.nushell"],
1818
"settings": {
19-
"foreground": "#06989a", //#61d6d6
19+
"foreground": "#06989a" //#61d6d6
2020
// "fontStyle": "bold"
2121
}
2222
},
2323

2424
{
25-
"scope":"keyword.control.other.nushell",
25+
"scope": "keyword.control.other.nushell",
2626
"settings": {
2727
"foreground": "#FF0000",
2828
"fontStyle": "bold"
@@ -31,95 +31,82 @@
3131

3232
// these are the sub commands
3333
{
34-
"scope": [ "keyword.other", ],
34+
"scope": ["keyword.other"],
3535
"settings": {
3636
"foreground": "#00b7ff"
3737
}
3838
},
3939

4040
// "FlatShape__String": "#12820e", //"Green"
4141
{
42-
// "scope": ["string", "meta.embedded.assembly"],
43-
"scope": ["string.quoted"],
42+
// "scope": ["string", "meta.embedded.assembly"],
43+
"scope": ["string.quoted"],
4444
"settings": {
4545
"foreground": "#12820e"
4646
}
4747
},
4848

49-
// "FlatShape__Operator": "#AAAA00", //"Yellow" #c19c00
50-
{
51-
"scope": [
52-
"punctuation.nushell"
53-
],
54-
"settings": {
55-
"foreground": "#c19c00",
56-
// "fontStyle": "bold"
57-
}
58-
},
49+
// "FlatShape__Operator": "#AAAA00", //"Yellow" #c19c00
50+
{
51+
"scope": ["punctuation.nushell"],
52+
"settings": {
53+
"foreground": "#c19c00"
54+
// "fontStyle": "bold"
55+
}
56+
},
5957

60-
// "FlatShape__Comment": "#55FF55", //"Green.bold", #16c60c
61-
{
62-
"scope": [
63-
"comment"
64-
],
65-
"settings": {
66-
"foreground": "#16c60c",
67-
// "fontStyle": "bold"
68-
}
69-
},
58+
// "FlatShape__Comment": "#55FF55", //"Green.bold", #16c60c
59+
{
60+
"scope": ["comment"],
61+
"settings": {
62+
"foreground": "#16c60c"
63+
// "fontStyle": "bold"
64+
}
65+
},
7066

71-
// for range 0..10
72-
{
73-
"scope": [
74-
"constant",
75-
"constant.numeric"
76-
],
77-
"settings": {
78-
"foreground": "#b4009e",
79-
// "fontStyle": "bold"
80-
}
81-
},
67+
// for range 0..10
68+
{
69+
"scope": ["constant", "constant.numeric"],
70+
"settings": {
71+
"foreground": "#b4009e"
72+
// "fontStyle": "bold"
73+
}
74+
},
8275

83-
// "FlatShape__Flag": "#3878ff", //"Blue.bold"
84-
// "FlatShape__ShorthandFlag": "#3878ff", //"Blue.bold"
85-
// for --flag
76+
// "FlatShape__Flag": "#3878ff", //"Blue.bold"
77+
// "FlatShape__ShorthandFlag": "#3878ff", //"Blue.bold"
78+
// for --flag
8679
{
87-
"scope": ["variable.parameter.function"],
88-
"settings": {
89-
"foreground": "#3878ff"
90-
// "fontStyle": "bold"
91-
}
92-
},
80+
"scope": ["variable.parameter.function"],
81+
"settings": {
82+
"foreground": "#3878ff"
83+
// "fontStyle": "bold"
84+
}
85+
},
9386

9487
// "FlatShape__Variable_or_FlatShape__Identifier": "#821791", //"Purple"
9588
{
96-
"scope": [
97-
"variable.name"
98-
],
89+
"scope": ["variable.name", "variable.name.nushell"],
9990
"settings": {
10091
"foreground": "#aa44dd"
10192
}
10293
},
10394

10495
{
105-
"scope": [
106-
"variable.other"
107-
],
108-
"settings": {
109-
"foreground": "#61d6d6"
110-
}
96+
"scope": ["variable.other"],
97+
"settings": {
98+
"foreground": "#61d6d6"
99+
}
111100
},
112101

113-
{
114-
"scope": [
115-
"variable.language"
116-
],
117-
"settings": {
118-
"foreground": "#aa44dd"
119-
}
120-
},
102+
// {
103+
// "scope": ["variable.language"],
104+
// "settings": {
105+
// "foreground": "#aa44dd"
106+
// }
107+
// },
121108

122-
// "FlatShape__Int": "#b4009e", //"Purple.bold"
109+
// "FlatShape__Int": "#b4009e", //"Purple.bold"
123110
// "FlatShape__Decimal": "#b4009e", //"Purple.bold"
124111
{
125112
"scope": [
@@ -131,46 +118,37 @@
131118
"settings": {
132119
"foreground": "#b4009e"
133120
}
134-
},
121+
},
135122

136-
// for def
123+
// for def
137124
{
138-
"scope": [
139-
"entity.name.function"
140-
],
141-
"settings": {
142-
"foreground": "#61d6d6"
143-
}
144-
},
125+
"scope": ["entity.name.function"],
126+
"settings": {
127+
"foreground": "#61d6d6"
128+
}
129+
},
145130

146131
{
147-
"scope": [
148-
"entity.name.type"
149-
],
150-
"settings": {
151-
"foreground": "#f9f1a5"
152-
}
153-
},
154-
155-
// for var:storage_type
156-
{
157-
"scope": [
158-
"storage.type"
159-
],
160-
"settings": {
161-
"foreground": "#a538ff"
162-
}
163-
},
132+
"scope": ["entity.name.type"],
133+
"settings": {
134+
"foreground": "#f9f1a5"
135+
}
136+
},
164137

165-
{
166-
"scope": [
167-
"storage.modifier"
168-
],
169-
"settings": {
170-
"foreground": "#5555FF"
171-
}
172-
},
138+
// for var:storage_type
139+
{
140+
"scope": ["storage.type"],
141+
"settings": {
142+
"foreground": "#a538ff"
143+
}
144+
},
173145

146+
{
147+
"scope": ["storage.modifier"],
148+
"settings": {
149+
"foreground": "#5555FF"
150+
}
151+
}
174152

175153
// {
176154
// "scope": [

0 commit comments

Comments
 (0)