Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ dist
# ignore the git mailmap file
.mailmap
client/out
client/testFixture/completion.txt
client/testFixture/diagnostics.txt
client/tsconfig.tsbuildinfo
.vscode-test
out/
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to the "vscode-nushell-lang" extension will be documented in

## Release

- 2.0.6 Release
- Update grammar command list for nushell 0.116.0 [#239](https://github.com/nushell/vscode-nushell-lang/pull/239)
- Fix grammar for filesize units, string escapes, negative timezone offsets, `table<>`/`oneof<>` types, redirection operators, `0b[]`/`0o[]` literals, and `$in` [#239](https://github.com/nushell/vscode-nushell-lang/pull/239)
- Highlight ` ```nu ` code blocks in markdown [#239](https://github.com/nushell/vscode-nushell-lang/pull/239)
- Fix language server start/stop commands, fall back to `nu` on PATH when the configured executable is missing, and remove settings that `nu --lsp` never used [#239](https://github.com/nushell/vscode-nushell-lang/pull/239)
- Remove snippets for commands that no longer exist and fix `export-env` [#239](https://github.com/nushell/vscode-nushell-lang/pull/239)
- Rewrite e2e tests against `nu --lsp` and fix `generate-patterns.nu`/`generate-example.nu` for current nushell [#239](https://github.com/nushell/vscode-nushell-lang/pull/239)
- Syntax highlighting broken for record keys containing brackets [#232](https://github.com/nushell/vscode-nushell-lang/pull/232)
- Syntax highlighting broken for variable declarations with type annotations [#234](https://github.com/nushell/vscode-nushell-lang/pull/234)
- Syntax highlighting broken for bare string values in records [#237](https://github.com/nushell/vscode-nushell-lang/pull/237)
- 2.0.5 Release
- Update `def` syntax [#222](https://github.com/nushell/vscode-nushell-lang/pull/222)
- add `<>` to `autoClosingPairs` [#227](https://github.com/nushell/vscode-nushell-lang/pull/227)
Expand Down
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ If you have all these tools already installed, you should be able to clone this
2. In repo folder `npm install`
3. Hit F5 to start debugging (or Run->Start Debugging menu item)
4. Go to settings with `Ctrl ,` or `Cmd ,`
5. In the settings tree on the left, go to Extensions->Nushell IDE Support and make sure `Nushell Executable Path` is pointing at where you have nu/nu.exe installed. (It must be version 0.79.0 or greater)
5. In the settings tree on the left, go to Extensions->Nushell IDE Support and make sure `Nushell Executable Path` is pointing at where you have nu/nu.exe installed. (The extension talks to `nu --lsp`, so it must be a version that supports it; a current release is recommended.)
6. Open a nushell script and in a moment you should see inlays and see the full functionality
7. To see the Language Server debug messages hit `Ctrl ~`
8. Go to the output tab
Expand All @@ -50,7 +50,13 @@ glcraft wrote a fancy program to create regexes for the extension. Here's the st
1. clone and cargo install the tool. https://github.com/glcraft/list-to-tree
2. on windows create a set of commands. `scope commands | where type == built-in or type == keyword or type == plugin | get name | to text | save win-cmds_20240923.txt`
3. on linux create a set of commands. `scope commands | where type == built-in or type == keyword or type == plugin | get name | to text | save lin-cmds_20240923.txt`
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`
5. run list-to-tree `list-to-tree --input cmds_20230919.txt --format regex`
4. combine these two files, sort, and uniq them. `open win-cmds_20240923.txt | lines | append (open lin-cmds_20240923.txt | lines) | sort | uniq | save cmds_20240923.txt`
5. run list-to-tree `list-to-tree --input cmds_20240923.txt --format regex`
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.
7. test out the changes with F5 and viewing some scripts.

The `generate-patterns.nu` script does steps 5 and 6 for you: `nu generate-patterns.nu --input cmds_20240923.txt` writes the regex into the grammar, and `--dry-run` prints it instead. Without `--input` it uses the commands of the `nu` that runs it, which includes whatever plugins you have registered.

## Grammar tests

`npm run test:grammar` checks the grammar against the snapshots in `tests/cases`. After an intentional grammar change, refresh a snapshot with `npx vscode-tmgrammar-snap --updateSnapshot tests/cases/<file>.nu` and review the diff.
22 changes: 11 additions & 11 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"description": "VSCode part of the nushell language server",
"author": "Nushell Maintainers",
"license": "MIT",
"version": "2.0.3",
"version": "2.0.6",
"publisher": "TheNuProjectContributors",
"repository": {
"type": "git",
"url": "https://github.com/nushell/vscode-nushell-lang"
},
"engines": {
"vscode": "^1.93.0"
"vscode": "^1.110.0"
},
"dependencies": {
"vscode-languageclient": "9.0.1",
Expand All @@ -19,6 +19,6 @@
"devDependencies": {
"@types/vscode": "1.110.0",
"@types/which": "3.0.4",
"@vscode/test-electron": "2.5.2"
"@vscode/test-electron": "3.1.0"
}
}
Loading
Loading