Skip to content

Commit 9ae46e2

Browse files
authored
Merge pull request #31 from fdncred/tweak_dark_theme
tweak dark theme, update commands / keywords
2 parents 2e6bd30 + eb81c0b commit 9ae46e2

File tree

7 files changed

+58
-26
lines changed

7 files changed

+58
-26
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,7 @@ All notable changes to the "vscode-nushell-lang" extension will be documented in
5858
* updated screenshots
5959
- 0.2.0
6060
* added intellisense aka auto-complete for commands and subcommands
61-
61+
- 0.2.1
62+
* tweaked the dark theme colors a tiny bit
63+
* updated commands and keywords
6264

nushell.theme-minimal-dark.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"tokenColors": [
55
// "FlatShape__InternalCommand": "#61d6d6", //"Cyan.bold"
66
{
7-
"scope": [ "keyword.control", ],
7+
"scope": [ "keyword.control.nushell", ],
88
"settings": {
99
"foreground": "#61d6d6"
1010
}
@@ -15,7 +15,7 @@
1515
{
1616
"scope": [ "source.nushell", ],
1717
"settings": {
18-
"foreground": "#61d6d6",
18+
"foreground": "#06989a", //#61d6d6
1919
// "fontStyle": "bold"
2020
}
2121
},

out/extension.js

Lines changed: 19 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

out/extension.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-nushell-lang",
33
"displayName": "vscode-nushell-lang",
44
"description": "nushell language for vscode",
5-
"version": "0.2.0",
5+
"version": "0.2.1",
66
"preview": true,
77
"license": "MIT",
88
"publisher": "TheNuProjectContributors",

src/extension.ts

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ export function activate(context: vscode.ExtensionContext) {
154154
const insertCompletion = new vscode.CompletionItem("insert");
155155
insertCompletion.commitCharacters = [" "];
156156

157-
const intoIntCompletion = new vscode.CompletionItem("into-int");
158-
intoIntCompletion.commitCharacters = [" "];
157+
const intoCompletion = new vscode.CompletionItem("into");
158+
intoCompletion.commitCharacters = [" "];
159159

160160
const keepCompletion = new vscode.CompletionItem("keep");
161161
keepCompletion.commitCharacters = [" "];
@@ -404,7 +404,7 @@ export function activate(context: vscode.ExtensionContext) {
404404
ifCompletion,
405405
incCompletion,
406406
insertCompletion,
407-
intoIntCompletion,
407+
intoCompletion,
408408
keepCompletion,
409409
killCompletion,
410410
lastCompletion,
@@ -976,6 +976,32 @@ export function activate(context: vscode.ExtensionContext) {
976976
" "
977977
);
978978

979+
const intoSubCommandsProvider = vscode.languages.registerCompletionItemProvider(
980+
"nushell",
981+
{
982+
provideCompletionItems(
983+
document: vscode.TextDocument,
984+
position: vscode.Position
985+
) {
986+
const linePrefix = document
987+
.lineAt(position)
988+
.text.substr(0, position.character);
989+
if (linePrefix.endsWith("into ")) {
990+
const intoInt = new vscode.CompletionItem(
991+
"int",
992+
vscode.CompletionItemKind.Method
993+
);
994+
intoInt.detail = "Convert value to integer";
995+
996+
return [intoInt];
997+
} else {
998+
return undefined;
999+
}
1000+
},
1001+
},
1002+
" "
1003+
);
1004+
9791005
const keepSubCommandsProvider = vscode.languages.registerCompletionItemProvider(
9801006
"nushell",
9811007
{
@@ -1696,12 +1722,6 @@ export function activate(context: vscode.ExtensionContext) {
16961722
);
16971723
toSqlite.detail = "Convert table into sqlite binary";
16981724

1699-
const toStr = new vscode.CompletionItem(
1700-
"str",
1701-
vscode.CompletionItemKind.Method
1702-
);
1703-
toStr.detail = "";
1704-
17051725
const toToml = new vscode.CompletionItem(
17061726
"toml",
17071727
vscode.CompletionItemKind.Method
@@ -1739,8 +1759,6 @@ export function activate(context: vscode.ExtensionContext) {
17391759
toJson,
17401760
toMd,
17411761
toSqlite,
1742-
toStr,
1743-
toStr,
17441762
toToml,
17451763
toTsv,
17461764
toUrl,
@@ -1811,6 +1829,7 @@ export function activate(context: vscode.ExtensionContext) {
18111829
fromSubCommandsProvider,
18121830
groupBySubCommandsProvider,
18131831
hashSubCommandsProvider,
1832+
intoSubCommandsProvider,
18141833
keepSubCommandsProvider,
18151834
mathSubCommandsProvider,
18161835
pathSubCommandsProvider,

syntaxes/nushell.tmLanguage.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
"patterns": [
1919
{
2020
"name":"keyword.other.nushell",
21-
"match": "\\b(ansi\\sstrip|autoenv\\strust|autoenv\\suntrust|build\\-string|chart\\sbar|char\\sprompt|char\\snewline|chart\\sline|config\\sclear|config\\sget|config\\sload|config\\spath|config\\sremove|config\\sset|config\\sset_into|date\\sformat|date\\slist-timezone|date\\snow|date\\sto-table|date\\sto-timezoneeach\\sgroup|each\\swindow|format\\sfilesize|from\\sbson|from\\scsv|from\\seml|from\\sics|from\\sini|from\\sjson|from\\sods|from\\ssqlite|from\\sssv|from\\stoml|from\\stsv|from\\surl|from\\svcf|from\\sxlsx|from\\sxml|from\\syaml|from\\syml|group-by\\sdate|hash\\sbase64|keep\\suntil|keep\\swhile|math\\sabs|math\\savg|math\\sceil|math\\seval|math\\sfloor|math\\smax|math\\smedian|math\\smin|math\\smode|math\\sproduct|math\\sround|math\\sstddev|math\\ssum|math\\svariance|path\\sbasename|path\\sdirname|path\\sexists|path\\sexpand|path\\sextension|path\\sfilestem|path\\stype|random\\sbool|random\\schars|random\\sdecimal|random\\sdice|random\\sinteger|random\\suuid|seq\\sdate|skip\\suntil|skip\\swhile|split\\schars|split\\scolumn|split\\srow|str\\scamel-case|str\\scapitalize|str\\scollect|str\\scontains|str\\sdowncase|str\\sends-with|str\\sfind-replace|str\\sfrom|str\\sindex-of|str\\skebab-case|str\\slength|str\\slpad|str\\sltrim|str\\spascal-case|str\\sreverse|str\\srpad|str\\srtrim|str\\sscreaming-snake-case|str\\sset|str\\ssnake-case|str\\sstarts-with|str\\ssubstring|str\\sto-datetime|str\\sto-decimal|str\\sto-int|str\\strim|str\\supcase|to\\sbson|to\\scsv|to\\shtml|to\\sjson|to\\smd|to\\ssqlite|to\\stoml|to\\stsv|to\\surl|to\\sxml|to\\syaml|url\\shost|url\\spath|url\\squery|url\\sscheme|term\\ssize)\\b"
21+
"match": "\\b(|into\\sint|ansi\\sstrip|autoenv\\strust|autoenv\\suntrust|build\\-string|chart\\sbar|char\\sprompt|char\\snewline|chart\\sline|config\\sclear|config\\sget|config\\sload|config\\spath|config\\sremove|config\\sset|config\\sset_into|date\\sformat|date\\slist-timezone|date\\snow|date\\sto-table|date\\sto-timezoneeach\\sgroup|each\\swindow|format\\sfilesize|from\\sbson|from\\scsv|from\\seml|from\\sics|from\\sini|from\\sjson|from\\sods|from\\ssqlite|from\\sssv|from\\stoml|from\\stsv|from\\surl|from\\svcf|from\\sxlsx|from\\sxml|from\\syaml|from\\syml|group-by\\sdate|hash\\sbase64|keep\\suntil|keep\\swhile|math\\sabs|math\\savg|math\\sceil|math\\seval|math\\sfloor|math\\smax|math\\smedian|math\\smin|math\\smode|math\\sproduct|math\\sround|math\\sstddev|math\\ssum|math\\svariance|path\\sbasename|path\\sdirname|path\\sexists|path\\sexpand|path\\sextension|path\\sfilestem|path\\stype|random\\sbool|random\\schars|random\\sdecimal|random\\sdice|random\\sinteger|random\\suuid|seq\\sdate|skip\\suntil|skip\\swhile|split\\schars|split\\scolumn|split\\srow|str\\scamel-case|str\\scapitalize|str\\scollect|str\\scontains|str\\sdowncase|str\\sends-with|str\\sfind-replace|str\\sfrom|str\\sindex-of|str\\skebab-case|str\\slength|str\\slpad|str\\sltrim|str\\spascal-case|str\\sreverse|str\\srpad|str\\srtrim|str\\sscreaming-snake-case|str\\sset|str\\ssnake-case|str\\sstarts-with|str\\ssubstring|str\\sto-datetime|str\\sto-decimal|str\\sto-int|str\\strim|str\\supcase|to\\sbson|to\\scsv|to\\shtml|to\\sjson|to\\smd|to\\ssqlite|to\\stoml|to\\stsv|to\\surl|to\\sxml|to\\syaml|url\\shost|url\\spath|url\\squery|url\\sscheme|term\\ssize)\\b"
2222
},
2323
{
24-
"match": "([a-zA-Z]+[\\-_][a-zA-Z]+\\s)|\\b(alias|ansi|append|autoview|benchmark|binaryview|cal|cd|char|clear|clip|compact|count|cp|debug|default|describe|do|drop|du|echo|empty|enter|each|every|exec|exit|format|fetch|first|flatten|get|headers|help|histogram|history|if|inc|insert|into-int|item|index|kill|last|lines|ls|match|merge|mkdir|mod|move|mv|n|nth|open|p|parse|pivot|post|prepend|ps|pwd|range|reduce|reject|rename|reverse|rm|s3|save|select|selector|set|set-env|seq|shells|shuffle|size|sleep|sort-by|source|split-by|start|sys|table|tags|textview|touch|tree|uniq|update|version|where|which|with-env|wrap|xpath)\\b",
24+
"match": "([a-zA-Z]+[\\-_][a-zA-Z]+\\s)|\\b(alias|ansi|append|autoview|benchmark|binaryview|cal|cd|char|clear|clip|compact|count|cp|debug|default|describe|do|drop|du|echo|empty|enter|each|every|exec|exit|format|fetch|first|flatten|get|headers|help|histogram|history|if|inc|insert|item|index|kill|last|lines|ls|match|merge|mkdir|mod|move|mv|n|nth|open|p|parse|pivot|post|prepend|ps|pwd|range|reduce|reject|rename|reverse|rm|s3|save|select|selector|set|set-env|seq|shells|shuffle|size|sleep|sort-by|source|split-by|start|sys|table|tags|textview|touch|tree|uniq|update|version|where|which|with-env|wrap|xpath)\\b",
2525
"name": "keyword",
2626
"captures": {
2727
"2":{

0 commit comments

Comments
 (0)