Skip to content

Commit b744ac6

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 8e2680d + 434de56 commit b744ac6

File tree

5 files changed

+1027
-4570
lines changed

5 files changed

+1027
-4570
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,12 @@ All notable changes to the "vscode-nushell-lang" extension will be documented in
144144
- Snippets (support regex groups) [#130](https://github.com/nushell/vscode-nushell-lang/pull/130)
145145
- Use unique labels for durationWrapper [#133](https://github.com/nushell/vscode-nushell-lang/pull/133)
146146
- Fix TextMate regex that linguist discovered [#137](https://github.com/nushell/vscode-nushell-lang/pull/137)
147+
- 1.7.0
148+
- Fix datetime parsing (@glcraft) [#140](https://github.com/nushell/vscode-nushell-lang/pull/140)
149+
- Fix go-to definition on Windows (@gaetschwartz) [#141](https://github.com/nushell/vscode-nushell-lang/pull/141)
150+
- Don't try to read if file doesn't exist (@gaetschwartz) [#143](https://github.com/nushell/vscode-nushell-lang/pull/143)
151+
- Me forgetting to merge changes (@fdncred) [#145](https://github.com/nushell/vscode-nushell-lang/pull/145)
152+
- npm audit fix (@fdncred) [#147](https://github.com/nushell/vscode-nushell-lang/pull/147)
153+
- Update link (@balupton) [#149](https://github.com/nushell/vscode-nushell-lang/pull/149)
154+
- Fix shebang detection (@adamcstephens) [#151](https://github.com/nushell/vscode-nushell-lang/pull/151)
155+
- use `which` to find `nu` + add icon (@nerditation) [#153](https://github.com/nushell/vscode-nushell-lang/pull/153)

building.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,15 @@ If you have all these tools already installed, you should be able to clone this
3838
## Regex Engine
3939

4040
TIL - VSCode uses regexes for language syntax highlighting in \*.tmLanguage.json files. Those regexes and json are based on Textmate, which uses (and here is the secret-sauce) `oniguruma` flavor of syntax. See the cheat-sheet for the [syntax here](https://github.com/kkos/oniguruma/blob/master/doc/RE). Also there's a rust-crate called `onig` or `rust-onig` if we wanted to write something to help create compatible regular expressions.
41+
42+
## list-to-tree
43+
44+
glcraft wrote a fancy program to create regexes for the extension. Here's the steps to use it.
45+
46+
1. clone and cargo install the tool. https://github.com/glcraft/list-to-tree
47+
2. on windows create a set of commands. `scope commands | where is_builtin == true and is_custom == false | get name | to text | save win-cmds_20230919.txt`
48+
3. on linux create a set of commands. `scope commands | where is_builtin == true and is_custom == false | get name | to text | save lin-cmds_20230919.txt`
49+
4. combine these two files, sort, and uniq them. `open win-cmds_20230919.txt | lines | append (open lin-cmds_20230919.txt | lines) | sort | uniq | save cmds_20230919.txt`
50+
5. run list-to-tree `list-to-tree --input cmds_20230919.txt --format regex`
51+
6. copy-n-paste the results to the `nushell.tmLanguage.json` file in the appropriate place (search for "list-to-tree"). Be careful, this can be tricky.
52+
7. test out the changes with F5 and viewing some scripts.

0 commit comments

Comments
 (0)