├── .eslintrc.js
├── .eslintrc.json
├── .gitattributes
├── .github
└── workflows
│ ├── package.yml
│ └── release.yml
├── .gitignore
├── .prettierignore
├── .prettierrc
├── .vscode
├── extensions.json
├── launch.json
├── settings.json
└── tasks.json
├── .vscodeignore
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── assets
├── 003.png
├── 004-nushell.png
├── 004-vsdark.png
├── 012-dark.png
├── 012-light.png
├── 032-dark.png
├── 032-light.png
├── 051-dark.png
├── 051-light.png
├── 070-dark.png
├── 070-light.png
├── 100-dark.png
├── 100-light.png
├── 150-completions.png
├── 150-dark.png
├── 150-error1.png
├── 150-error2.png
├── 150-error3.png
├── 150-ext-settings.png
├── 150-goto-def.png
├── 150-hover-builtin.png
├── 150-hover-custom.png
├── 150-hover-var.png
├── 150-inlays.png
├── 150-light.png
├── 150_inlays.png
├── nu.svg
└── nushell.ico
├── client
├── package-lock.json
├── package.json
├── src
│ ├── extension.ts
│ └── test
│ │ ├── completion.test.ts
│ │ ├── diagnostics.test.ts
│ │ ├── helper.ts
│ │ ├── index.ts
│ │ └── runTest.ts
└── tsconfig.json
├── eslint.config.js
├── example.nu
├── generate-example.nu
├── generate-patterns.nu
├── language-configuration.json
├── nushell.theme-minimal-dark.json
├── nushell.theme-minimal-light.json
├── package-lock.json
├── package.json
├── scripts
└── e2e.sh
├── snippets
├── convention.md
└── nushell.json
├── syntaxes
├── codeblock.json
└── nushell.tmLanguage.json
├── tests
└── cases
│ ├── function.nu
│ └── function.nu.snap
├── tsconfig.json
├── used_keywords.jsonc
└── webpack.config.js
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | // .eslintrc.js
2 | module.exports = {
3 | // ...other config
4 | ignorePatterns: [
5 | 'node_modules/**',
6 | 'client/node_modules/**',
7 | 'client/out/**',
8 | 'server/node_modules/**',
9 | 'server/out/**',
10 | ],
11 | };
12 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/.eslintrc.json
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Set default behavior to automatically normalize line endings.
2 | * text=auto
3 |
4 | # Example of a `.gitattributes` file which reclassifies `.nu` files as Nushell:
5 | *.nu linguist-language=Nushell
6 |
7 |
--------------------------------------------------------------------------------
/.github/workflows/package.yml:
--------------------------------------------------------------------------------
1 | # This is a basic workflow to help you get started with Actions
2 |
3 | name: CI
4 |
5 | # Controls when the action will run.
6 | on:
7 | # Triggers the workflow on push or pull request events but only for the main branch
8 | push:
9 | branches: [main]
10 | pull_request:
11 | branches: [main]
12 |
13 | # Allows you to run this workflow manually from the Actions tab
14 | workflow_dispatch:
15 |
16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel
17 | jobs:
18 | # This workflow contains a single job called "build"
19 | build:
20 | # The type of runner that the job will run on
21 | runs-on: ubuntu-latest
22 |
23 | # Steps represent a sequence of tasks that will be executed as part of the job
24 | steps:
25 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26 | - uses: actions/checkout@v2
27 | - run: npm install
28 | - uses: lannonbr/vsce-action@master
29 | with:
30 | args: 'package'
31 |
32 | # Runs a single command using the runners shell
33 | # - name: Run a one-line script
34 | # run: echo Hello, world!
35 |
36 | # Runs a set of commands using the runners shell
37 | # - name: Run a multi-line script
38 | # run: |
39 | # echo Add other actions to build,
40 | # echo test, and deploy your project.
41 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | # This is a basic workflow to help you get started with Actions
2 |
3 | #name: Release
4 |
5 | # Controls when the action will run.
6 | #on:
7 | # Triggers the workflow on push or pull request events but only for the main branch
8 | #push:
9 | # branches: [ main ]
10 | #pull_request:
11 | # branches: [ main ]
12 |
13 | name: Create And Upload Release Asset
14 |
15 | on:
16 | push:
17 | # Sequence of patterns matched against refs/tags
18 | tags:
19 | - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
20 |
21 | # Allows you to run this workflow manually from the Actions tab
22 | workflow_dispatch:
23 |
24 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel
25 | jobs:
26 | # This workflow contains a single job called "build"
27 | build:
28 | # The type of runner that the job will run on
29 | runs-on: ubuntu-latest
30 |
31 | # Steps represent a sequence of tasks that will be executed as part of the job
32 | steps:
33 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
34 | - uses: actions/checkout@v2
35 | - run: npm install
36 |
37 | #- name: Current NPM Package Version
38 | #- uses: justincy/npm-version-action@2.1.0
39 | # id: info
40 | #- run: echo '${{ steps.info.outputs.version }}'
41 |
42 | - name: Retrieve information from package.json
43 | uses: myrotvorets/info-from-package-json-action@1.1.0
44 | id: ver
45 |
46 | - uses: lannonbr/vsce-action@master
47 | with:
48 | args: 'package'
49 |
50 | - name: Create Release
51 | id: create_release
52 | uses: actions/create-release@v1
53 | env:
54 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55 | with:
56 | tag_name: ${{ github.ref }}
57 | release_name: ${{ steps.ver.outputs.packageVersion }} Release
58 | draft: true
59 | prerelease: true
60 |
61 | - name: Upload Release Asset
62 | id: upload-release-asset
63 | uses: actions/upload-release-asset@v1
64 | env:
65 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66 | with:
67 | upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
68 | #asset_path: ${{ steps.publishOpenVSX.outputs.vsixPath }} # Need to get this version number dynamically
69 | asset_path: ./vscode-nushell-lang-${{ steps.ver.outputs.packageVersion }}.vsix # Need to get this version number dynamically
70 | asset_name: vscode-nushell-lang-${{ steps.ver.outputs.packageVersion }}.vsix
71 | asset_content_type: application/vsix
72 |
73 | # Note: Probably should publish VS Marketplace first since, OpenVSX is proved working.
74 | #- name: Publish to Visual Studio Marketplace
75 | # uses: HaaLeo/publish-vscode-extension@v1
76 | # with:
77 | # pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
78 | # registryUrl: https://marketplace.visualstudio.com
79 | # extensionFile: ${{ steps.publishOpenVSX.outputs.vsixPath }}
80 |
81 | # Note: This works but you can't unpublish something so if the next thing fails, you're just stuck.
82 | - name: Publish to Open VSX Registry
83 | uses: HaaLeo/publish-vscode-extension@v1
84 | id: publishOpenVSX
85 | with:
86 | pat: ${{ secrets.OPEN_VSX_TOKEN }}
87 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
3 | *.vsix
4 | .DS_Store
5 | # ignore the git mailmap file
6 | .mailmap
7 | client/out
8 | client/testFixture/completion.txt
9 | client/testFixture/diagnostics.txt
10 | client/tsconfig.tsbuildinfo
11 | .vscode-test
12 | out/
13 | server/tsconfig.tsbuildinfo
14 | tsconfig.tsbuildinfo
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | # Ignore artifacts:
2 | build
3 | coverage
4 | out
5 | used_keywords.jsonc
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/prettierrc",
3 | "singleQuote": true
4 | }
5 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3 | // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4 |
5 | // List of extensions which should be recommended for users of this workspace.
6 | "recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
7 | }
8 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | // A launch configuration that compiles the extension and then opens it inside a new window
2 | {
3 | "version": "0.2.0",
4 | "configurations": [
5 | {
6 | "type": "extensionHost",
7 | "request": "launch",
8 | "name": "Launch Client",
9 | "runtimeExecutable": "${execPath}",
10 | "args": ["--extensionDevelopmentPath=${workspaceRoot}"],
11 | "preLaunchTask": {
12 | "type": "npm",
13 | "script": "compile"
14 | }
15 | },
16 | {
17 | "name": "Language Server E2E Test",
18 | "type": "extensionHost",
19 | "request": "launch",
20 | "runtimeExecutable": "${execPath}",
21 | "args": [
22 | "--extensionDevelopmentPath=${workspaceRoot}",
23 | "--extensionTestsPath=${workspaceRoot}/client/out/test/index",
24 | "${workspaceRoot}/client/testFixture"
25 | ]
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.insertSpaces": false,
3 | "typescript.tsc.autoDetect": "off",
4 | "typescript.preferences.quoteStyle": "single",
5 | "editor.codeActionsOnSave": {
6 | "source.fixAll.eslint": "explicit"
7 | },
8 | "editor.formatOnSave": true,
9 | "editor.defaultFormatter": "esbenp.prettier-vscode"
10 | }
11 |
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | // See https://go.microsoft.com/fwlink/?LinkId=733558
2 | // for the documentation about the tasks.json format
3 | {
4 | "version": "2.0.0",
5 | "tasks": [
6 | {
7 | "type": "npm",
8 | "script": "compile",
9 | "group": "build",
10 | "presentation": {
11 | "panel": "dedicated",
12 | "reveal": "never"
13 | },
14 | "problemMatcher": ["$tsc"]
15 | },
16 | {
17 | "type": "npm",
18 | "script": "watch",
19 | "isBackground": true,
20 | "group": {
21 | "kind": "build",
22 | "isDefault": true
23 | },
24 | "presentation": {
25 | "panel": "dedicated",
26 | "reveal": "never"
27 | },
28 | "problemMatcher": ["$tsc-watch"]
29 | }
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/.vscodeignore:
--------------------------------------------------------------------------------
1 | .vscode/**
2 | .vscode-test/**
3 |
4 | client/**
5 | server/**
6 |
7 | **/tsconfig.json
8 | **/*.ts
9 |
10 | scripts/**
11 | node_modules/**
12 |
13 | .gitignore
14 | .eslintignore
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | All notable changes to the "vscode-nushell-lang" extension will be documented in this file.
4 |
5 | ## Pre-Release
6 |
7 | - Initial release 0.0.1
8 | - proof of concept release
9 | - 0.0.2
10 | - tweak sytnax highlighting
11 | - 0.0.3
12 | - changed `set` to `let` since the language changed
13 | - 0.0.4
14 | - changed line comment from `//` to `#`
15 | - updated readme screenshot and issue link
16 | - added all current nushell keywords
17 | - added all current nushell sub commands
18 | - fixed `[$var` bug
19 | - fixed `foo-bar` bug
20 | - 0.0.5
21 | - updated screenshot with different themes
22 | - reorganized code a bit
23 | - 0.0.6
24 | - fixed `my-ls` highlighting bug
25 | - added build ci and release pipeline
26 | - readme updates from `waldyrious` ty!
27 | - moved assets to a folder
28 | - 0.0.7
29 | - made release work dynamically with versions
30 | - added icon
31 | - 0.0.8
32 | - added ansi strip
33 | - added term size
34 | - added mod
35 | - fixed bug in escapes
36 | - fixed build-string
37 | - added alias
38 | - added char prompt
39 | - added char newline
40 | - added format
41 | - added $it.item
42 | - added $it.index
43 | - 0.0.9
44 | - renamed dark theme to Nushell-Dark
45 | - added light theme named Nushell-Light
46 | - 0.1.0
47 | - tweaked some dark colors
48 | - added source color for dark color
49 | - changed double quote regex
50 | - 0.1.1
51 | - added def snippet for custom command
52 | - added defp snippet for custom command with a parameter
53 | - added defs snippet for custom command with a switch
54 | - added alias snippet for alias creation
55 | - 0.1.2
56 | - added search keywords in package.json
57 | - added publisher name
58 | - updated screenshots
59 | - 0.2.0
60 | - added intellisense aka auto-complete for commands and subcommands
61 | - 0.2.1
62 | - tweaked the dark theme colors a tiny bit
63 | - updated commands and keywords
64 | - 0.2.2
65 | - fixed a regression in syntax highlighting (thanks yume-chan)
66 | - 0.3.0
67 | - updated commands to support all commands in nushell 0.32.0
68 | - updated intellisense to support all commands in nushell 0.32.0
69 | - added block parameter syntax highlighting
70 | - 0.4.0
71 | - updated commands to support all commands in nushell 0.34.1
72 | - disabled intellisense completions
73 | - 0.4.1
74 | - syntax changed to allow optional `$` in variable name
75 | - syntax changed to allow space after custom command parameters
76 | - added `in` to go with `for`
77 | - 0.4.2
78 | - added contribute custom terminal feature it is easier to use nushell as a terminal in vscode
79 | - 0.5.0
80 | - updated language to support 0.60.0 new keywords
81 | - fixed some bugs with highlighting
82 | - separated keywords for easier regex debugging
83 | - updated dependency versions
84 | - 0.5.1
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
89 | - 0.5.2
90 | - add `true`, `false`, and `null` as pseudo keywords
91 | - changed the indentation rules
92 | - 0.5.3
93 | - updated language punctuation recognition
94 | - added the ability to recognize block parameters as variables
95 | - split out part of the readme.md into building.md
96 | - 0.6.0
97 | - Thanks to @Yethal we have a new syntax generating script to help making releases easier
98 | - Another item @Yethal contributed was a script to generate examples to test the syntax on
99 | - Other general cleanup
100 | - Supports most recent nushell syntax as of 0.66.4
101 | - @schuelermine fixed a type-o
102 | - 0.7.0
103 | - better automatic syntax from @Yethal
104 | - better block variable highlighting
105 | - remove themes + some cleanup
106 | - tweak auto-generated syntax
107 | - 0.8.0
108 | - added path for arm brew @melMass
109 | - update readme screenshots
110 | - add the old dark and light themes to repo for anyone who wants to use them
111 | - update example.nu for testing
112 | - update generate-example.nu to include all samples
113 | - update generate-patterns.nu to support the new language features
114 | - update language syntax to support new nushell 0.72 features (break, continue, return, loop, try, catch, mut, while, err>, out>, err+out>, out+err>)
115 | - 1.0.0
116 | - Thanks to Gabin Lefranc (@glcraft) for a total rewrite of the textmate grammar for nushell!!
117 | - 1.1.0
118 | - Updated syntax to match nushell 0.77.0
119 | - Added a new path to search for nu [#82](https://github.com/nushell/vscode-nushell-lang/pull/82)
120 | - Fixed `use` syntax highlighting [#79](https://github.com/nushell/vscode-nushell-lang/pull/79)
121 | - Added nu icon [#77](https://github.com/nushell/vscode-nushell-lang/pull/77)
122 | - Added additional scoop location [#75](https://github.com/nushell/vscode-nushell-lang/pull/75)
123 |
124 | ## Release
125 |
126 | - 1.5.0
127 | - No longer a preview release
128 | - Fix `use` coloring when used in variable naming
129 | - Allow underscore separators in numbers
130 | - Goto Definition
131 | - Inlays / Hints
132 | - Hover
133 | - Error squigglys
134 | - Auto-complete
135 | - Editor IDE Settings to help configure some features
136 | - Added folding regions with `# region:` and `# endregion`
137 | - Update syntax regexes to match nushell v0.79.0
138 | - 1.5.1
139 | - Awesome new snippets by @EmilySeville7cfg [#116](https://github.com/nushell/vscode-nushell-lang/pull/116) [#119](https://github.com/nushell/vscode-nushell-lang/pull/119) [#121](https://github.com/nushell/vscode-nushell-lang/pull/121)
140 | - 1.6.0
141 | - Snippets (completions) [#126](https://github.com/nushell/vscode-nushell-lang/pull/126)
142 | - Snippets (markdown doc sections) [#127](https://github.com/nushell/vscode-nushell-lang/pull/127)
143 | - Snippets (use H3 header) [#128](https://github.com/nushell/vscode-nushell-lang/pull/128)
144 | - Snippets (support regex groups) [#130](https://github.com/nushell/vscode-nushell-lang/pull/130)
145 | - Use unique labels for durationWrapper [#133](https://github.com/nushell/vscode-nushell-lang/pull/133)
146 | - 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)
156 | - 1.7.1
157 | - Update to nushell 0.85.0 (@fdncred) [#155](https://github.com/nushell/vscode-nushell-lang/pull/155)
158 | - update textmate `def --env`, `def --wrapped`, input/output types (@glcraft) [#160](https://github.com/nushell/vscode-nushell-lang/pull/160)
159 | - 1.8.0
160 | - automatically publish extension to open vsx registry on release (@Yakiyo) [#161](https://github.com/nushell/vscode-nushell-lang/pull/161)
161 | - More conditional and loop snippets (@EmilyGraceSeville7cf) [#165](https://github.com/nushell/vscode-nushell-lang/pull/165)
162 | - Syntax highlight: add "export" to "module" (@glcraft) [#166](https://github.com/nushell/vscode-nushell-lang/pull/166)
163 | - Improve type parsing in function def (@glcraft) [#167](https://github.com/nushell/vscode-nushell-lang/pull/167)
164 | - Textmate improvements (@glcraft) [#168](https://github.com/nushell/vscode-nushell-lang/pull/168)
165 | - Textmate: improvement on record entries and closure (@glcraft) [#169](https://github.com/nushell/vscode-nushell-lang/pull/169)
166 | - 1.9.0
167 | - Add spread to syntax highlighting [#174](https://github.com/nushell/vscode-nushell-lang/pull/174)
168 | - fix markdown formatting for hover lsp [#175](https://github.com/nushell/vscode-nushell-lang/pull/175)
169 | - update grammar for nushell 0.91.0 [#177](https://github.com/nushell/vscode-nushell-lang/pull/177)
170 | - 1.10.0
171 | - Remove / and \ from wordPattern [#186](https://github.com/nushell/vscode-nushell-lang/pull/186)
172 | - Add support for def my-function syntax highlighting and add tests to it [#182](https://github.com/nushell/vscode-nushell-lang/pull/182)
173 | - add prettier to dev deps [#181](https://github.com/nushell/vscode-nushell-lang/pull/181)
174 | - 2.0.0 Pre-Release
175 | - Syntax highlighting in markdown code blocks [#195](https://github.com/nushell/vscode-nushell-lang/pull/195)
176 | - Fix vulnerabilities detected by npm audit [#193](https://github.com/nushell/vscode-nushell-lang/pull/193)
177 | - Add CONTRIBUTING.md [#194](https://github.com/nushell/vscode-nushell-lang/pull/194)
178 | - Support raw strings [#197](https://github.com/nushell/vscode-nushell-lang/pull/197)
179 | - Remove irrelevant autoClosingPair /\*\* [#198](https://github.com/nushell/vscode-nushell-lang/pull/198)
180 | - Improve highlighting of bare and raw strings, and add missing unit & operator [#199](https://github.com/nushell/vscode-nushell-lang/pull/199)
181 | - Add operators 'has' & 'has-not', and shorten operators-word regex [#201](https://github.com/nushell/vscode-nushell-lang/pull/201)
182 | - Support floats, binary & octal literals (with underscores) [#200](https://github.com/nushell/vscode-nushell-lang/pull/200)
183 | - Use LSP instead of legacy --ide-\* parameters [#207](https://github.com/nushell/vscode-nushell-lang/pull/207)
184 | - 2.0.3 Pre-Release
185 | - Add ability to start and stop lsp [#210](https://github.com/nushell/vscode-nushell-lang/pull/210)
186 | - Better JSONRPC logging [#211](https://github.com/nushell/vscode-nushell-lang/pull/211)
187 | - Fix some lints [#213](https://github.com/nushell/vscode-nushell-lang/pull/213)
188 | - 2.0.4 Pre-Release
189 | - Don't auto-reveal output panel [#219](https://github.com/nushell/vscode-nushell-lang/pull/219)
190 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | Thank you for considering contributing!
4 |
5 | ## Regex Engine
6 |
7 | VSCode uses a regular expressions engine that is based on Ruby for syntax highlighting.
8 | [This Rubular site is good site](https://rubular.com/) to test and try out these regular expressions because it uses Ruby which supports `oniguruma` flavor of regular expressions.
9 |
10 | ## Original Build Process
11 |
12 | We pretty much followed [these instructions](https://code.visualstudio.com/api/get-started/your-first-extension) for building this extension.
13 | And [this link](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) for packaging the extension.
14 |
15 | To summarize, the steps were:
16 |
17 | 1. `npm install -g yo generator-code`
18 | 2. `yo code`
19 | 3. choose "New Language Support" and fill out the rest of the questions
20 | 4. `npm install -g vsce`
21 | 5. update the `README.md` and `package.json`
22 | 6. `vsce package`
23 | 7. `code --install-extension vscode-nushell-lang-0.0.2.vsix`
24 | (Alternatively, you can do Ctrl/Cmd-Shift-P and type "Extensions:Install From VSIX...")
25 |
26 | If you have all these tools already installed, you should be able to clone this repo and just run `vsce package` to get a `.vsix` file that you can install in vscode.
27 |
28 | ## Build for Development
29 |
30 | 1. Clone this repo
31 | 2. In repo folder `npm install`
32 | 3. Hit F5 to start debugging (or Run->Start Debugging menu item)
33 | 4. Go to settings with `Ctrl ,` or `Cmd ,`
34 | 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)
35 | 6. Open a nushell script and in a moment you should see inlays and see the full functionality
36 | 7. To see the Language Server debug messages hit `Ctrl ~`
37 | 8. Go to the output tab
38 | 9. In the combo box on the right, choose `Nushell Language Server`. You should now see debug messaging as the client and server communicate
39 |
40 | Instead of using VS Code, you can run `npm run compile` manually.
41 |
42 | ## Regex Engine
43 |
44 | 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.
45 |
46 | ## list-to-tree
47 |
48 | glcraft wrote a fancy program to create regexes for the extension. Here's the steps to use it.
49 |
50 | 1. clone and cargo install the tool. https://github.com/glcraft/list-to-tree
51 | 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`
52 | 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`
53 | 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`
54 | 5. run list-to-tree `list-to-tree --input cmds_20230919.txt --format regex`
55 | 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.
56 | 7. test out the changes with F5 and viewing some scripts.
57 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 - 2023 The Nushell Project Developers
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # vscode-nushell-lang VSCode extension
2 |
3 | [](https://marketplace.visualstudio.com/items?itemName=TheNuProjectContributors.vscode-nushell-lang)
4 | [](https://marketplace.visualstudio.com/items?itemName=TheNuProjectContributors.vscode-nushell-lang)
5 | [](https://marketplace.visualstudio.com/items?itemName=TheNuProjectContributors.vscode-nushell-lang)
6 |
7 | This [extension for VSCode](https://marketplace.visualstudio.com/items?itemName=TheNuProjectContributors.vscode-nushell-lang) provides editing, syntax highlighting, and IDE support for [Nushell](http://nushell.sh), a data-driven document language.
8 |
9 | ## Features
10 |
11 | - Syntax highlighting grammar for Nushell scripts (`.nu` files) and ``nushell`` codeblocks in Markdown files
12 | - Goto definition
13 | - Hover support
14 | - Validation (errors with red squiggly lines)
15 | - Auto-complete built-in commands
16 | - Inlays / Hints
17 | - Configuration via vscode settings
18 |
19 | ## Screenshot (v1.5.0)
20 |
21 | With Dark+ Color Theme
22 |
23 | 
24 |
25 | With Light+ Color Theme
26 |
27 | 
28 |
29 | Inlays / Hints
30 |
31 | 
32 |
33 | Completions support
34 |
35 | 
36 |
37 | Hover over built-ins for help
38 |
39 | 
40 |
41 | Hover over custom commands for help
42 |
43 | 
44 |
45 | Hover over variable
46 |
47 | 
48 |
49 | Error & Validation support
50 |
51 | 
52 | 
53 | 
54 |
55 | Goto Definition support
56 |
57 | 
58 |
59 | Extension Settings
60 |
61 | 
62 |
63 | ## Known Issues
64 |
65 | See [our Github repository](https://github.com/nushell/vscode-nushell-lang/issues) for active issues.
66 |
67 | ## Help
68 |
69 | We are happily accepting pull requests to make this better. :)
70 |
--------------------------------------------------------------------------------
/assets/003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/003.png
--------------------------------------------------------------------------------
/assets/004-nushell.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/004-nushell.png
--------------------------------------------------------------------------------
/assets/004-vsdark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/004-vsdark.png
--------------------------------------------------------------------------------
/assets/012-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/012-dark.png
--------------------------------------------------------------------------------
/assets/012-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/012-light.png
--------------------------------------------------------------------------------
/assets/032-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/032-dark.png
--------------------------------------------------------------------------------
/assets/032-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/032-light.png
--------------------------------------------------------------------------------
/assets/051-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/051-dark.png
--------------------------------------------------------------------------------
/assets/051-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/051-light.png
--------------------------------------------------------------------------------
/assets/070-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/070-dark.png
--------------------------------------------------------------------------------
/assets/070-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/070-light.png
--------------------------------------------------------------------------------
/assets/100-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/100-dark.png
--------------------------------------------------------------------------------
/assets/100-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/100-light.png
--------------------------------------------------------------------------------
/assets/150-completions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/150-completions.png
--------------------------------------------------------------------------------
/assets/150-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/150-dark.png
--------------------------------------------------------------------------------
/assets/150-error1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/150-error1.png
--------------------------------------------------------------------------------
/assets/150-error2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/150-error2.png
--------------------------------------------------------------------------------
/assets/150-error3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/150-error3.png
--------------------------------------------------------------------------------
/assets/150-ext-settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/150-ext-settings.png
--------------------------------------------------------------------------------
/assets/150-goto-def.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/150-goto-def.png
--------------------------------------------------------------------------------
/assets/150-hover-builtin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/150-hover-builtin.png
--------------------------------------------------------------------------------
/assets/150-hover-custom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/150-hover-custom.png
--------------------------------------------------------------------------------
/assets/150-hover-var.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/150-hover-var.png
--------------------------------------------------------------------------------
/assets/150-inlays.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/150-inlays.png
--------------------------------------------------------------------------------
/assets/150-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/150-light.png
--------------------------------------------------------------------------------
/assets/150_inlays.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/150_inlays.png
--------------------------------------------------------------------------------
/assets/nu.svg:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/assets/nushell.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nushell/vscode-nushell-lang/544de244f118d57d78f0971c1797d427e90d2cb6/assets/nushell.ico
--------------------------------------------------------------------------------
/client/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nushell-lsp-client",
3 | "version": "2.0.3",
4 | "lockfileVersion": 2,
5 | "requires": true,
6 | "packages": {
7 | "": {
8 | "name": "nushell-lsp-client",
9 | "version": "2.0.3",
10 | "license": "MIT",
11 | "dependencies": {
12 | "vscode-languageclient": "9.0.1",
13 | "which": "5.0.0"
14 | },
15 | "devDependencies": {
16 | "@types/vscode": "1.103.0",
17 | "@vscode/test-electron": "2.5.2"
18 | },
19 | "engines": {
20 | "vscode": "^1.93.0"
21 | }
22 | },
23 | "node_modules/@types/vscode": {
24 | "version": "1.103.0",
25 | "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.103.0.tgz",
26 | "integrity": "sha512-o4hanZAQdNfsKecexq9L3eHICd0AAvdbLk6hA60UzGXbGH/q8b/9xv2RgR7vV3ZcHuyKVq7b37IGd/+gM4Tu+Q==",
27 | "dev": true,
28 | "license": "MIT"
29 | },
30 | "node_modules/@vscode/test-electron": {
31 | "version": "2.5.2",
32 | "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.5.2.tgz",
33 | "integrity": "sha512-8ukpxv4wYe0iWMRQU18jhzJOHkeGKbnw7xWRX3Zw1WJA4cEKbHcmmLPdPrPtL6rhDcrlCZN+xKRpv09n4gRHYg==",
34 | "dev": true,
35 | "license": "MIT",
36 | "dependencies": {
37 | "http-proxy-agent": "^7.0.2",
38 | "https-proxy-agent": "^7.0.5",
39 | "jszip": "^3.10.1",
40 | "ora": "^8.1.0",
41 | "semver": "^7.6.2"
42 | },
43 | "engines": {
44 | "node": ">=16"
45 | }
46 | },
47 | "node_modules/agent-base": {
48 | "version": "7.1.4",
49 | "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
50 | "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",
51 | "dev": true,
52 | "license": "MIT",
53 | "engines": {
54 | "node": ">= 14"
55 | }
56 | },
57 | "node_modules/ansi-regex": {
58 | "version": "6.2.0",
59 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.0.tgz",
60 | "integrity": "sha512-TKY5pyBkHyADOPYlRT9Lx6F544mPl0vS5Ew7BJ45hA08Q+t3GjbueLliBWN3sMICk6+y7HdyxSzC4bWS8baBdg==",
61 | "dev": true,
62 | "license": "MIT",
63 | "engines": {
64 | "node": ">=12"
65 | },
66 | "funding": {
67 | "url": "https://github.com/chalk/ansi-regex?sponsor=1"
68 | }
69 | },
70 | "node_modules/balanced-match": {
71 | "version": "1.0.0",
72 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
73 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
74 | },
75 | "node_modules/chalk": {
76 | "version": "5.6.0",
77 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.0.tgz",
78 | "integrity": "sha512-46QrSQFyVSEyYAgQ22hQ+zDa60YHA4fBstHmtSApj1Y5vKtG27fWowW03jCk5KcbXEWPZUIR894aARCA/G1kfQ==",
79 | "dev": true,
80 | "license": "MIT",
81 | "engines": {
82 | "node": "^12.17.0 || ^14.13 || >=16.0.0"
83 | },
84 | "funding": {
85 | "url": "https://github.com/chalk/chalk?sponsor=1"
86 | }
87 | },
88 | "node_modules/cli-cursor": {
89 | "version": "5.0.0",
90 | "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
91 | "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==",
92 | "dev": true,
93 | "license": "MIT",
94 | "dependencies": {
95 | "restore-cursor": "^5.0.0"
96 | },
97 | "engines": {
98 | "node": ">=18"
99 | },
100 | "funding": {
101 | "url": "https://github.com/sponsors/sindresorhus"
102 | }
103 | },
104 | "node_modules/cli-spinners": {
105 | "version": "2.9.2",
106 | "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz",
107 | "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==",
108 | "dev": true,
109 | "license": "MIT",
110 | "engines": {
111 | "node": ">=6"
112 | },
113 | "funding": {
114 | "url": "https://github.com/sponsors/sindresorhus"
115 | }
116 | },
117 | "node_modules/core-util-is": {
118 | "version": "1.0.3",
119 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
120 | "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
121 | "dev": true,
122 | "license": "MIT"
123 | },
124 | "node_modules/debug": {
125 | "version": "4.4.1",
126 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
127 | "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
128 | "dev": true,
129 | "license": "MIT",
130 | "dependencies": {
131 | "ms": "^2.1.3"
132 | },
133 | "engines": {
134 | "node": ">=6.0"
135 | },
136 | "peerDependenciesMeta": {
137 | "supports-color": {
138 | "optional": true
139 | }
140 | }
141 | },
142 | "node_modules/emoji-regex": {
143 | "version": "10.5.0",
144 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.5.0.tgz",
145 | "integrity": "sha512-lb49vf1Xzfx080OKA0o6l8DQQpV+6Vg95zyCJX9VB/BqKYlhG7N4wgROUUHRA+ZPUefLnteQOad7z1kT2bV7bg==",
146 | "dev": true,
147 | "license": "MIT"
148 | },
149 | "node_modules/get-east-asian-width": {
150 | "version": "1.3.1",
151 | "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.3.1.tgz",
152 | "integrity": "sha512-R1QfovbPsKmosqTnPoRFiJ7CF9MLRgb53ChvMZm+r4p76/+8yKDy17qLL2PKInORy2RkZZekuK0efYgmzTkXyQ==",
153 | "dev": true,
154 | "license": "MIT",
155 | "engines": {
156 | "node": ">=18"
157 | },
158 | "funding": {
159 | "url": "https://github.com/sponsors/sindresorhus"
160 | }
161 | },
162 | "node_modules/http-proxy-agent": {
163 | "version": "7.0.2",
164 | "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
165 | "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
166 | "dev": true,
167 | "license": "MIT",
168 | "dependencies": {
169 | "agent-base": "^7.1.0",
170 | "debug": "^4.3.4"
171 | },
172 | "engines": {
173 | "node": ">= 14"
174 | }
175 | },
176 | "node_modules/https-proxy-agent": {
177 | "version": "7.0.6",
178 | "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
179 | "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
180 | "dev": true,
181 | "license": "MIT",
182 | "dependencies": {
183 | "agent-base": "^7.1.2",
184 | "debug": "4"
185 | },
186 | "engines": {
187 | "node": ">= 14"
188 | }
189 | },
190 | "node_modules/immediate": {
191 | "version": "3.0.6",
192 | "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
193 | "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==",
194 | "dev": true,
195 | "license": "MIT"
196 | },
197 | "node_modules/inherits": {
198 | "version": "2.0.4",
199 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
200 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
201 | "dev": true,
202 | "license": "ISC"
203 | },
204 | "node_modules/is-interactive": {
205 | "version": "2.0.0",
206 | "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz",
207 | "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==",
208 | "dev": true,
209 | "license": "MIT",
210 | "engines": {
211 | "node": ">=12"
212 | },
213 | "funding": {
214 | "url": "https://github.com/sponsors/sindresorhus"
215 | }
216 | },
217 | "node_modules/is-unicode-supported": {
218 | "version": "2.1.0",
219 | "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz",
220 | "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==",
221 | "dev": true,
222 | "license": "MIT",
223 | "engines": {
224 | "node": ">=18"
225 | },
226 | "funding": {
227 | "url": "https://github.com/sponsors/sindresorhus"
228 | }
229 | },
230 | "node_modules/isarray": {
231 | "version": "1.0.0",
232 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
233 | "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
234 | "dev": true,
235 | "license": "MIT"
236 | },
237 | "node_modules/isexe": {
238 | "version": "3.1.1",
239 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz",
240 | "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==",
241 | "engines": {
242 | "node": ">=16"
243 | }
244 | },
245 | "node_modules/jszip": {
246 | "version": "3.10.1",
247 | "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz",
248 | "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==",
249 | "dev": true,
250 | "license": "(MIT OR GPL-3.0-or-later)",
251 | "dependencies": {
252 | "lie": "~3.3.0",
253 | "pako": "~1.0.2",
254 | "readable-stream": "~2.3.6",
255 | "setimmediate": "^1.0.5"
256 | }
257 | },
258 | "node_modules/lie": {
259 | "version": "3.3.0",
260 | "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
261 | "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
262 | "dev": true,
263 | "license": "MIT",
264 | "dependencies": {
265 | "immediate": "~3.0.5"
266 | }
267 | },
268 | "node_modules/log-symbols": {
269 | "version": "6.0.0",
270 | "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz",
271 | "integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==",
272 | "dev": true,
273 | "license": "MIT",
274 | "dependencies": {
275 | "chalk": "^5.3.0",
276 | "is-unicode-supported": "^1.3.0"
277 | },
278 | "engines": {
279 | "node": ">=18"
280 | },
281 | "funding": {
282 | "url": "https://github.com/sponsors/sindresorhus"
283 | }
284 | },
285 | "node_modules/log-symbols/node_modules/is-unicode-supported": {
286 | "version": "1.3.0",
287 | "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz",
288 | "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==",
289 | "dev": true,
290 | "license": "MIT",
291 | "engines": {
292 | "node": ">=12"
293 | },
294 | "funding": {
295 | "url": "https://github.com/sponsors/sindresorhus"
296 | }
297 | },
298 | "node_modules/mimic-function": {
299 | "version": "5.0.1",
300 | "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz",
301 | "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==",
302 | "dev": true,
303 | "license": "MIT",
304 | "engines": {
305 | "node": ">=18"
306 | },
307 | "funding": {
308 | "url": "https://github.com/sponsors/sindresorhus"
309 | }
310 | },
311 | "node_modules/ms": {
312 | "version": "2.1.3",
313 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
314 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
315 | "dev": true,
316 | "license": "MIT"
317 | },
318 | "node_modules/onetime": {
319 | "version": "7.0.0",
320 | "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
321 | "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
322 | "dev": true,
323 | "license": "MIT",
324 | "dependencies": {
325 | "mimic-function": "^5.0.0"
326 | },
327 | "engines": {
328 | "node": ">=18"
329 | },
330 | "funding": {
331 | "url": "https://github.com/sponsors/sindresorhus"
332 | }
333 | },
334 | "node_modules/ora": {
335 | "version": "8.2.0",
336 | "resolved": "https://registry.npmjs.org/ora/-/ora-8.2.0.tgz",
337 | "integrity": "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==",
338 | "dev": true,
339 | "license": "MIT",
340 | "dependencies": {
341 | "chalk": "^5.3.0",
342 | "cli-cursor": "^5.0.0",
343 | "cli-spinners": "^2.9.2",
344 | "is-interactive": "^2.0.0",
345 | "is-unicode-supported": "^2.0.0",
346 | "log-symbols": "^6.0.0",
347 | "stdin-discarder": "^0.2.2",
348 | "string-width": "^7.2.0",
349 | "strip-ansi": "^7.1.0"
350 | },
351 | "engines": {
352 | "node": ">=18"
353 | },
354 | "funding": {
355 | "url": "https://github.com/sponsors/sindresorhus"
356 | }
357 | },
358 | "node_modules/pako": {
359 | "version": "1.0.11",
360 | "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
361 | "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
362 | "dev": true,
363 | "license": "(MIT AND Zlib)"
364 | },
365 | "node_modules/process-nextick-args": {
366 | "version": "2.0.1",
367 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
368 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
369 | "dev": true,
370 | "license": "MIT"
371 | },
372 | "node_modules/readable-stream": {
373 | "version": "2.3.8",
374 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
375 | "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
376 | "dev": true,
377 | "license": "MIT",
378 | "dependencies": {
379 | "core-util-is": "~1.0.0",
380 | "inherits": "~2.0.3",
381 | "isarray": "~1.0.0",
382 | "process-nextick-args": "~2.0.0",
383 | "safe-buffer": "~5.1.1",
384 | "string_decoder": "~1.1.1",
385 | "util-deprecate": "~1.0.1"
386 | }
387 | },
388 | "node_modules/restore-cursor": {
389 | "version": "5.1.0",
390 | "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
391 | "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==",
392 | "dev": true,
393 | "license": "MIT",
394 | "dependencies": {
395 | "onetime": "^7.0.0",
396 | "signal-exit": "^4.1.0"
397 | },
398 | "engines": {
399 | "node": ">=18"
400 | },
401 | "funding": {
402 | "url": "https://github.com/sponsors/sindresorhus"
403 | }
404 | },
405 | "node_modules/safe-buffer": {
406 | "version": "5.1.2",
407 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
408 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
409 | "dev": true,
410 | "license": "MIT"
411 | },
412 | "node_modules/semver": {
413 | "version": "7.7.1",
414 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz",
415 | "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==",
416 | "license": "ISC",
417 | "bin": {
418 | "semver": "bin/semver.js"
419 | },
420 | "engines": {
421 | "node": ">=10"
422 | }
423 | },
424 | "node_modules/setimmediate": {
425 | "version": "1.0.5",
426 | "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
427 | "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==",
428 | "dev": true,
429 | "license": "MIT"
430 | },
431 | "node_modules/signal-exit": {
432 | "version": "4.1.0",
433 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
434 | "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
435 | "dev": true,
436 | "license": "ISC",
437 | "engines": {
438 | "node": ">=14"
439 | },
440 | "funding": {
441 | "url": "https://github.com/sponsors/isaacs"
442 | }
443 | },
444 | "node_modules/stdin-discarder": {
445 | "version": "0.2.2",
446 | "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz",
447 | "integrity": "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==",
448 | "dev": true,
449 | "license": "MIT",
450 | "engines": {
451 | "node": ">=18"
452 | },
453 | "funding": {
454 | "url": "https://github.com/sponsors/sindresorhus"
455 | }
456 | },
457 | "node_modules/string_decoder": {
458 | "version": "1.1.1",
459 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
460 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
461 | "dev": true,
462 | "license": "MIT",
463 | "dependencies": {
464 | "safe-buffer": "~5.1.0"
465 | }
466 | },
467 | "node_modules/string-width": {
468 | "version": "7.2.0",
469 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
470 | "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
471 | "dev": true,
472 | "license": "MIT",
473 | "dependencies": {
474 | "emoji-regex": "^10.3.0",
475 | "get-east-asian-width": "^1.0.0",
476 | "strip-ansi": "^7.1.0"
477 | },
478 | "engines": {
479 | "node": ">=18"
480 | },
481 | "funding": {
482 | "url": "https://github.com/sponsors/sindresorhus"
483 | }
484 | },
485 | "node_modules/strip-ansi": {
486 | "version": "7.1.0",
487 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
488 | "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
489 | "dev": true,
490 | "license": "MIT",
491 | "dependencies": {
492 | "ansi-regex": "^6.0.1"
493 | },
494 | "engines": {
495 | "node": ">=12"
496 | },
497 | "funding": {
498 | "url": "https://github.com/chalk/strip-ansi?sponsor=1"
499 | }
500 | },
501 | "node_modules/util-deprecate": {
502 | "version": "1.0.2",
503 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
504 | "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
505 | "dev": true,
506 | "license": "MIT"
507 | },
508 | "node_modules/vscode-jsonrpc": {
509 | "version": "8.2.0",
510 | "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz",
511 | "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==",
512 | "license": "MIT",
513 | "engines": {
514 | "node": ">=14.0.0"
515 | }
516 | },
517 | "node_modules/vscode-languageclient": {
518 | "version": "9.0.1",
519 | "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-9.0.1.tgz",
520 | "integrity": "sha512-JZiimVdvimEuHh5olxhxkht09m3JzUGwggb5eRUkzzJhZ2KjCN0nh55VfiED9oez9DyF8/fz1g1iBV3h+0Z2EA==",
521 | "license": "MIT",
522 | "dependencies": {
523 | "minimatch": "^5.1.0",
524 | "semver": "^7.3.7",
525 | "vscode-languageserver-protocol": "3.17.5"
526 | },
527 | "engines": {
528 | "vscode": "^1.82.0"
529 | }
530 | },
531 | "node_modules/vscode-languageclient/node_modules/brace-expansion": {
532 | "version": "2.0.1",
533 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
534 | "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
535 | "dependencies": {
536 | "balanced-match": "^1.0.0"
537 | }
538 | },
539 | "node_modules/vscode-languageclient/node_modules/minimatch": {
540 | "version": "5.1.6",
541 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
542 | "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
543 | "dependencies": {
544 | "brace-expansion": "^2.0.1"
545 | },
546 | "engines": {
547 | "node": ">=10"
548 | }
549 | },
550 | "node_modules/vscode-languageserver-protocol": {
551 | "version": "3.17.5",
552 | "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz",
553 | "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==",
554 | "license": "MIT",
555 | "dependencies": {
556 | "vscode-jsonrpc": "8.2.0",
557 | "vscode-languageserver-types": "3.17.5"
558 | }
559 | },
560 | "node_modules/vscode-languageserver-types": {
561 | "version": "3.17.5",
562 | "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz",
563 | "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==",
564 | "license": "MIT"
565 | },
566 | "node_modules/which": {
567 | "version": "5.0.0",
568 | "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz",
569 | "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==",
570 | "license": "ISC",
571 | "dependencies": {
572 | "isexe": "^3.1.1"
573 | },
574 | "bin": {
575 | "node-which": "bin/which.js"
576 | },
577 | "engines": {
578 | "node": "^18.17.0 || >=20.5.0"
579 | }
580 | }
581 | },
582 | "dependencies": {
583 | "@types/vscode": {
584 | "version": "1.103.0",
585 | "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.103.0.tgz",
586 | "integrity": "sha512-o4hanZAQdNfsKecexq9L3eHICd0AAvdbLk6hA60UzGXbGH/q8b/9xv2RgR7vV3ZcHuyKVq7b37IGd/+gM4Tu+Q==",
587 | "dev": true
588 | },
589 | "@vscode/test-electron": {
590 | "version": "2.5.2",
591 | "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.5.2.tgz",
592 | "integrity": "sha512-8ukpxv4wYe0iWMRQU18jhzJOHkeGKbnw7xWRX3Zw1WJA4cEKbHcmmLPdPrPtL6rhDcrlCZN+xKRpv09n4gRHYg==",
593 | "dev": true,
594 | "requires": {
595 | "http-proxy-agent": "^7.0.2",
596 | "https-proxy-agent": "^7.0.5",
597 | "jszip": "^3.10.1",
598 | "ora": "^8.1.0",
599 | "semver": "^7.6.2"
600 | }
601 | },
602 | "agent-base": {
603 | "version": "7.1.4",
604 | "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
605 | "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",
606 | "dev": true
607 | },
608 | "ansi-regex": {
609 | "version": "6.2.0",
610 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.0.tgz",
611 | "integrity": "sha512-TKY5pyBkHyADOPYlRT9Lx6F544mPl0vS5Ew7BJ45hA08Q+t3GjbueLliBWN3sMICk6+y7HdyxSzC4bWS8baBdg==",
612 | "dev": true
613 | },
614 | "balanced-match": {
615 | "version": "1.0.0",
616 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
617 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
618 | },
619 | "chalk": {
620 | "version": "5.6.0",
621 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.0.tgz",
622 | "integrity": "sha512-46QrSQFyVSEyYAgQ22hQ+zDa60YHA4fBstHmtSApj1Y5vKtG27fWowW03jCk5KcbXEWPZUIR894aARCA/G1kfQ==",
623 | "dev": true
624 | },
625 | "cli-cursor": {
626 | "version": "5.0.0",
627 | "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
628 | "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==",
629 | "dev": true,
630 | "requires": {
631 | "restore-cursor": "^5.0.0"
632 | }
633 | },
634 | "cli-spinners": {
635 | "version": "2.9.2",
636 | "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz",
637 | "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==",
638 | "dev": true
639 | },
640 | "core-util-is": {
641 | "version": "1.0.3",
642 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
643 | "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
644 | "dev": true
645 | },
646 | "debug": {
647 | "version": "4.4.1",
648 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
649 | "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
650 | "dev": true,
651 | "requires": {
652 | "ms": "^2.1.3"
653 | }
654 | },
655 | "emoji-regex": {
656 | "version": "10.5.0",
657 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.5.0.tgz",
658 | "integrity": "sha512-lb49vf1Xzfx080OKA0o6l8DQQpV+6Vg95zyCJX9VB/BqKYlhG7N4wgROUUHRA+ZPUefLnteQOad7z1kT2bV7bg==",
659 | "dev": true
660 | },
661 | "get-east-asian-width": {
662 | "version": "1.3.1",
663 | "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.3.1.tgz",
664 | "integrity": "sha512-R1QfovbPsKmosqTnPoRFiJ7CF9MLRgb53ChvMZm+r4p76/+8yKDy17qLL2PKInORy2RkZZekuK0efYgmzTkXyQ==",
665 | "dev": true
666 | },
667 | "http-proxy-agent": {
668 | "version": "7.0.2",
669 | "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
670 | "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
671 | "dev": true,
672 | "requires": {
673 | "agent-base": "^7.1.0",
674 | "debug": "^4.3.4"
675 | }
676 | },
677 | "https-proxy-agent": {
678 | "version": "7.0.6",
679 | "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
680 | "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
681 | "dev": true,
682 | "requires": {
683 | "agent-base": "^7.1.2",
684 | "debug": "4"
685 | }
686 | },
687 | "immediate": {
688 | "version": "3.0.6",
689 | "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
690 | "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==",
691 | "dev": true
692 | },
693 | "inherits": {
694 | "version": "2.0.4",
695 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
696 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
697 | "dev": true
698 | },
699 | "is-interactive": {
700 | "version": "2.0.0",
701 | "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz",
702 | "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==",
703 | "dev": true
704 | },
705 | "is-unicode-supported": {
706 | "version": "2.1.0",
707 | "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz",
708 | "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==",
709 | "dev": true
710 | },
711 | "isarray": {
712 | "version": "1.0.0",
713 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
714 | "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
715 | "dev": true
716 | },
717 | "isexe": {
718 | "version": "3.1.1",
719 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz",
720 | "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ=="
721 | },
722 | "jszip": {
723 | "version": "3.10.1",
724 | "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz",
725 | "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==",
726 | "dev": true,
727 | "requires": {
728 | "lie": "~3.3.0",
729 | "pako": "~1.0.2",
730 | "readable-stream": "~2.3.6",
731 | "setimmediate": "^1.0.5"
732 | }
733 | },
734 | "lie": {
735 | "version": "3.3.0",
736 | "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
737 | "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
738 | "dev": true,
739 | "requires": {
740 | "immediate": "~3.0.5"
741 | }
742 | },
743 | "log-symbols": {
744 | "version": "6.0.0",
745 | "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz",
746 | "integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==",
747 | "dev": true,
748 | "requires": {
749 | "chalk": "^5.3.0",
750 | "is-unicode-supported": "^1.3.0"
751 | },
752 | "dependencies": {
753 | "is-unicode-supported": {
754 | "version": "1.3.0",
755 | "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz",
756 | "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==",
757 | "dev": true
758 | }
759 | }
760 | },
761 | "mimic-function": {
762 | "version": "5.0.1",
763 | "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz",
764 | "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==",
765 | "dev": true
766 | },
767 | "ms": {
768 | "version": "2.1.3",
769 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
770 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
771 | "dev": true
772 | },
773 | "onetime": {
774 | "version": "7.0.0",
775 | "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
776 | "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
777 | "dev": true,
778 | "requires": {
779 | "mimic-function": "^5.0.0"
780 | }
781 | },
782 | "ora": {
783 | "version": "8.2.0",
784 | "resolved": "https://registry.npmjs.org/ora/-/ora-8.2.0.tgz",
785 | "integrity": "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==",
786 | "dev": true,
787 | "requires": {
788 | "chalk": "^5.3.0",
789 | "cli-cursor": "^5.0.0",
790 | "cli-spinners": "^2.9.2",
791 | "is-interactive": "^2.0.0",
792 | "is-unicode-supported": "^2.0.0",
793 | "log-symbols": "^6.0.0",
794 | "stdin-discarder": "^0.2.2",
795 | "string-width": "^7.2.0",
796 | "strip-ansi": "^7.1.0"
797 | }
798 | },
799 | "pako": {
800 | "version": "1.0.11",
801 | "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
802 | "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
803 | "dev": true
804 | },
805 | "process-nextick-args": {
806 | "version": "2.0.1",
807 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
808 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
809 | "dev": true
810 | },
811 | "readable-stream": {
812 | "version": "2.3.8",
813 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
814 | "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
815 | "dev": true,
816 | "requires": {
817 | "core-util-is": "~1.0.0",
818 | "inherits": "~2.0.3",
819 | "isarray": "~1.0.0",
820 | "process-nextick-args": "~2.0.0",
821 | "safe-buffer": "~5.1.1",
822 | "string_decoder": "~1.1.1",
823 | "util-deprecate": "~1.0.1"
824 | }
825 | },
826 | "restore-cursor": {
827 | "version": "5.1.0",
828 | "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
829 | "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==",
830 | "dev": true,
831 | "requires": {
832 | "onetime": "^7.0.0",
833 | "signal-exit": "^4.1.0"
834 | }
835 | },
836 | "safe-buffer": {
837 | "version": "5.1.2",
838 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
839 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
840 | "dev": true
841 | },
842 | "semver": {
843 | "version": "7.7.1",
844 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz",
845 | "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA=="
846 | },
847 | "setimmediate": {
848 | "version": "1.0.5",
849 | "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
850 | "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==",
851 | "dev": true
852 | },
853 | "signal-exit": {
854 | "version": "4.1.0",
855 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
856 | "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
857 | "dev": true
858 | },
859 | "stdin-discarder": {
860 | "version": "0.2.2",
861 | "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz",
862 | "integrity": "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==",
863 | "dev": true
864 | },
865 | "string_decoder": {
866 | "version": "1.1.1",
867 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
868 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
869 | "dev": true,
870 | "requires": {
871 | "safe-buffer": "~5.1.0"
872 | }
873 | },
874 | "string-width": {
875 | "version": "7.2.0",
876 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
877 | "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
878 | "dev": true,
879 | "requires": {
880 | "emoji-regex": "^10.3.0",
881 | "get-east-asian-width": "^1.0.0",
882 | "strip-ansi": "^7.1.0"
883 | }
884 | },
885 | "strip-ansi": {
886 | "version": "7.1.0",
887 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
888 | "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
889 | "dev": true,
890 | "requires": {
891 | "ansi-regex": "^6.0.1"
892 | }
893 | },
894 | "util-deprecate": {
895 | "version": "1.0.2",
896 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
897 | "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
898 | "dev": true
899 | },
900 | "vscode-jsonrpc": {
901 | "version": "8.2.0",
902 | "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz",
903 | "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA=="
904 | },
905 | "vscode-languageclient": {
906 | "version": "9.0.1",
907 | "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-9.0.1.tgz",
908 | "integrity": "sha512-JZiimVdvimEuHh5olxhxkht09m3JzUGwggb5eRUkzzJhZ2KjCN0nh55VfiED9oez9DyF8/fz1g1iBV3h+0Z2EA==",
909 | "requires": {
910 | "minimatch": "^5.1.0",
911 | "semver": "^7.3.7",
912 | "vscode-languageserver-protocol": "3.17.5"
913 | },
914 | "dependencies": {
915 | "brace-expansion": {
916 | "version": "2.0.1",
917 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
918 | "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
919 | "requires": {
920 | "balanced-match": "^1.0.0"
921 | }
922 | },
923 | "minimatch": {
924 | "version": "5.1.6",
925 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
926 | "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
927 | "requires": {
928 | "brace-expansion": "^2.0.1"
929 | }
930 | }
931 | }
932 | },
933 | "vscode-languageserver-protocol": {
934 | "version": "3.17.5",
935 | "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz",
936 | "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==",
937 | "requires": {
938 | "vscode-jsonrpc": "8.2.0",
939 | "vscode-languageserver-types": "3.17.5"
940 | }
941 | },
942 | "vscode-languageserver-types": {
943 | "version": "3.17.5",
944 | "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz",
945 | "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg=="
946 | },
947 | "which": {
948 | "version": "5.0.0",
949 | "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz",
950 | "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==",
951 | "requires": {
952 | "isexe": "^3.1.1"
953 | }
954 | }
955 | }
956 | }
957 |
--------------------------------------------------------------------------------
/client/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nushell-lsp-client",
3 | "description": "VSCode part of the nushell language server",
4 | "author": "Nushell Maintainers",
5 | "license": "MIT",
6 | "version": "2.0.3",
7 | "publisher": "TheNuProjectContributors",
8 | "repository": {
9 | "type": "git",
10 | "url": "https://github.com/nushell/vscode-nushell-lang"
11 | },
12 | "engines": {
13 | "vscode": "^1.93.0"
14 | },
15 | "dependencies": {
16 | "vscode-languageclient": "9.0.1",
17 | "which": "5.0.0"
18 | },
19 | "devDependencies": {
20 | "@types/vscode": "1.103.0",
21 | "@vscode/test-electron": "2.5.2"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/client/src/extension.ts:
--------------------------------------------------------------------------------
1 | /* --------------------------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | * ------------------------------------------------------------------------------------------ */
5 |
6 | import * as vscode from 'vscode';
7 | import * as which from 'which';
8 | import { window, type OutputChannel } from 'vscode';
9 |
10 | import {
11 | LanguageClient,
12 | LanguageClientOptions,
13 | ServerOptions,
14 | Trace,
15 | RevealOutputChannelOn,
16 | } from 'vscode-languageclient/node';
17 |
18 | let client: LanguageClient;
19 | let outputChannel: OutputChannel; // Trace channel
20 | let serverOutputChannel: OutputChannel; // Server logs channel (single instance)
21 |
22 | function findNushellExecutable(): string | null {
23 | try {
24 | // Get the configured executable path from VSCode settings
25 | // Use null for resource to get global/workspace settings
26 | const config = vscode.workspace.getConfiguration(
27 | 'nushellLanguageServer',
28 | null,
29 | );
30 | const configuredPath = config.get('nushellExecutablePath', 'nu');
31 |
32 | // If user configured a specific path, try to find it
33 | if (configuredPath && configuredPath !== 'nu') {
34 | // User specified a custom path
35 | try {
36 | // Test if the configured path works
37 | return which.sync(configuredPath, { nothrow: true });
38 | } catch {
39 | // Fall back to searching PATH for 'nu'
40 | }
41 | }
42 |
43 | // Fall back to searching PATH for 'nu'
44 | return which.sync('nu', { nothrow: true });
45 | } catch {
46 | return null;
47 | }
48 | }
49 |
50 | function startLanguageServer(
51 | context: vscode.ExtensionContext,
52 | found_nushell_path: string,
53 | ): void {
54 | // Prevent duplicate clients/channels
55 | if (client) {
56 | vscode.window.showInformationMessage(
57 | 'Nushell Language Server is already running.',
58 | );
59 | return;
60 | }
61 | // Channel to receive detailed JSON-RPC trace between VS Code and the LSP server
62 | if (outputChannel) {
63 | try {
64 | outputChannel.dispose();
65 | } catch {
66 | // ignore
67 | }
68 | }
69 | outputChannel = window.createOutputChannel('Nushell LSP Trace');
70 | context.subscriptions.push(outputChannel);
71 |
72 | // Use Nushell's native LSP server
73 | const serverOptions: ServerOptions = {
74 | run: {
75 | command: found_nushell_path,
76 | args: ['--lsp'],
77 | },
78 | debug: {
79 | command: found_nushell_path,
80 | args: ['--lsp'],
81 | },
82 | };
83 |
84 | // Ensure a single server output channel exists and is reused
85 | if (!serverOutputChannel) {
86 | serverOutputChannel = window.createOutputChannel('Nushell Language Server');
87 | context.subscriptions.push(serverOutputChannel);
88 | }
89 |
90 | // Options to control the language client
91 | const clientOptions: LanguageClientOptions = {
92 | // Route general server logs to a single, reusable channel
93 | outputChannel: serverOutputChannel,
94 | // Never auto-reveal the server output channel
95 | revealOutputChannelOn: RevealOutputChannelOn.Never,
96 | // Send JSON-RPC trace to a dedicated channel visible in the Output panel
97 | traceOutputChannel: outputChannel,
98 | markdown: {
99 | isTrusted: true,
100 | supportHtml: true,
101 | },
102 | initializationOptions: {
103 | timeout: 10000, // 10 seconds
104 | },
105 | // Register the server for nushell files
106 | documentSelector: [{ scheme: 'file', language: 'nushell' }],
107 | synchronize: {
108 | // Notify the server about file changes to nushell files
109 | fileEvents: vscode.workspace.createFileSystemWatcher('**/*.nu'),
110 | },
111 | };
112 |
113 | // Create the language client and start the client.
114 | client = new LanguageClient(
115 | 'nushellLanguageServer',
116 | 'Nushell Language Server',
117 | serverOptions,
118 | clientOptions,
119 | );
120 |
121 | // Initialize trace level from settings and react to changes
122 | const applyTraceFromConfig = () => {
123 | const configured = vscode.workspace
124 | .getConfiguration('nushellLanguageServer')
125 | .get<'off' | 'messages' | 'verbose'>('trace.server');
126 | const level: 'off' | 'messages' | 'verbose' = configured ?? 'messages';
127 | const map: Record<'off' | 'messages' | 'verbose', Trace> = {
128 | off: Trace.Off,
129 | messages: Trace.Messages,
130 | verbose: Trace.Verbose,
131 | };
132 | client.setTrace(map[level]);
133 | try {
134 | outputChannel.appendLine(`[Nushell] JSON-RPC tracing set to: ${level}`);
135 | } catch {
136 | // ignore
137 | }
138 | };
139 | applyTraceFromConfig();
140 | const cfgDisp = vscode.workspace.onDidChangeConfiguration((e) => {
141 | if (e.affectsConfiguration('nushellLanguageServer.trace.server')) {
142 | applyTraceFromConfig();
143 | }
144 | });
145 | context.subscriptions.push(cfgDisp);
146 | // Log client lifecycle
147 | client.onDidChangeState((e) => {
148 | try {
149 | outputChannel.appendLine(`[Nushell] Client state changed: ${e.newState}`);
150 | } catch {
151 | // ignore
152 | }
153 | });
154 |
155 | // Start the language client and register a disposable that stops it when disposed
156 | client.start().catch((error) => {
157 | vscode.window.showErrorMessage(
158 | `Failed to start Nushell language server: ${error.message}`,
159 | );
160 | });
161 |
162 | const disposable = new vscode.Disposable(() => {
163 | if (client) {
164 | client.stop().catch((error) => {
165 | console.error(
166 | 'Failed to stop Nushell Language Server on dispose:',
167 | error,
168 | );
169 | });
170 | }
171 | });
172 | context.subscriptions.push(disposable);
173 | }
174 |
175 | export function activate(context: vscode.ExtensionContext) {
176 | console.log('Terminals: ' + (vscode.window).terminals.length);
177 |
178 | // Find Nushell executable once and reuse it
179 | const found_nushell_path = findNushellExecutable();
180 |
181 | context.subscriptions.push(
182 | vscode.window.registerTerminalProfileProvider('nushell_default', {
183 | provideTerminalProfile(
184 | token: vscode.CancellationToken,
185 | ): vscode.ProviderResult {
186 | // Consume token to satisfy no-unused-vars without changing behavior
187 | void token;
188 | if (found_nushell_path == null) {
189 | console.log(
190 | 'Nushell not found in env:PATH or any of the heuristic locations.',
191 | );
192 | // use an async arrow funciton to use `await` inside
193 | return (async () => {
194 | if (
195 | (await vscode.window.showErrorMessage(
196 | 'We cannot find a nushell executable in your path or pre-defined locations',
197 | 'install from website',
198 | )) &&
199 | (await vscode.env.openExternal(
200 | vscode.Uri.parse('https://www.nushell.sh/'),
201 | )) &&
202 | (await vscode.window.showInformationMessage(
203 | 'after you install nushell, you might need to reload vscode',
204 | 'reload now',
205 | ))
206 | ) {
207 | vscode.commands.executeCommand('workbench.action.reloadWindow');
208 | }
209 | // user has already seen error messages, but they didn't click through
210 | // return a promise that never resolve to supress the confusing error
211 | return await new Promise(() => undefined);
212 | })();
213 | }
214 |
215 | return {
216 | options: {
217 | name: 'Nushell',
218 | shellPath: found_nushell_path,
219 | iconPath: vscode.Uri.joinPath(
220 | context.extensionUri,
221 | 'assets/nu.svg',
222 | ),
223 | },
224 | };
225 | },
226 | }),
227 | );
228 |
229 | // Check if Nushell was found for LSP server
230 | if (!found_nushell_path) {
231 | vscode.window
232 | .showErrorMessage(
233 | 'Nushell executable not found. Please install Nushell and restart VSCode.',
234 | 'Install from website',
235 | )
236 | .then((selection) => {
237 | if (selection) {
238 | vscode.env.openExternal(vscode.Uri.parse('https://www.nushell.sh/'));
239 | }
240 | });
241 | return;
242 | }
243 |
244 | console.log(`Found nushell executable at: ${found_nushell_path}`);
245 | console.log('Activating Nushell Language Server extension.');
246 |
247 | // Start the language server when the extension is activated
248 | startLanguageServer(context, found_nushell_path);
249 |
250 | // Register a command to stop the language server
251 | const stopCommand = vscode.commands.registerCommand(
252 | 'nushell.stopLanguageServer',
253 | async () => {
254 | if (client) {
255 | try {
256 | await client.stop();
257 | client = undefined;
258 | vscode.window.showInformationMessage(
259 | 'Nushell Language Server stopped.',
260 | );
261 | } catch (error) {
262 | vscode.window.showErrorMessage(
263 | `Failed to stop Nushell Language Server: ${error}`,
264 | );
265 | }
266 | } else {
267 | vscode.window.showInformationMessage(
268 | 'Nushell Language Server is not running.',
269 | );
270 | }
271 | },
272 | );
273 | context.subscriptions.push(stopCommand);
274 |
275 | // Register a command to start the language server
276 | const startCommand = vscode.commands.registerCommand(
277 | 'nushell.startLanguageServer',
278 | () => {
279 | startLanguageServer(context, found_nushell_path);
280 | if (client) {
281 | vscode.window.showInformationMessage(
282 | 'Nushell Language Server started.',
283 | );
284 | }
285 | },
286 | );
287 | context.subscriptions.push(startCommand);
288 | }
289 |
290 | export function deactivate(): Thenable | undefined {
291 | if (!client) {
292 | return undefined;
293 | }
294 | return client.stop();
295 | }
296 |
--------------------------------------------------------------------------------
/client/src/test/completion.test.ts:
--------------------------------------------------------------------------------
1 | /* --------------------------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | * ------------------------------------------------------------------------------------------ */
5 |
6 | import * as vscode from 'vscode';
7 | import * as assert from 'assert';
8 | import { getDocUri, activate } from './helper';
9 |
10 | suite('Should do completion', () => {
11 | const docUri = getDocUri('completion.txt');
12 |
13 | test('Completes JS/TS in txt file', async () => {
14 | await testCompletion(docUri, new vscode.Position(0, 0), {
15 | items: [
16 | { label: 'JavaScript', kind: vscode.CompletionItemKind.Text },
17 | { label: 'TypeScript', kind: vscode.CompletionItemKind.Text },
18 | ],
19 | });
20 | });
21 | });
22 |
23 | async function testCompletion(
24 | docUri: vscode.Uri,
25 | position: vscode.Position,
26 | expectedCompletionList: vscode.CompletionList,
27 | ) {
28 | await activate(docUri);
29 |
30 | // Executing the command `vscode.executeCompletionItemProvider` to simulate triggering completion
31 | const actualCompletionList = (await vscode.commands.executeCommand(
32 | 'vscode.executeCompletionItemProvider',
33 | docUri,
34 | position,
35 | )) as vscode.CompletionList;
36 |
37 | assert.ok(actualCompletionList.items.length >= 2);
38 | expectedCompletionList.items.forEach((expectedItem, i) => {
39 | const actualItem = actualCompletionList.items[i];
40 | assert.equal(actualItem.label, expectedItem.label);
41 | assert.equal(actualItem.kind, expectedItem.kind);
42 | });
43 | }
44 |
--------------------------------------------------------------------------------
/client/src/test/diagnostics.test.ts:
--------------------------------------------------------------------------------
1 | /* --------------------------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | * ------------------------------------------------------------------------------------------ */
5 |
6 | import * as vscode from 'vscode';
7 | import * as assert from 'assert';
8 | import { getDocUri, activate } from './helper';
9 |
10 | suite('Should get diagnostics', () => {
11 | const docUri = getDocUri('diagnostics.txt');
12 |
13 | test('Diagnoses uppercase texts', async () => {
14 | await testDiagnostics(docUri, [
15 | {
16 | message: 'ANY is all uppercase.',
17 | range: toRange(0, 0, 0, 3),
18 | severity: vscode.DiagnosticSeverity.Warning,
19 | source: 'ex',
20 | },
21 | {
22 | message: 'ANY is all uppercase.',
23 | range: toRange(0, 14, 0, 17),
24 | severity: vscode.DiagnosticSeverity.Warning,
25 | source: 'ex',
26 | },
27 | {
28 | message: 'OS is all uppercase.',
29 | range: toRange(0, 18, 0, 20),
30 | severity: vscode.DiagnosticSeverity.Warning,
31 | source: 'ex',
32 | },
33 | ]);
34 | });
35 | });
36 |
37 | function toRange(sLine: number, sChar: number, eLine: number, eChar: number) {
38 | const start = new vscode.Position(sLine, sChar);
39 | const end = new vscode.Position(eLine, eChar);
40 | return new vscode.Range(start, end);
41 | }
42 |
43 | async function testDiagnostics(
44 | docUri: vscode.Uri,
45 | expectedDiagnostics: vscode.Diagnostic[],
46 | ) {
47 | await activate(docUri);
48 |
49 | const actualDiagnostics = vscode.languages.getDiagnostics(docUri);
50 |
51 | assert.equal(actualDiagnostics.length, expectedDiagnostics.length);
52 |
53 | expectedDiagnostics.forEach((expectedDiagnostic, i) => {
54 | const actualDiagnostic = actualDiagnostics[i];
55 | assert.equal(actualDiagnostic.message, expectedDiagnostic.message);
56 | assert.deepEqual(actualDiagnostic.range, expectedDiagnostic.range);
57 | assert.equal(actualDiagnostic.severity, expectedDiagnostic.severity);
58 | });
59 | }
60 |
--------------------------------------------------------------------------------
/client/src/test/helper.ts:
--------------------------------------------------------------------------------
1 | /* --------------------------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | * ------------------------------------------------------------------------------------------ */
5 |
6 | import * as vscode from 'vscode';
7 | import * as path from 'path';
8 |
9 | export let doc: vscode.TextDocument;
10 | export let editor: vscode.TextEditor;
11 | export let documentEol: string;
12 | export let platformEol: string;
13 |
14 | /**
15 | * Activates the vscode.lsp-sample extension
16 | */
17 | export async function activate(docUri: vscode.Uri) {
18 | // The extensionId is `publisher.name` from package.json
19 | const ext = vscode.extensions.getExtension('vscode-samples.lsp-sample')!;
20 | await ext.activate();
21 | try {
22 | doc = await vscode.workspace.openTextDocument(docUri);
23 | editor = await vscode.window.showTextDocument(doc);
24 | await sleep(2000); // Wait for server activation
25 | } catch (e) {
26 | console.error(e);
27 | }
28 | }
29 |
30 | async function sleep(ms: number) {
31 | return new Promise((resolve) => setTimeout(resolve, ms));
32 | }
33 |
34 | export const getDocPath = (p: string) => {
35 | return path.resolve(__dirname, '../../testFixture', p);
36 | };
37 | export const getDocUri = (p: string) => {
38 | return vscode.Uri.file(getDocPath(p));
39 | };
40 |
41 | export async function setTestContent(content: string): Promise {
42 | const all = new vscode.Range(
43 | doc.positionAt(0),
44 | doc.positionAt(doc.getText().length),
45 | );
46 | return editor.edit((eb) => eb.replace(all, content));
47 | }
48 |
--------------------------------------------------------------------------------
/client/src/test/index.ts:
--------------------------------------------------------------------------------
1 | /* --------------------------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | * ------------------------------------------------------------------------------------------ */
5 | import * as path from 'path';
6 | import * as Mocha from 'mocha';
7 | import * as glob from 'glob';
8 |
9 | export function run(): Promise {
10 | // Create the mocha test
11 | const mocha = new Mocha({
12 | ui: 'tdd',
13 | color: true,
14 | });
15 | mocha.timeout(100000);
16 |
17 | const testsRoot = __dirname;
18 |
19 | return new Promise((resolve, reject) => {
20 | glob('**.test.js', { cwd: testsRoot }, (err, files) => {
21 | if (err) {
22 | return reject(err);
23 | }
24 |
25 | // Add files to the test suite
26 | files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));
27 |
28 | try {
29 | // Run the mocha test
30 | mocha.run((failures) => {
31 | if (failures > 0) {
32 | reject(new Error(`${failures} tests failed.`));
33 | } else {
34 | resolve();
35 | }
36 | });
37 | } catch (err) {
38 | console.error(err);
39 | reject(err);
40 | }
41 | });
42 | });
43 | }
44 |
--------------------------------------------------------------------------------
/client/src/test/runTest.ts:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * Licensed under the MIT License. See License.txt in the project root for license information.
4 | *--------------------------------------------------------------------------------------------*/
5 | import * as path from 'path';
6 |
7 | import { runTests } from '@vscode/test-electron';
8 |
9 | async function main() {
10 | try {
11 | // The folder containing the Extension Manifest package.json
12 | // Passed to `--extensionDevelopmentPath`
13 | const extensionDevelopmentPath = path.resolve(__dirname, '../../../');
14 |
15 | // The path to test runner
16 | // Passed to --extensionTestsPath
17 | const extensionTestsPath = path.resolve(__dirname, './index');
18 |
19 | // Download VS Code, unzip it and run the integration test
20 | await runTests({ extensionDevelopmentPath, extensionTestsPath });
21 | } catch (err) {
22 | console.error('Failed to run tests');
23 | process.exit(1);
24 | }
25 | }
26 |
27 | main();
28 |
--------------------------------------------------------------------------------
/client/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "target": "es2020",
5 | "lib": ["es2020"],
6 | "outDir": "out",
7 | "rootDir": "src",
8 | "sourceMap": true
9 | },
10 | "include": ["src"],
11 | "exclude": ["node_modules", ".vscode-test"]
12 | }
13 |
--------------------------------------------------------------------------------
/eslint.config.js:
--------------------------------------------------------------------------------
1 | module.exports = [
2 | {
3 | files: ['**/*.ts'], // Apply to all TypeScript files
4 | languageOptions: {
5 | parser: require('@typescript-eslint/parser'), // Use TypeScript parser
6 | sourceType: 'module',
7 | },
8 | plugins: {
9 | '@typescript-eslint': require('@typescript-eslint/eslint-plugin'),
10 | },
11 | rules: {
12 | // Add your preferred rules here, or start with recommended
13 | '@typescript-eslint/no-unused-vars': 'warn',
14 | // Add more rules as needed
15 | },
16 | },
17 | ];
18 |
--------------------------------------------------------------------------------
/generate-example.nu:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env nu
2 | $nu.scope.commands |
3 | where is_builtin and (not $it.is_extern) |
4 | get -i examples |
5 | each {|r| $r.example? | append (char nl)} |
6 | flatten | save -f example.nu
--------------------------------------------------------------------------------
/generate-patterns.nu:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env nu
2 |
3 | # builtin sort functions only sort alphabetically
4 | def sort-by-length [
5 | column: string
6 | ] {
7 | insert length {get $column|str length}
8 | |sort-by -r length
9 | |reject length
10 | }
11 |
12 | # generate combined regex for all single word commands
13 | def match-for-single [
14 | commands:record
15 | ] {
16 | '\b(' + ($commands|where ($it.subcommands|length) == 1|sort-by-length name|get name|str collect '|'|str replace -a -s '?' '\?') + ')\b'
17 | }
18 |
19 | # generate list of regexes for every two word command name
20 | def match-for-double [
21 | commands: record
22 | ] {
23 | $commands
24 | |where ($it.subcommands|length) > 0 and ($it.subcommands.second-word|all $it != '')|each {|x|
25 | '\b' + $x.name + '(\s' + ($x.subcommands.second-word|compact|str collect '|\s') + ')\b'
26 | }
27 | }
28 |
29 | # returns regexes for all commands, both single and double word single-word append is conditional because some letters only have two word commands e.g 'q'
30 | def generate-matches [
31 | category: record
32 | ] {
33 | if ($category | get category) ends-with '_sub' {
34 | match-for-double $category.commands
35 | } else {
36 | match-for-single $category.commands
37 | }
38 | }
39 |
40 | let patterns = (
41 | $nu.scope.commands
42 | |where is_builtin == true and is_extern == false
43 | |get name
44 | |split column ' ' first-word second-word
45 | |default '' second-word
46 | |uniq
47 | |upsert category {|x|
48 | let first_letter = ($x.first-word|split chars|get 0)
49 | if $x.second-word == '' {
50 | $"($first_letter)"
51 | } else {
52 | $"($first_letter)_sub"
53 | }
54 | }
55 | |group-by category
56 | |transpose category commands
57 | |upsert commands {
58 | get commands
59 | |group-by first-word
60 | |transpose name subcommands
61 | }
62 | |reverse
63 | |each {|category|
64 | generate-matches $category
65 | |each {|match|
66 | {name: $"keyword.other.($category.category)", match: $match}
67 | }
68 | }
69 | |flatten
70 | )
71 |
72 | open syntaxes/nushell.tmLanguage.json
73 | |update repository.keywords.patterns $patterns
74 | |save syntaxes/nushell.tmLanguage.json
75 |
76 | # TODO: don't allow keywords that have their own definition to be included keyword.other.blah
77 |
78 | # like:
79 | # alias, let, let-env, for, def, def-env, extern, module, overlay
80 | # probably some others should be added
--------------------------------------------------------------------------------
/language-configuration.json:
--------------------------------------------------------------------------------
1 | {
2 | "comments": {
3 | // symbol used for single line comment. Remove this entry if your language does not support line comments
4 | "lineComment": "#",
5 | // symbols used for start and end a block comment. Remove this entry if your language does not support block comments
6 | "blockComment": ["#", "#"]
7 | },
8 | // symbols used as brackets
9 | "brackets": [
10 | ["{", "}"],
11 | ["[", "]"],
12 | ["(", ")"]
13 | ],
14 | "colorizedBracketPairs": [
15 | ["{", "}"],
16 | ["[", "]"],
17 | ["(", ")"]
18 | ],
19 | // symbols that are auto closed when typing
20 | "autoClosingPairs": [
21 | { "open": "{", "close": "}" },
22 | { "open": "[", "close": "]" },
23 | { "open": "(", "close": ")" },
24 | { "open": "'", "close": "'", "notIn": ["string", "comment"] },
25 | { "open": "\"", "close": "\"", "notIn": ["string"] },
26 | { "open": "`", "close": "`", "notIn": ["string", "comment"] },
27 | { "open": "r#'", "close": "'#", "notIn": ["string"] },
28 | { "open": "r##'", "close": "'##", "notIn": ["string"] },
29 | { "open": "r###'", "close": "'###", "notIn": ["string"] },
30 | { "open": "r####'", "close": "'####", "notIn": ["string"] },
31 | { "open": "r#####'", "close": "'#####", "notIn": ["string"] },
32 | { "open": "r######'", "close": "'######", "notIn": ["string"] }
33 | // and so on...
34 | ],
35 | // symbols that can be used to surround a selection
36 | "surroundingPairs": [
37 | ["{", "}"],
38 | ["[", "]"],
39 | ["(", ")"],
40 | ["'", "'"],
41 | ["\"", "\""],
42 | ["`", "`"]
43 | ],
44 | "folding": {
45 | "markers": {
46 | "start": "^\\s*# region:",
47 | "end": "^\\s*# endregion"
48 | }
49 | },
50 | "wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\?\\s]+)",
51 | "indentationRules": {
52 | "increaseIndentPattern": "{{?(def|def-env|else|extern|for|if|let|let-env|with-env)\\b.*}}?",
53 | "decreaseIndentPattern": "{{?/(def|def-env|for|if)\\b}}?"
54 | },
55 | "onEnterRules": [
56 | {
57 | "beforeText": "^\\s*(?:alias|def|def-env|else|extern|for|if|let|let-env|with-env).*?:\\s*$",
58 | "action": { "indent": "indent" }
59 | }
60 | ]
61 | }
62 |
--------------------------------------------------------------------------------
/nushell.theme-minimal-dark.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "vscode://schemas/color-theme",
3 | "type": "dark",
4 | // "include": "./dark_vs.json",
5 | "tokenColors": [
6 | // "FlatShape__InternalCommand": "#61d6d6", //"Cyan.bold"
7 | {
8 | "scope": ["keyword.control.nushell"],
9 | "settings": {
10 | "foreground": "#61d6d6"
11 | }
12 | },
13 |
14 | // I used this for things like
15 | // alias = blah
16 | {
17 | "scope": ["source.nushell"],
18 | "settings": {
19 | "foreground": "#06989a" //#61d6d6
20 | // "fontStyle": "bold"
21 | }
22 | },
23 |
24 | {
25 | "scope": "keyword.control.other.nushell",
26 | "settings": {
27 | "foreground": "#FF0000",
28 | "fontStyle": "bold"
29 | }
30 | },
31 |
32 | // these are the sub commands
33 | {
34 | "scope": ["keyword.other"],
35 | "settings": {
36 | "foreground": "#00b7ff"
37 | }
38 | },
39 |
40 | // "FlatShape__String": "#12820e", //"Green"
41 | {
42 | // "scope": ["string", "meta.embedded.assembly"],
43 | "scope": ["string.quoted"],
44 | "settings": {
45 | "foreground": "#12820e"
46 | }
47 | },
48 |
49 | // "FlatShape__Operator": "#AAAA00", //"Yellow" #c19c00
50 | {
51 | "scope": ["punctuation.nushell"],
52 | "settings": {
53 | "foreground": "#c19c00"
54 | // "fontStyle": "bold"
55 | }
56 | },
57 |
58 | // "FlatShape__Comment": "#55FF55", //"Green.bold", #16c60c
59 | {
60 | "scope": ["comment"],
61 | "settings": {
62 | "foreground": "#16c60c"
63 | // "fontStyle": "bold"
64 | }
65 | },
66 |
67 | // for range 0..10
68 | {
69 | "scope": ["constant", "constant.numeric"],
70 | "settings": {
71 | "foreground": "#b4009e"
72 | // "fontStyle": "bold"
73 | }
74 | },
75 |
76 | // "FlatShape__Flag": "#3878ff", //"Blue.bold"
77 | // "FlatShape__ShorthandFlag": "#3878ff", //"Blue.bold"
78 | // for --flag
79 | {
80 | "scope": ["variable.parameter.function"],
81 | "settings": {
82 | "foreground": "#3878ff"
83 | // "fontStyle": "bold"
84 | }
85 | },
86 |
87 | // "FlatShape__Variable_or_FlatShape__Identifier": "#821791", //"Purple"
88 | {
89 | "scope": ["variable.name", "variable.name.nushell"],
90 | "settings": {
91 | "foreground": "#aa44dd"
92 | }
93 | },
94 |
95 | {
96 | "scope": ["variable.other"],
97 | "settings": {
98 | "foreground": "#61d6d6"
99 | }
100 | },
101 |
102 | // {
103 | // "scope": ["variable.language"],
104 | // "settings": {
105 | // "foreground": "#aa44dd"
106 | // }
107 | // },
108 |
109 | // "FlatShape__Int": "#b4009e", //"Purple.bold"
110 | // "FlatShape__Decimal": "#b4009e", //"Purple.bold"
111 | {
112 | "scope": [
113 | "constant.numeric",
114 | "variable.other.enummember",
115 | "keyword.operator.plus.exponent",
116 | "keyword.operator.minus.exponent"
117 | ],
118 | "settings": {
119 | "foreground": "#b4009e"
120 | }
121 | },
122 |
123 | // for def
124 | {
125 | "scope": ["entity.name.function"],
126 | "settings": {
127 | "foreground": "#61d6d6"
128 | }
129 | },
130 |
131 | {
132 | "scope": ["entity.name.type"],
133 | "settings": {
134 | "foreground": "#f9f1a5"
135 | }
136 | },
137 |
138 | // for var:storage_type
139 | {
140 | "scope": ["storage.type"],
141 | "settings": {
142 | "foreground": "#a538ff"
143 | }
144 | },
145 |
146 | {
147 | "scope": ["storage.modifier"],
148 | "settings": {
149 | "foreground": "#5555FF"
150 | }
151 | }
152 |
153 | // {
154 | // "scope": [
155 | // "meta.embedded",
156 | // "source.groovy.embedded"
157 | // ],
158 | // "settings": {
159 | // "foreground": "#D4D4D4"
160 | // }
161 | // },
162 | // {
163 | // "scope": "emphasis",
164 | // "settings": {
165 | // "fontStyle": "italic"
166 | // }
167 | // },
168 | // {
169 | // "scope": "strong",
170 | // "settings": {
171 | // "fontStyle": "bold"
172 | // }
173 | // },
174 | // {
175 | // "scope": "header",
176 | // "settings": {
177 | // "foreground": "#000080"
178 | // }
179 | // },
180 | // {
181 | // "scope": "comment",
182 | // "settings": {
183 | // "foreground": "#6A9955"
184 | // }
185 | // },
186 | // {
187 | // "scope": "constant.language",
188 | // "settings": {
189 | // "foreground": "#569CD6"
190 | // }
191 | // },
192 | // {
193 | // "scope": [
194 | // "constant.numeric",
195 | // "variable.other.enummember",
196 | // "keyword.operator.plus.exponent",
197 | // "keyword.operator.minus.exponent"
198 | // ],
199 | // "settings": {
200 | // "foreground": "#FF55FF"
201 | // }
202 | // },
203 | // {
204 | // "scope": "constant.regexp",
205 | // "settings": {
206 | // "foreground": "#646695"
207 | // }
208 | // },
209 | // {
210 | // "scope": "entity.name.tag",
211 | // "settings": {
212 | // "foreground": "#569CD6"
213 | // }
214 | // },
215 | // {
216 | // "scope": "entity.name.tag.css",
217 | // "settings": {
218 | // "foreground": "#D7BA7D"
219 | // }
220 | // },
221 | // {
222 | // "scope": "entity.other.attribute-name",
223 | // "settings": {
224 | // "foreground": "#9CDCFE"
225 | // }
226 | // },
227 | // {
228 | // "scope": [
229 | // "entity.other.attribute-name.class.css",
230 | // "entity.other.attribute-name.class.mixin.css",
231 | // "entity.other.attribute-name.id.css",
232 | // "entity.other.attribute-name.parent-selector.css",
233 | // "entity.other.attribute-name.pseudo-class.css",
234 | // "entity.other.attribute-name.pseudo-element.css",
235 | // "source.css.less entity.other.attribute-name.id",
236 | // "entity.other.attribute-name.scss"
237 | // ],
238 | // "settings": {
239 | // "foreground": "#D7BA7D"
240 | // }
241 | // },
242 | // {
243 | // "scope": "invalid",
244 | // "settings": {
245 | // "foreground": "#F44747"
246 | // }
247 | // },
248 | // {
249 | // "scope": "markup.underline",
250 | // "settings": {
251 | // "fontStyle": "underline"
252 | // }
253 | // },
254 | // {
255 | // "scope": "markup.bold",
256 | // "settings": {
257 | // "foreground": "#569CD6",
258 | // "fontStyle": "bold"
259 | // }
260 | // },
261 | // {
262 | // "scope": "markup.heading",
263 | // "settings": {
264 | // "foreground": "#569CD6",
265 | // "fontStyle": "bold"
266 | // }
267 | // },
268 | // {
269 | // "scope": "markup.italic",
270 | // "settings": {
271 | // "fontStyle": "italic"
272 | // }
273 | // },
274 | // {
275 | // "scope": "markup.inserted",
276 | // "settings": {
277 | // "foreground": "#B5CEA8"
278 | // }
279 | // },
280 | // {
281 | // "scope": "markup.deleted",
282 | // "settings": {
283 | // "foreground": "#CE9178"
284 | // }
285 | // },
286 | // {
287 | // "scope": "markup.changed",
288 | // "settings": {
289 | // "foreground": "#569CD6"
290 | // }
291 | // },
292 | // {
293 | // "scope": "punctuation.definition.quote.begin.markdown",
294 | // "settings": {
295 | // "foreground": "#6A9955"
296 | // }
297 | // },
298 | // {
299 | // "scope": "punctuation.definition.list.begin.markdown",
300 | // "settings": {
301 | // "foreground": "#6796E6"
302 | // }
303 | // },
304 | // {
305 | // "scope": "markup.inline.raw",
306 | // "settings": {
307 | // "foreground": "#CE9178"
308 | // }
309 | // },
310 | // {
311 | // "scope": "punctuation.definition.tag",
312 | // "settings": {
313 | // "foreground": "#808080"
314 | // }
315 | // },
316 | // {
317 | // "scope": [
318 | // "meta.preprocessor",
319 | // "entity.name.function.preprocessor"
320 | // ],
321 | // "settings": {
322 | // "foreground": "#569CD6"
323 | // }
324 | // },
325 | // {
326 | // "scope": "meta.preprocessor.string",
327 | // "settings": {
328 | // "foreground": "#CE9178"
329 | // }
330 | // },
331 | // {
332 | // "scope": "meta.preprocessor.numeric",
333 | // "settings": {
334 | // "foreground": "#B5CEA8"
335 | // }
336 | // },
337 | // {
338 | // "scope": "meta.structure.dictionary.key.python",
339 | // "settings": {
340 | // "foreground": "#9CDCFE"
341 | // }
342 | // },
343 | // {
344 | // "scope": "meta.diff.header",
345 | // "settings": {
346 | // "foreground": "#569CD6"
347 | // }
348 | // },
349 | // {
350 | // "scope": "storage",
351 | // "settings": {
352 | // "foreground": "#569CD6"
353 | // }
354 | // },
355 | // {
356 | // "scope": "storage.type",
357 | // "settings": {
358 | // "foreground": "#569CD6"
359 | // }
360 | // },
361 | // {
362 | // "scope": [
363 | // "storage.modifier",
364 | // "keyword.operator.noexcept"
365 | // ],
366 | // "settings": {
367 | // "foreground": "#569CD6"
368 | // }
369 | // },
370 | // {
371 | // "scope": [
372 | // "string",
373 | // "meta.embedded.assembly"
374 | // ],
375 | // "settings": {
376 | // "foreground": "#00AA00"
377 | // }
378 | // },
379 | // {
380 | // "scope": "string.tag",
381 | // "settings": {
382 | // "foreground": "#CE9178"
383 | // }
384 | // },
385 | // {
386 | // "scope": "string.value",
387 | // "settings": {
388 | // "foreground": "#CE9178"
389 | // }
390 | // },
391 | // {
392 | // "scope": "string.regexp",
393 | // "settings": {
394 | // "foreground": "#D16969"
395 | // }
396 | // },
397 | // {
398 | // "scope": [
399 | // "punctuation.definition.template-expression.begin",
400 | // "punctuation.definition.template-expression.end",
401 | // "punctuation.section.embedded"
402 | // ],
403 | // "settings": {
404 | // "foreground": "#569CD6"
405 | // }
406 | // },
407 | // {
408 | // "scope": [
409 | // "meta.template.expression"
410 | // ],
411 | // "settings": {
412 | // "foreground": "#D4D4D4"
413 | // }
414 | // },
415 | // {
416 | // "scope": [
417 | // "support.type.vendored.property-name",
418 | // "support.type.property-name",
419 | // "variable.css",
420 | // "variable.scss",
421 | // "variable.other.less",
422 | // "source.coffee.embedded"
423 | // ],
424 | // "settings": {
425 | // "foreground": "#9CDCFE"
426 | // }
427 | // },
428 | // {
429 | // "scope": "keyword",
430 | // "settings": {
431 | // "foreground": "#569CD6"
432 | // }
433 | // },
434 | // {
435 | // "scope": "keyword.control",
436 | // "settings": {
437 | // "foreground": "#0ff"
438 | // }
439 | // },
440 | // {
441 | // "scope": "keyword.operator",
442 | // "settings": {
443 | // "foreground": "#D4D4D4"
444 | // }
445 | // },
446 | // {
447 | // "scope": [
448 | // "keyword.operator.new",
449 | // "keyword.operator.expression",
450 | // "keyword.operator.cast",
451 | // "keyword.operator.sizeof",
452 | // "keyword.operator.alignof",
453 | // "keyword.operator.typeid",
454 | // "keyword.operator.alignas",
455 | // "keyword.operator.instanceof",
456 | // "keyword.operator.logical.python",
457 | // "keyword.operator.wordlike"
458 | // ],
459 | // "settings": {
460 | // "foreground": "#569CD6"
461 | // }
462 | // },
463 | // {
464 | // "scope": "keyword.other.unit",
465 | // "settings": {
466 | // "foreground": "#B5CEA8"
467 | // }
468 | // },
469 | // {
470 | // "scope": [
471 | // "punctuation.section.embedded.begin.php",
472 | // "punctuation.section.embedded.end.php"
473 | // ],
474 | // "settings": {
475 | // "foreground": "#569CD6"
476 | // }
477 | // },
478 | // {
479 | // "scope": "support.function.git-rebase",
480 | // "settings": {
481 | // "foreground": "#9CDCFE"
482 | // }
483 | // },
484 | // {
485 | // "scope": "constant.sha.git-rebase",
486 | // "settings": {
487 | // "foreground": "#B5CEA8"
488 | // }
489 | // },
490 | // {
491 | // "scope": [
492 | // "storage.modifier.import.java",
493 | // "variable.language.wildcard.java",
494 | // "storage.modifier.package.java"
495 | // ],
496 | // "settings": {
497 | // "foreground": "#D4D4D4"
498 | // }
499 | // },
500 | // {
501 | // "scope": "variable.language",
502 | // "settings": {
503 | // "foreground": "#569CD6"
504 | // }
505 | // },
506 | // {
507 | // "scope": [
508 | // "entity.name.function",
509 | // "support.function",
510 | // "support.constant.handlebars",
511 | // "source.powershell variable.other.member",
512 | // "entity.name.operator.custom-literal"
513 | // ],
514 | // "settings": {
515 | // "foreground": "#DCDCAA"
516 | // }
517 | // },
518 | // {
519 | // "scope": [
520 | // "meta.return-type",
521 | // "support.class",
522 | // "support.type",
523 | // "entity.name.type",
524 | // "entity.name.namespace",
525 | // "entity.other.attribute",
526 | // "entity.name.scope-resolution",
527 | // "entity.name.class",
528 | // "storage.type.numeric.go",
529 | // "storage.type.byte.go",
530 | // "storage.type.boolean.go",
531 | // "storage.type.string.go",
532 | // "storage.type.uintptr.go",
533 | // "storage.type.error.go",
534 | // "storage.type.rune.go",
535 | // "storage.type.cs",
536 | // "storage.type.generic.cs",
537 | // "storage.type.modifier.cs",
538 | // "storage.type.variable.cs",
539 | // "storage.type.annotation.java",
540 | // "storage.type.generic.java",
541 | // "storage.type.java",
542 | // "storage.type.object.array.java",
543 | // "storage.type.primitive.array.java",
544 | // "storage.type.primitive.java",
545 | // "storage.type.token.java",
546 | // "storage.type.groovy",
547 | // "storage.type.annotation.groovy",
548 | // "storage.type.parameters.groovy",
549 | // "storage.type.generic.groovy",
550 | // "storage.type.object.array.groovy",
551 | // "storage.type.primitive.array.groovy",
552 | // "storage.type.primitive.groovy"
553 | // ],
554 | // "settings": {
555 | // "foreground": "#4EC9B0"
556 | // }
557 | // },
558 | // {
559 | // "scope": [
560 | // "meta.type.cast.expr",
561 | // "meta.type.new.expr",
562 | // "support.constant.math",
563 | // "support.constant.dom",
564 | // "support.constant.json",
565 | // "entity.other.inherited-class"
566 | // ],
567 | // "settings": {
568 | // "foreground": "#4EC9B0"
569 | // }
570 | // },
571 | // {
572 | // "scope": [
573 | // "keyword.control",
574 | // "source.cpp keyword.operator.new",
575 | // "keyword.operator.delete",
576 | // "keyword.other.using",
577 | // "keyword.other.operator",
578 | // "entity.name.operator"
579 | // ],
580 | // "settings": {
581 | // "foreground": "#55FFFF"
582 | // }
583 | // },
584 | // {
585 | // "scope": [
586 | // "variable",
587 | // "meta.definition.variable.name",
588 | // "support.variable",
589 | // "entity.name.variable"
590 | // ],
591 | // "settings": {
592 | // "foreground": "#AA00AA"
593 | // }
594 | // },
595 | // {
596 | // "scope": [
597 | // "variable.parameter.function.nushell"
598 | // ],
599 | // "settings": {
600 | // "foreground": "#5555FF",
601 | // // "fontStyle": "bold"
602 | // }
603 | // },
604 | // {
605 | // "scope": [
606 | // "variable.other.constant",
607 | // "variable.other.enummember"
608 | // ],
609 | // "settings": {
610 | // "foreground": "#4FC1FF"
611 | // }
612 | // },
613 | // {
614 | // "scope": [
615 | // "meta.object-literal.key"
616 | // ],
617 | // "settings": {
618 | // "foreground": "#9CDCFE"
619 | // }
620 | // },
621 | // {
622 | // "scope": [
623 | // "support.constant.property-value",
624 | // "support.constant.font-name",
625 | // "support.constant.media-type",
626 | // "support.constant.media",
627 | // "constant.other.color.rgb-value",
628 | // "constant.other.rgb-value",
629 | // "support.constant.color"
630 | // ],
631 | // "settings": {
632 | // "foreground": "#CE9178"
633 | // }
634 | // },
635 | // {
636 | // "scope": [
637 | // "punctuation.definition.group.regexp",
638 | // "punctuation.definition.group.assertion.regexp",
639 | // "punctuation.definition.character-class.regexp",
640 | // "punctuation.character.set.begin.regexp",
641 | // "punctuation.character.set.end.regexp",
642 | // "keyword.operator.negation.regexp",
643 | // "support.other.parenthesis.regexp"
644 | // ],
645 | // "settings": {
646 | // "foreground": "#CE9178"
647 | // }
648 | // },
649 | // {
650 | // "scope": [
651 | // "constant.character.character-class.regexp",
652 | // "constant.other.character-class.set.regexp",
653 | // "constant.other.character-class.regexp",
654 | // "constant.character.set.regexp"
655 | // ],
656 | // "settings": {
657 | // "foreground": "#D16969"
658 | // }
659 | // },
660 | // {
661 | // "scope": [
662 | // "keyword.operator.or.regexp",
663 | // "keyword.control.anchor.regexp"
664 | // ],
665 | // "settings": {
666 | // "foreground": "#DCDCAA"
667 | // }
668 | // },
669 | // {
670 | // "scope": "keyword.operator.quantifier.regexp",
671 | // "settings": {
672 | // "foreground": "#D7BA7D"
673 | // }
674 | // },
675 | // {
676 | // "scope": "constant.character",
677 | // "settings": {
678 | // "foreground": "#569CD6"
679 | // }
680 | // },
681 | // {
682 | // "scope": "constant.character.escape",
683 | // "settings": {
684 | // "foreground": "#D7BA7D"
685 | // }
686 | // },
687 | // {
688 | // "scope": "entity.name.label",
689 | // "settings": {
690 | // "foreground": "#C8C8C8"
691 | // }
692 | // },
693 | // {
694 | // "scope": "token.info-token",
695 | // "settings": {
696 | // "foreground": "#6796E6"
697 | // }
698 | // },
699 | // {
700 | // "scope": "token.warn-token",
701 | // "settings": {
702 | // "foreground": "#CD9731"
703 | // }
704 | // },
705 | // {
706 | // "scope": "token.error-token",
707 | // "settings": {
708 | // "foreground": "#F44747"
709 | // }
710 | // },
711 | // {
712 | // "scope": "token.debug-token",
713 | // "settings": {
714 | // "foreground": "#B267E6"
715 | // }
716 | // }
717 | ]
718 | }
719 |
--------------------------------------------------------------------------------
/nushell.theme-minimal-light.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "vscode://schemas/color-theme",
3 | "type": "light",
4 | "tokenColors": [
5 | // "FlatShape__InternalCommand": "#61d6d6", //"Cyan.bold"
6 | {
7 | "scope": ["keyword.control.nushell"],
8 | "settings": {
9 | "foreground": "#AF00DB"
10 | // "fontStyle": "bold"
11 | }
12 | },
13 |
14 | // I used this for things like
15 | // alias = blah
16 | // {
17 | // "scope": ["source.nushell"],
18 | // "settings": {
19 | // "foreground": "#0000ff"
20 | // // "fontStyle": "bold"
21 | // }
22 | // },
23 |
24 | {
25 | "scope": "keyword.control.other.nushell",
26 | "settings": {
27 | "foreground": "#FF0000",
28 | "fontStyle": "bold"
29 | }
30 | },
31 |
32 | // these are the sub commands
33 | {
34 | "scope": ["keyword.other"],
35 | "settings": {
36 | "foreground": "#0084ff"
37 | }
38 | },
39 |
40 | // "FlatShape__String": "#12820e", //"Green"
41 | {
42 | // "scope": ["string", "meta.embedded.assembly"],
43 | "scope": ["string.quoted"],
44 | "settings": {
45 | "foreground": "#0000ff"
46 | }
47 | },
48 |
49 | // "FlatShape__Operator": "#AAAA00", //"Yellow" #c19c00
50 | {
51 | "scope": ["punctuation.nushell"],
52 | "settings": {
53 | "foreground": "#8a8701"
54 | // "fontStyle": "bold"
55 | }
56 | },
57 |
58 | // "FlatShape__Comment": "#55FF55", //"Green.bold", #16c60c
59 | {
60 | "scope": ["comment"],
61 | "settings": {
62 | "foreground": "#008000"
63 | // "fontStyle": "bold"
64 | }
65 | },
66 |
67 | // for range 0..10
68 | {
69 | "scope": ["constant", "constant.numeric"],
70 | "settings": {
71 | "foreground": "#098658"
72 | // "fontStyle": "bold"
73 | }
74 | },
75 |
76 | // "FlatShape__Flag": "#3878ff", //"Blue.bold"
77 | // "FlatShape__ShorthandFlag": "#3878ff", //"Blue.bold"
78 | // for --flag
79 | {
80 | "scope": ["variable.parameter.function"],
81 | "settings": {
82 | "foreground": "#3878ff"
83 | // "fontStyle": "bold"
84 | }
85 | },
86 |
87 | // "FlatShape__Variable_or_FlatShape__Identifier": "#821791", //"Purple"
88 | {
89 | "scope": ["variable.name", "variable.name.nushell"],
90 | "settings": {
91 | "foreground": "#aa44dd"
92 | }
93 | },
94 |
95 | {
96 | "scope": ["variable.other"],
97 | "settings": {
98 | "foreground": "#0070C1"
99 | }
100 | },
101 |
102 | {
103 | "scope": ["variable.language"],
104 | "settings": {
105 | "foreground": "#0000ff"
106 | }
107 | },
108 |
109 | // "FlatShape__Int": "#b4009e", //"Purple.bold"
110 | // "FlatShape__Decimal": "#b4009e", //"Purple.bold"
111 | {
112 | "scope": [
113 | "constant.numeric",
114 | "variable.other.enummember",
115 | "keyword.operator.plus.exponent",
116 | "keyword.operator.minus.exponent"
117 | ],
118 | "settings": {
119 | "foreground": "#098658"
120 | }
121 | },
122 |
123 | // for def
124 | {
125 | "scope": ["entity.name.function"],
126 | "settings": {
127 | "foreground": "#795E26"
128 | }
129 | },
130 |
131 | {
132 | "scope": ["entity.name.type"],
133 | "settings": {
134 | "foreground": "#267f99"
135 | }
136 | },
137 |
138 | // for var:storage_type
139 | {
140 | "scope": ["storage.type"],
141 | "settings": {
142 | "foreground": "#267f99"
143 | }
144 | },
145 |
146 | {
147 | "scope": ["storage.modifier"],
148 | "settings": {
149 | "foreground": "#0000ff"
150 | }
151 | }
152 |
153 | // {
154 | // "scope": [
155 | // "meta.embedded",
156 | // "source.groovy.embedded"
157 | // ],
158 | // "settings": {
159 | // "foreground": "#D4D4D4"
160 | // }
161 | // },
162 | // {
163 | // "scope": "emphasis",
164 | // "settings": {
165 | // "fontStyle": "italic"
166 | // }
167 | // },
168 | // {
169 | // "scope": "strong",
170 | // "settings": {
171 | // "fontStyle": "bold"
172 | // }
173 | // },
174 | // {
175 | // "scope": "header",
176 | // "settings": {
177 | // "foreground": "#000080"
178 | // }
179 | // },
180 | // {
181 | // "scope": "comment",
182 | // "settings": {
183 | // "foreground": "#6A9955"
184 | // }
185 | // },
186 | // {
187 | // "scope": "constant.language",
188 | // "settings": {
189 | // "foreground": "#569CD6"
190 | // }
191 | // },
192 | // {
193 | // "scope": [
194 | // "constant.numeric",
195 | // "variable.other.enummember",
196 | // "keyword.operator.plus.exponent",
197 | // "keyword.operator.minus.exponent"
198 | // ],
199 | // "settings": {
200 | // "foreground": "#FF55FF"
201 | // }
202 | // },
203 | // {
204 | // "scope": "constant.regexp",
205 | // "settings": {
206 | // "foreground": "#646695"
207 | // }
208 | // },
209 | // {
210 | // "scope": "entity.name.tag",
211 | // "settings": {
212 | // "foreground": "#569CD6"
213 | // }
214 | // },
215 | // {
216 | // "scope": "entity.name.tag.css",
217 | // "settings": {
218 | // "foreground": "#D7BA7D"
219 | // }
220 | // },
221 | // {
222 | // "scope": "entity.other.attribute-name",
223 | // "settings": {
224 | // "foreground": "#9CDCFE"
225 | // }
226 | // },
227 | // {
228 | // "scope": [
229 | // "entity.other.attribute-name.class.css",
230 | // "entity.other.attribute-name.class.mixin.css",
231 | // "entity.other.attribute-name.id.css",
232 | // "entity.other.attribute-name.parent-selector.css",
233 | // "entity.other.attribute-name.pseudo-class.css",
234 | // "entity.other.attribute-name.pseudo-element.css",
235 | // "source.css.less entity.other.attribute-name.id",
236 | // "entity.other.attribute-name.scss"
237 | // ],
238 | // "settings": {
239 | // "foreground": "#D7BA7D"
240 | // }
241 | // },
242 | // {
243 | // "scope": "invalid",
244 | // "settings": {
245 | // "foreground": "#F44747"
246 | // }
247 | // },
248 | // {
249 | // "scope": "markup.underline",
250 | // "settings": {
251 | // "fontStyle": "underline"
252 | // }
253 | // },
254 | // {
255 | // "scope": "markup.bold",
256 | // "settings": {
257 | // "foreground": "#569CD6",
258 | // "fontStyle": "bold"
259 | // }
260 | // },
261 | // {
262 | // "scope": "markup.heading",
263 | // "settings": {
264 | // "foreground": "#569CD6",
265 | // "fontStyle": "bold"
266 | // }
267 | // },
268 | // {
269 | // "scope": "markup.italic",
270 | // "settings": {
271 | // "fontStyle": "italic"
272 | // }
273 | // },
274 | // {
275 | // "scope": "markup.inserted",
276 | // "settings": {
277 | // "foreground": "#B5CEA8"
278 | // }
279 | // },
280 | // {
281 | // "scope": "markup.deleted",
282 | // "settings": {
283 | // "foreground": "#CE9178"
284 | // }
285 | // },
286 | // {
287 | // "scope": "markup.changed",
288 | // "settings": {
289 | // "foreground": "#569CD6"
290 | // }
291 | // },
292 | // {
293 | // "scope": "punctuation.definition.quote.begin.markdown",
294 | // "settings": {
295 | // "foreground": "#6A9955"
296 | // }
297 | // },
298 | // {
299 | // "scope": "punctuation.definition.list.begin.markdown",
300 | // "settings": {
301 | // "foreground": "#6796E6"
302 | // }
303 | // },
304 | // {
305 | // "scope": "markup.inline.raw",
306 | // "settings": {
307 | // "foreground": "#CE9178"
308 | // }
309 | // },
310 | // {
311 | // "scope": "punctuation.definition.tag",
312 | // "settings": {
313 | // "foreground": "#808080"
314 | // }
315 | // },
316 | // {
317 | // "scope": [
318 | // "meta.preprocessor",
319 | // "entity.name.function.preprocessor"
320 | // ],
321 | // "settings": {
322 | // "foreground": "#569CD6"
323 | // }
324 | // },
325 | // {
326 | // "scope": "meta.preprocessor.string",
327 | // "settings": {
328 | // "foreground": "#CE9178"
329 | // }
330 | // },
331 | // {
332 | // "scope": "meta.preprocessor.numeric",
333 | // "settings": {
334 | // "foreground": "#B5CEA8"
335 | // }
336 | // },
337 | // {
338 | // "scope": "meta.structure.dictionary.key.python",
339 | // "settings": {
340 | // "foreground": "#9CDCFE"
341 | // }
342 | // },
343 | // {
344 | // "scope": "meta.diff.header",
345 | // "settings": {
346 | // "foreground": "#569CD6"
347 | // }
348 | // },
349 | // {
350 | // "scope": "storage",
351 | // "settings": {
352 | // "foreground": "#569CD6"
353 | // }
354 | // },
355 | // {
356 | // "scope": "storage.type",
357 | // "settings": {
358 | // "foreground": "#569CD6"
359 | // }
360 | // },
361 | // {
362 | // "scope": [
363 | // "storage.modifier",
364 | // "keyword.operator.noexcept"
365 | // ],
366 | // "settings": {
367 | // "foreground": "#569CD6"
368 | // }
369 | // },
370 | // {
371 | // "scope": [
372 | // "string",
373 | // "meta.embedded.assembly"
374 | // ],
375 | // "settings": {
376 | // "foreground": "#00AA00"
377 | // }
378 | // },
379 | // {
380 | // "scope": "string.tag",
381 | // "settings": {
382 | // "foreground": "#CE9178"
383 | // }
384 | // },
385 | // {
386 | // "scope": "string.value",
387 | // "settings": {
388 | // "foreground": "#CE9178"
389 | // }
390 | // },
391 | // {
392 | // "scope": "string.regexp",
393 | // "settings": {
394 | // "foreground": "#D16969"
395 | // }
396 | // },
397 | // {
398 | // "scope": [
399 | // "punctuation.definition.template-expression.begin",
400 | // "punctuation.definition.template-expression.end",
401 | // "punctuation.section.embedded"
402 | // ],
403 | // "settings": {
404 | // "foreground": "#569CD6"
405 | // }
406 | // },
407 | // {
408 | // "scope": [
409 | // "meta.template.expression"
410 | // ],
411 | // "settings": {
412 | // "foreground": "#D4D4D4"
413 | // }
414 | // },
415 | // {
416 | // "scope": [
417 | // "support.type.vendored.property-name",
418 | // "support.type.property-name",
419 | // "variable.css",
420 | // "variable.scss",
421 | // "variable.other.less",
422 | // "source.coffee.embedded"
423 | // ],
424 | // "settings": {
425 | // "foreground": "#9CDCFE"
426 | // }
427 | // },
428 | // {
429 | // "scope": "keyword",
430 | // "settings": {
431 | // "foreground": "#569CD6"
432 | // }
433 | // },
434 | // {
435 | // "scope": "keyword.control",
436 | // "settings": {
437 | // "foreground": "#0ff"
438 | // }
439 | // },
440 | // {
441 | // "scope": "keyword.operator",
442 | // "settings": {
443 | // "foreground": "#D4D4D4"
444 | // }
445 | // },
446 | // {
447 | // "scope": [
448 | // "keyword.operator.new",
449 | // "keyword.operator.expression",
450 | // "keyword.operator.cast",
451 | // "keyword.operator.sizeof",
452 | // "keyword.operator.alignof",
453 | // "keyword.operator.typeid",
454 | // "keyword.operator.alignas",
455 | // "keyword.operator.instanceof",
456 | // "keyword.operator.logical.python",
457 | // "keyword.operator.wordlike"
458 | // ],
459 | // "settings": {
460 | // "foreground": "#569CD6"
461 | // }
462 | // },
463 | // {
464 | // "scope": "keyword.other.unit",
465 | // "settings": {
466 | // "foreground": "#B5CEA8"
467 | // }
468 | // },
469 | // {
470 | // "scope": [
471 | // "punctuation.section.embedded.begin.php",
472 | // "punctuation.section.embedded.end.php"
473 | // ],
474 | // "settings": {
475 | // "foreground": "#569CD6"
476 | // }
477 | // },
478 | // {
479 | // "scope": "support.function.git-rebase",
480 | // "settings": {
481 | // "foreground": "#9CDCFE"
482 | // }
483 | // },
484 | // {
485 | // "scope": "constant.sha.git-rebase",
486 | // "settings": {
487 | // "foreground": "#B5CEA8"
488 | // }
489 | // },
490 | // {
491 | // "scope": [
492 | // "storage.modifier.import.java",
493 | // "variable.language.wildcard.java",
494 | // "storage.modifier.package.java"
495 | // ],
496 | // "settings": {
497 | // "foreground": "#D4D4D4"
498 | // }
499 | // },
500 | // {
501 | // "scope": "variable.language",
502 | // "settings": {
503 | // "foreground": "#569CD6"
504 | // }
505 | // },
506 | // {
507 | // "scope": [
508 | // "entity.name.function",
509 | // "support.function",
510 | // "support.constant.handlebars",
511 | // "source.powershell variable.other.member",
512 | // "entity.name.operator.custom-literal"
513 | // ],
514 | // "settings": {
515 | // "foreground": "#DCDCAA"
516 | // }
517 | // },
518 | // {
519 | // "scope": [
520 | // "meta.return-type",
521 | // "support.class",
522 | // "support.type",
523 | // "entity.name.type",
524 | // "entity.name.namespace",
525 | // "entity.other.attribute",
526 | // "entity.name.scope-resolution",
527 | // "entity.name.class",
528 | // "storage.type.numeric.go",
529 | // "storage.type.byte.go",
530 | // "storage.type.boolean.go",
531 | // "storage.type.string.go",
532 | // "storage.type.uintptr.go",
533 | // "storage.type.error.go",
534 | // "storage.type.rune.go",
535 | // "storage.type.cs",
536 | // "storage.type.generic.cs",
537 | // "storage.type.modifier.cs",
538 | // "storage.type.variable.cs",
539 | // "storage.type.annotation.java",
540 | // "storage.type.generic.java",
541 | // "storage.type.java",
542 | // "storage.type.object.array.java",
543 | // "storage.type.primitive.array.java",
544 | // "storage.type.primitive.java",
545 | // "storage.type.token.java",
546 | // "storage.type.groovy",
547 | // "storage.type.annotation.groovy",
548 | // "storage.type.parameters.groovy",
549 | // "storage.type.generic.groovy",
550 | // "storage.type.object.array.groovy",
551 | // "storage.type.primitive.array.groovy",
552 | // "storage.type.primitive.groovy"
553 | // ],
554 | // "settings": {
555 | // "foreground": "#4EC9B0"
556 | // }
557 | // },
558 | // {
559 | // "scope": [
560 | // "meta.type.cast.expr",
561 | // "meta.type.new.expr",
562 | // "support.constant.math",
563 | // "support.constant.dom",
564 | // "support.constant.json",
565 | // "entity.other.inherited-class"
566 | // ],
567 | // "settings": {
568 | // "foreground": "#4EC9B0"
569 | // }
570 | // },
571 | // {
572 | // "scope": [
573 | // "keyword.control",
574 | // "source.cpp keyword.operator.new",
575 | // "keyword.operator.delete",
576 | // "keyword.other.using",
577 | // "keyword.other.operator",
578 | // "entity.name.operator"
579 | // ],
580 | // "settings": {
581 | // "foreground": "#55FFFF"
582 | // }
583 | // },
584 | // {
585 | // "scope": [
586 | // "variable",
587 | // "meta.definition.variable.name",
588 | // "support.variable",
589 | // "entity.name.variable"
590 | // ],
591 | // "settings": {
592 | // "foreground": "#AA00AA"
593 | // }
594 | // },
595 | // {
596 | // "scope": [
597 | // "variable.parameter.function.nushell"
598 | // ],
599 | // "settings": {
600 | // "foreground": "#5555FF",
601 | // // "fontStyle": "bold"
602 | // }
603 | // },
604 | // {
605 | // "scope": [
606 | // "variable.other.constant",
607 | // "variable.other.enummember"
608 | // ],
609 | // "settings": {
610 | // "foreground": "#4FC1FF"
611 | // }
612 | // },
613 | // {
614 | // "scope": [
615 | // "meta.object-literal.key"
616 | // ],
617 | // "settings": {
618 | // "foreground": "#9CDCFE"
619 | // }
620 | // },
621 | // {
622 | // "scope": [
623 | // "support.constant.property-value",
624 | // "support.constant.font-name",
625 | // "support.constant.media-type",
626 | // "support.constant.media",
627 | // "constant.other.color.rgb-value",
628 | // "constant.other.rgb-value",
629 | // "support.constant.color"
630 | // ],
631 | // "settings": {
632 | // "foreground": "#CE9178"
633 | // }
634 | // },
635 | // {
636 | // "scope": [
637 | // "punctuation.definition.group.regexp",
638 | // "punctuation.definition.group.assertion.regexp",
639 | // "punctuation.definition.character-class.regexp",
640 | // "punctuation.character.set.begin.regexp",
641 | // "punctuation.character.set.end.regexp",
642 | // "keyword.operator.negation.regexp",
643 | // "support.other.parenthesis.regexp"
644 | // ],
645 | // "settings": {
646 | // "foreground": "#CE9178"
647 | // }
648 | // },
649 | // {
650 | // "scope": [
651 | // "constant.character.character-class.regexp",
652 | // "constant.other.character-class.set.regexp",
653 | // "constant.other.character-class.regexp",
654 | // "constant.character.set.regexp"
655 | // ],
656 | // "settings": {
657 | // "foreground": "#D16969"
658 | // }
659 | // },
660 | // {
661 | // "scope": [
662 | // "keyword.operator.or.regexp",
663 | // "keyword.control.anchor.regexp"
664 | // ],
665 | // "settings": {
666 | // "foreground": "#DCDCAA"
667 | // }
668 | // },
669 | // {
670 | // "scope": "keyword.operator.quantifier.regexp",
671 | // "settings": {
672 | // "foreground": "#D7BA7D"
673 | // }
674 | // },
675 | // {
676 | // "scope": "constant.character",
677 | // "settings": {
678 | // "foreground": "#569CD6"
679 | // }
680 | // },
681 | // {
682 | // "scope": "constant.character.escape",
683 | // "settings": {
684 | // "foreground": "#D7BA7D"
685 | // }
686 | // },
687 | // {
688 | // "scope": "entity.name.label",
689 | // "settings": {
690 | // "foreground": "#C8C8C8"
691 | // }
692 | // },
693 | // {
694 | // "scope": "token.info-token",
695 | // "settings": {
696 | // "foreground": "#6796E6"
697 | // }
698 | // },
699 | // {
700 | // "scope": "token.warn-token",
701 | // "settings": {
702 | // "foreground": "#CD9731"
703 | // }
704 | // },
705 | // {
706 | // "scope": "token.error-token",
707 | // "settings": {
708 | // "foreground": "#F44747"
709 | // }
710 | // },
711 | // {
712 | // "scope": "token.debug-token",
713 | // "settings": {
714 | // "foreground": "#B267E6"
715 | // }
716 | // }
717 | ]
718 | }
719 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vscode-nushell-lang",
3 | "displayName": "vscode-nushell-lang",
4 | "description": "nushell language for vscode",
5 | "author": "The Nushell Project Developers",
6 | "version": "2.0.4",
7 | "preview": false,
8 | "license": "MIT",
9 | "publisher": "TheNuProjectContributors",
10 | "homepage": "https://www.nushell.sh/",
11 | "repository": {
12 | "type": "git",
13 | "url": "https://github.com/nushell/vscode-nushell-lang.git"
14 | },
15 | "bugs": {
16 | "url": "https://github.com/nushell/vscode-nushell-lang/issues"
17 | },
18 | "engines": {
19 | "vscode": "^1.93.0"
20 | },
21 | "icon": "assets/nushell.ico",
22 | "categories": [
23 | "Programming Languages",
24 | "Snippets"
25 | ],
26 | "activationEvents": [
27 | "onTerminalProfile:nushell_default"
28 | ],
29 | "main": "out/extension.js",
30 | "contributes": {
31 | "languages": [
32 | {
33 | "id": "nushell",
34 | "aliases": [
35 | "nushell",
36 | "nu"
37 | ],
38 | "extensions": [
39 | ".nu"
40 | ],
41 | "icon": {
42 | "light": "assets/nu.svg",
43 | "dark": "assets/nu.svg"
44 | },
45 | "firstLine": "^#!\\s*/?.*\\bnu\\b",
46 | "configuration": "./language-configuration.json"
47 | }
48 | ],
49 | "grammars": [
50 | {
51 | "language": "nushell",
52 | "scopeName": "source.nushell",
53 | "path": "./syntaxes/nushell.tmLanguage.json"
54 | },
55 | {
56 | "scopeName": "markdown.nushell.codeblock",
57 | "path": "./syntaxes/codeblock.json",
58 | "injectTo": [
59 | "text.html.markdown"
60 | ],
61 | "embeddedLanguages": {
62 | "meta.embedded.block.nushell": "nushell"
63 | }
64 | }
65 | ],
66 | "keybindings": [
67 | {
68 | "command": "start https://www.nushell.sh/book/",
69 | "key": "ctrl+f1",
70 | "when": "editorTextFocus && editorLangId == 'nushell'"
71 | },
72 | {
73 | "command": "editor.action.insertSnippet",
74 | "when": "editorTextFocus && editorLangId == 'nushell'",
75 | "mac": "cmd+alt+j",
76 | "win": "ctrl+alt+j",
77 | "linux": "ctrl+alt+j"
78 | }
79 | ],
80 | "snippets": [
81 | {
82 | "language": "nushell",
83 | "path": "./snippets/nushell.json"
84 | }
85 | ],
86 | "terminal": {
87 | "profiles": [
88 | {
89 | "title": "Nushell",
90 | "id": "nushell_default"
91 | }
92 | ]
93 | },
94 | "configuration": {
95 | "type": "object",
96 | "title": "Nushell IDE Support",
97 | "properties": {
98 | "nushellLanguageServer.maxNumberOfProblems": {
99 | "scope": "resource",
100 | "type": "number",
101 | "default": 100,
102 | "description": "Controls the maximum number of problems produced by the server."
103 | },
104 | "nushellLanguageServer.trace.server": {
105 | "scope": "window",
106 | "type": "string",
107 | "enum": [
108 | "off",
109 | "messages",
110 | "verbose"
111 | ],
112 | "default": "messages",
113 | "description": "Traces the communication between VS Code and the language server."
114 | },
115 | "nushellLanguageServer.hints.showInferredTypes": {
116 | "scope": "resource",
117 | "type": "boolean",
118 | "default": true,
119 | "description": "Display types inferred by nushell."
120 | },
121 | "nushellLanguageServer.nushellExecutablePath": {
122 | "scope": "resource",
123 | "type": "string",
124 | "default": "nu",
125 | "description": "The path to the nushell executable."
126 | },
127 | "nushellLanguageServer.maxNushellInvocationTime": {
128 | "scope": "resource",
129 | "type": "number",
130 | "default": 10000000,
131 | "description": "The maximum time in milliseconds to wait for nushell to respond."
132 | },
133 | "nushellLanguageServer.includeDirs": {
134 | "type": "array",
135 | "items": {
136 | "type": "string"
137 | },
138 | "description": "The directories to include in the nushell environment.",
139 | "scope": "window"
140 | }
141 | }
142 | },
143 | "commands": [
144 | {
145 | "command": "nushell.stopLanguageServer",
146 | "title": "Nushell: Stop Language Server"
147 | },
148 | {
149 | "command": "nushell.startLanguageServer",
150 | "title": "Nushell: Start Language Server"
151 | }
152 | ]
153 | },
154 | "scripts": {
155 | "vscode:prepublish": "npm run lint && npm run compile",
156 | "esbuild-base": "npx esbuild client/src/extension.ts --bundle --outdir=out --external:vscode --format=cjs --platform=node",
157 | "esbuild": "npm run esbuild-base -- --sourcemap --minify",
158 | "compile": "npm run esbuild",
159 | "install": "cd client && npm install && cd ..",
160 | "watch": "npm run esbuild-base -- --sourcemap --watch",
161 | "lint": "npx eslint ./client/src/extension.ts",
162 | "test": "sh ./scripts/e2e.sh",
163 | "test:grammar": "vscode-tmgrammar-snap tests/cases/*",
164 | "fmt": "prettier . --write"
165 | },
166 | "dependencies": {
167 | "glob": "11.0.3",
168 | "nushell-lsp-client": "file:client",
169 | "os": "0.1.2"
170 | },
171 | "devDependencies": {
172 | "@types/mocha": "10.0.10",
173 | "@types/node": "24.3.0",
174 | "@types/tmp": "0.2.6",
175 | "@types/vscode": "^1.93.0",
176 | "@typescript-eslint/eslint-plugin": "^8.42.0",
177 | "@typescript-eslint/parser": "^8.42.0",
178 | "@vscode/vsce": "3.6.0",
179 | "esbuild": "0.25.9",
180 | "eslint": "^9.34.0",
181 | "mocha": "11.7.2",
182 | "prettier": "3.6.2",
183 | "ts-loader": "9.5.4",
184 | "typescript": "5.9.2",
185 | "vscode-tmgrammar-test": "0.1.3",
186 | "webpack": "5.101.3",
187 | "webpack-cli": "6.0.1"
188 | },
189 | "keywords": [
190 | "nushell",
191 | "nu",
192 | "shell",
193 | "scripting"
194 | ],
195 | "galleryBanner": {
196 | "color": "#008000",
197 | "theme": "light"
198 | }
199 | }
200 |
--------------------------------------------------------------------------------
/scripts/e2e.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | export CODE_TESTS_PATH="$(pwd)/client/out/test"
4 | export CODE_TESTS_WORKSPACE="$(pwd)/client/testFixture"
5 |
6 | node "$(pwd)/client/out/test/runTest"
--------------------------------------------------------------------------------
/snippets/convention.md:
--------------------------------------------------------------------------------
1 | # Convention for snippets
2 |
3 | ## Naming
4 |
5 | Naming convention for `description`:
6 |
7 | - for operators it's `"" operator` (e.g. `"in" operator`)
8 | - for functions it's `function definition` or `"" function definition`
9 | - for builtins it's `"" invocation` (e.g. `"alias" invocation"`) or
10 | `" " invocation` (e.g. `"bits or" invocation"`)
11 | - for shell shebang it's `shebang`
12 | - for anything else it's any string
13 |
14 | Naming convention for `prefix`:
15 |
16 | - for operators it's `` (e.g. `in`)
17 | - for functions it's `function`, `` (e.g. `main`)
18 | - for builtins it's `` (e.g. `alias`) or `-`
19 | (e.g. `bits-or`)
20 | - for shebang it's `shebang`
21 | - for anything else it's any string
22 |
23 | If snippet contains a documenting comment than prefix should begin with at `@`
24 | symbol.
25 |
26 | Snippets are only created for commands those satisfy at least one condition:
27 |
28 | - read data from stdin
29 | - have at least one mandatory or optional argument (not `...rest`)
30 | Here by argument positional argument or argument for an option is meant.
31 |
32 | If there are options available for command or a subcommand then there is no
33 | restriction about what options to pick to put in snippet definition.
34 |
35 | Always prefer pipes over direct argument passing.
36 |
37 | ## Placeholders
38 |
39 | Placeholders by default should describe what kind of value is expected like
40 | `${1:path/to/directory}`. But when there is a format defined for placeholder
41 | then example value should be used like `${1:ff}`.
42 |
43 | Placeholders can not to list all available choices like
44 | `${1|big5,euc-jp,euc-kr,gbk,iso-8859-1,utf-16,cp1252,latin5|}`. When there are
45 | more then 8 alternatives, provide the most common ones in terms of usage
46 | frequency (it doesn't apply for `date` snippet, data
47 | types, durations and subcommands).
48 |
49 | ## Grouping
50 |
51 | Always group snippets presenting different subcommands for the same command and
52 | sharing the same set of options via placeholders with alternatives when there
53 | is no snippet for this command without subcommands. Write this:
54 |
55 | ```json
56 | {
57 | "hash builtin": {
58 | "prefix": "hash",
59 | "description": "\"hash\" invocation",
60 | "body": "${1:command} | hash ${2|md5,sha256|}"
61 | }
62 | }
63 | ```
64 |
65 | instead of:
66 |
67 | ```json
68 | {
69 | "hash md5 builtin": {
70 | "prefix": "hash-md5",
71 | "description": "\"hash md5\" invocation",
72 | "body": "${1:command} | hash md5"
73 | },
74 | "hash sha256 builtin": {
75 | "prefix": "hash-sha256",
76 | "description": "\"hash sha256\" invocation",
77 | "body": "${1:command} | hash sha256"
78 | }
79 | }
80 | ```
81 |
--------------------------------------------------------------------------------
/syntaxes/codeblock.json:
--------------------------------------------------------------------------------
1 | {
2 | "fileTypes": [],
3 | "injectionSelector": "L:text.html.markdown",
4 | "patterns": [
5 | {
6 | "include": "#nushell-code-block"
7 | }
8 | ],
9 | "repository": {
10 | "nushell-code-block": {
11 | "begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(nushell)(\\s+[^`~]*)?$)",
12 | "name": "markup.fenced_code.block.markdown",
13 | "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
14 | "beginCaptures": {
15 | "3": {
16 | "name": "punctuation.definition.markdown"
17 | },
18 | "4": {
19 | "name": "fenced_code.block.language.markdown"
20 | },
21 | "5": {
22 | "name": "fenced_code.block.language.attributes.markdown"
23 | }
24 | },
25 | "endCaptures": {
26 | "3": {
27 | "name": "punctuation.definition.markdown"
28 | }
29 | },
30 | "patterns": [
31 | {
32 | "begin": "(^|\\G)(\\s*)(.*)",
33 | "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
34 | "contentName": "meta.embedded.block.nushell",
35 | "patterns": [
36 | {
37 | "include": "source.nushell"
38 | }
39 | ]
40 | }
41 | ]
42 | }
43 | },
44 | "scopeName": "markdown.nushell.codeblock"
45 | }
--------------------------------------------------------------------------------
/syntaxes/nushell.tmLanguage.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3 | "name": "nushell",
4 | "scopeName": "source.nushell",
5 | "patterns": [
6 | { "include": "#define-variable" },
7 | { "include": "#define-alias" },
8 | { "include": "#function" },
9 | { "include": "#extern" },
10 | { "include": "#module" },
11 | { "include": "#use-module" },
12 | { "include": "#expression" },
13 | { "include": "#comment" }
14 | ],
15 | "repository": {
16 | "string": {
17 | "patterns": [
18 | { "include": "#string-single-quote" },
19 | { "include": "#string-backtick" },
20 | { "include": "#string-double-quote" },
21 | { "include": "#string-interpolated-double" },
22 | { "include": "#string-interpolated-single" },
23 | { "include": "#string-raw" },
24 | { "include": "#string-bare" }
25 | ]
26 | },
27 | "string-escape": {
28 | "match": "\\\\(?:[bfrnt\\\\'\"/]|u[0-9a-fA-F]{4})",
29 | "name": "constant.character.escape.nushell"
30 | },
31 | "string-bare": {
32 | "match": "[^$\\[{(\"',|#\\s|;][^\\[\\]{}()\"'\\s,|;]*",
33 | "name": "string.bare.nushell"
34 | },
35 | "string-raw": {
36 | "begin": "r(#+)'",
37 | "beginCaptures": {
38 | "0": { "name": "punctuation.definition.string.begin.nushell" }
39 | },
40 | "end": "'\\1",
41 | "endCaptures": {
42 | "0": { "name": "punctuation.definition.string.end.nushell" }
43 | },
44 | "name": "string.raw.nushell"
45 | },
46 | "string-single-quote": {
47 | "begin": "'",
48 | "beginCaptures": {
49 | "0": { "name": "punctuation.definition.string.begin.nushell" }
50 | },
51 | "end": "'",
52 | "endCaptures": {
53 | "0": { "name": "punctuation.definition.string.end.nushell" }
54 | },
55 | "name": "string.quoted.single.nushell"
56 | },
57 | "string-backtick": {
58 | "begin": "`",
59 | "beginCaptures": {
60 | "0": { "name": "punctuation.definition.string.begin.nushell" }
61 | },
62 | "end": "`",
63 | "endCaptures": {
64 | "0": { "name": "punctuation.definition.string.end.nushell" }
65 | },
66 | "name": "string.quoted.single.nushell"
67 | },
68 | "string-double-quote": {
69 | "begin": "\"",
70 | "beginCaptures": {
71 | "0": { "name": "punctuation.definition.string.begin.nushell" }
72 | },
73 | "end": "\"",
74 | "endCaptures": {
75 | "0": { "name": "punctuation.definition.string.end.nushell" }
76 | },
77 | "name": "string.quoted.double.nushell",
78 | "patterns": [
79 | {
80 | "match": "\\w+"
81 | },
82 | { "include": "#string-escape" }
83 | ]
84 | },
85 | "string-interpolated-double": {
86 | "begin": "\\$\"",
87 | "beginCaptures": {
88 | "0": { "name": "punctuation.definition.string.begin.nushell" }
89 | },
90 | "end": "\"",
91 | "endCaptures": {
92 | "0": { "name": "punctuation.definition.string.end.nushell" }
93 | },
94 | "name": "string.interpolated.double.nushell",
95 | "patterns": [
96 | {
97 | "match": "\\\\[()]",
98 | "name": "constant.character.escape.nushell"
99 | },
100 | { "include": "#string-escape" },
101 | { "include": "#paren-expression" }
102 | ]
103 | },
104 | "string-interpolated-single": {
105 | "begin": "\\$'",
106 | "beginCaptures": {
107 | "0": { "name": "punctuation.definition.string.begin.nushell" }
108 | },
109 | "end": "'",
110 | "endCaptures": {
111 | "0": { "name": "punctuation.definition.string.end.nushell" }
112 | },
113 | "name": "string.interpolated.single.nushell",
114 | "patterns": [{ "include": "#paren-expression" }]
115 | },
116 | "control-keywords": {
117 | "comment": "Regex generated with list-to-tree (https://github.com/glcraft/list-to-tree)",
118 | "match": "(?=]=?|[!=]~|\\+\\+=?)(?= |$)",
225 | "name": "keyword.control.nushell"
226 | },
227 | "operators": {
228 | "patterns": [
229 | { "include": "#operators-word" },
230 | { "include": "#operators-symbols" },
231 | { "include": "#ranges" }
232 | ]
233 | },
234 | "table": {
235 | "begin": "\\[",
236 | "beginCaptures": {
237 | "0": { "name": "meta.brace.square.begin.nushell" }
238 | },
239 | "end": "\\]",
240 | "endCaptures": {
241 | "0": { "name": "meta.brace.square.end.nushell" }
242 | },
243 | "name": "meta.table.nushell",
244 | "patterns": [
245 | { "include": "#spread" },
246 | { "include": "#value" },
247 | {
248 | "match": ",",
249 | "name": "punctuation.separator.nushell"
250 | }
251 | ]
252 | },
253 | "types": {
254 | "patterns": [
255 | {
256 | "name": "meta.list.nushell",
257 | "begin": "\\b(list)\\s*<",
258 | "beginCaptures": {
259 | "1": { "name": "entity.name.type.nushell" }
260 | },
261 | "end": ">",
262 | "patterns": [{ "include": "#types" }]
263 | },
264 | {
265 | "name": "meta.record.nushell",
266 | "begin": "\\b(record)\\s*<",
267 | "beginCaptures": {
268 | "1": { "name": "entity.name.type.nushell" }
269 | },
270 | "end": ">",
271 | "patterns": [
272 | {
273 | "match": "([\\w\\-]+|\"[\\w\\- ]+\"|'[^']+')\\s*:\\s*",
274 | "captures": {
275 | "1": { "name": "variable.parameter.nushell" }
276 | }
277 | },
278 | { "include": "#types" }
279 | ]
280 | },
281 | {
282 | "match": "\\b(\\w+)\\b",
283 | "name": "entity.name.type.nushell"
284 | }
285 | ]
286 | },
287 | "function-parameter": {
288 | "patterns": [
289 | {
290 | "match": "(-{0,2}|\\.{3})[\\w-]+(?:\\((-[\\w?])\\))?",
291 | "name": "variable.parameter.nushell",
292 | "captures": {
293 | "1": { "name": "keyword.control.nushell" }
294 | }
295 | },
296 | {
297 | "begin": "\\??:\\s*",
298 | "end": "(?=(?:\\s+(?:-{0,2}|\\.{3})[\\w-]+)|(?:\\s*(?:,|\\]|\\||@|=|#|$)))",
299 | "patterns": [{ "include": "#types" }]
300 | },
301 | {
302 | "begin": "@(?=\"|')",
303 | "end": "(?<=\"|')",
304 | "patterns": [{ "include": "#string" }]
305 | },
306 | {
307 | "name": "default.value.nushell",
308 | "begin": "=\\s*",
309 | "end": "(?=(?:\\s+-{0,2}[\\w-]+)|(?:\\s*(?:,|\\]|\\||#|$)))",
310 | "patterns": [{ "include": "#value" }]
311 | }
312 | ]
313 | },
314 | "function-parameters": {
315 | "begin": "\\[",
316 | "beginCaptures": {
317 | "0": { "name": "meta.brace.square.begin.nushell" }
318 | },
319 | "end": "\\]",
320 | "endCaptures": {
321 | "0": { "name": "meta.brace.square.end.nushell" }
322 | },
323 | "patterns": [
324 | { "include": "#function-parameter" },
325 | { "include": "#comment" }
326 | ],
327 | "name": "meta.function.parameters.nushell"
328 | },
329 | "function-multiple-inout": {
330 | "begin": "(?<=]\\s*)(:)\\s+(\\[)",
331 | "beginCaptures": {
332 | "1": { "name": "punctuation.definition.in-out.nushell" },
333 | "2": { "name": "meta.brace.square.begin.nushell" }
334 | },
335 | "end": "\\]",
336 | "endCaptures": {
337 | "0": { "name": "meta.brace.square.end.nushell" }
338 | },
339 | "patterns": [
340 | { "include": "#types" },
341 | {
342 | "match": "\\s*(,)\\s*",
343 | "captures": {
344 | "1": { "name": "punctuation.separator.nushell" }
345 | }
346 | },
347 | {
348 | "match": "\\s+(->)\\s+",
349 | "captures": {
350 | "1": { "name": "keyword.operator.nushell" }
351 | }
352 | }
353 | ]
354 | },
355 | "function-inout": {
356 | "patterns": [
357 | { "include": "#types" },
358 | {
359 | "match": "->",
360 | "name": "keyword.operator.nushell"
361 | },
362 | { "include": "#function-multiple-inout" }
363 | ]
364 | },
365 | "function-body": {
366 | "begin": "\\{",
367 | "beginCaptures": {
368 | "0": { "name": "punctuation.definition.function.begin.nushell" }
369 | },
370 | "end": "\\}",
371 | "endCaptures": {
372 | "0": { "name": "punctuation.definition.function.end.nushell" }
373 | },
374 | "name": "meta.function.body.nushell",
375 | "patterns": [{ "include": "source.nushell" }]
376 | },
377 | "function": {
378 | "begin": "((?:export\\s+)?def)(?:\\s+((?:--\\w+(?:\\s+--\\w+)*)))?\\s+([\\w\\-]+|\"[\\w\\- ]+\"|'[\\w\\- ]+'|`[\\w\\- ]+`)(?:\\s+((?:--\\w+(?:\\s+--\\w+)*)))?",
379 | "beginCaptures": {
380 | "1": { "name": "entity.name.function.nushell" },
381 | "2": { "name": "entity.name.function.nushell" },
382 | "3": { "name": "entity.name.type.nushell" },
383 | "4": { "name": "entity.name.function.nushell" }
384 | },
385 | "end": "(?<=\\})",
386 | "patterns": [
387 | { "include": "#function-parameters" },
388 | { "include": "#function-body" },
389 | { "include": "#function-inout" }
390 | ]
391 | },
392 | "extern": {
393 | "begin": "((?:export\\s+)?extern)\\s+([\\w\\-]+|\"[\\w\\- ]+\")",
394 | "beginCaptures": {
395 | "1": { "name": "entity.name.function.nushell" },
396 | "2": { "name": "entity.name.type.nushell" }
397 | },
398 | "end": "(?<=\\])",
399 | "endCaptures": {
400 | "0": { "name": "punctuation.definition.function.end.nushell" }
401 | },
402 | "patterns": [{ "include": "#function-parameters" }]
403 | },
404 | "module": {
405 | "begin": "((?:export\\s+)?module)\\s+([\\w\\-]+)\\s*\\{",
406 | "beginCaptures": {
407 | "1": { "name": "entity.name.function.nushell" },
408 | "2": { "name": "entity.name.namespace.nushell" }
409 | },
410 | "end": "\\}",
411 | "endCaptures": {
412 | "0": { "name": "punctuation.definition.module.end.nushell" }
413 | },
414 | "name": "meta.module.nushell",
415 | "patterns": [{ "include": "source.nushell" }]
416 | },
417 | "use-module": {
418 | "patterns": [
419 | {
420 | "match": "^\\s*((?:export )?use)\\s+([\\w\\-]+|\"[\\w\\- ]+\"|'[\\w\\- ]+')(?:\\s+([\\w\\-]+|\"[\\w\\- ]+\"|'[\\w\\- ]+'|\\*))?\\s*;?$",
421 | "captures": {
422 | "1": { "name": "entity.name.function.nushell" },
423 | "2": { "name": "entity.name.namespace.nushell" },
424 | "3": { "name": "keyword.other.nushell" }
425 | }
426 | },
427 | {
428 | "begin": "^\\s*((?:export )?use)\\s+([\\w\\-]+|\"[\\w\\- ]+\"|'[\\w\\- ]+')\\s*\\[",
429 | "beginCaptures": {
430 | "1": { "name": "entity.name.function.nushell" },
431 | "2": { "name": "entity.name.namespace.nushell" }
432 | },
433 | "end": "(\\])\\s*;?\\s*$",
434 | "endCaptures": {
435 | "1": { "name": "meta.brace.square.end.nushell" }
436 | },
437 | "patterns": [
438 | {
439 | "match": "([\\w\\-]+|\"[\\w\\- ]+\"|'[\\w\\- ]+'|\\*),?",
440 | "captures": {
441 | "1": { "name": "keyword.other.nushell" }
442 | }
443 | },
444 | {
445 | "include": "#comment"
446 | }
447 | ]
448 | },
449 | {
450 | "match": "(?(?:/|\\\\|~[\\/\\\\]|\\.\\.?[\\/\\\\])?(?:[^\\/\\\\]+[\\/\\\\])*[\\w\\- ]+(?:\\.nu)?){0}^\\s*((?:export )?use)\\s+(\"\\g\"|'\\g\\'|(?![\"'])\\g)(?:\\s+([\\w\\-]+|\"[\\w\\- ]+\"|'[^']+'|\\*))?\\s*;?$",
451 | "captures": {
452 | "2": { "name": "entity.name.function.nushell" },
453 | "3": {
454 | "name": "string.bare.nushell",
455 | "patterns": [
456 | {
457 | "match": "([\\w\\- ]+)(?:\\.nu)?(?=$|\"|')",
458 | "captures": {
459 | "1": { "name": "entity.name.namespace.nushell" }
460 | }
461 | }
462 | ]
463 | },
464 | "4": { "name": "keyword.other.nushell" }
465 | }
466 | },
467 | {
468 | "begin": "(?(?:/|\\\\|~[\\/\\\\]|\\.\\.?[\\/\\\\])?(?:[^\\/\\\\]+[\\/\\\\])*[\\w\\- ]+(?:\\.nu)?){0}^\\s*((?:export )?use)\\s+(\"\\g\"|'\\g\\'|(?![\"'])\\g)\\s+\\[",
469 | "beginCaptures": {
470 | "2": { "name": "entity.name.function.nushell" },
471 | "3": {
472 | "name": "string.bare.nushell",
473 | "patterns": [
474 | {
475 | "match": "([\\w\\- ]+)(?:\\.nu)?(?=$|\"|')",
476 | "captures": {
477 | "1": { "name": "entity.name.namespace.nushell" }
478 | }
479 | }
480 | ]
481 | }
482 | },
483 | "end": "(\\])\\s*;?\\s*$",
484 | "endCaptures": {
485 | "1": { "name": "meta.brace.square.end.nushell" }
486 | },
487 | "patterns": [
488 | {
489 | "match": "([\\w\\-]+|\"[\\w\\- ]+\"|'[\\w\\- ]+'|\\*),?",
490 | "captures": {
491 | "0": { "name": "keyword.other.nushell" }
492 | }
493 | },
494 | {
495 | "include": "#comment"
496 | }
497 | ]
498 | },
499 | {
500 | "match": "^\\s*(?:export )?use\\b",
501 | "captures": {
502 | "0": { "name": "entity.name.function.nushell" }
503 | }
504 | }
505 | ]
506 | },
507 | "for-loop": {
508 | "begin": "(for)\\s+(\\$?\\w+)\\s+(in)\\s+(.+)\\s*(\\{)",
509 | "beginCaptures": {
510 | "1": { "name": "keyword.other.nushell" },
511 | "2": { "name": "variable.other.nushell" },
512 | "3": { "name": "keyword.other.nushell" },
513 | "4": { "patterns": [{ "include": "#value" }] },
514 | "5": { "name": "punctuation.section.block.begin.bracket.curly.nushell" }
515 | },
516 | "end": "\\}",
517 | "endCaptures": {
518 | "0": { "name": "punctuation.section.block.end.bracket.curly.nushell" }
519 | },
520 | "name": "meta.for-loop.nushell",
521 | "patterns": [{ "include": "source.nushell" }]
522 | },
523 | "paren-expression": {
524 | "begin": "\\(",
525 | "beginCaptures": {
526 | "0": { "name": "meta.brace.round.begin.nushell" }
527 | },
528 | "end": "\\)",
529 | "endCaptures": {
530 | "0": { "name": "meta.brace.round.end.nushell" }
531 | },
532 | "name": "meta.expression.parenthesis.nushell",
533 | "patterns": [{ "include": "#expression" }]
534 | },
535 | "braced-expression": {
536 | "begin": "\\{",
537 | "beginCaptures": {
538 | "0": { "name": "punctuation.section.block.begin.bracket.curly.nushell" }
539 | },
540 | "end": "\\}",
541 | "endCaptures": {
542 | "0": { "name": "punctuation.section.block.end.bracket.curly.nushell" }
543 | },
544 | "name": "meta.expression.braced.nushell",
545 | "patterns": [
546 | {
547 | "begin": "(?<=\\{)\\s*\\|",
548 | "end": "\\|",
549 | "name": "meta.closure.parameters.nushell",
550 | "patterns": [{ "include": "#function-parameter" }]
551 | },
552 | {
553 | "match": "(\\w+)\\s*(:)\\s*",
554 | "captures": {
555 | "1": { "name": "variable.other.nushell" },
556 | "2": { "name": "keyword.control.nushell" }
557 | }
558 | },
559 | {
560 | "match": "(\\$\"((?:[^\"\\\\]|\\\\.)*)\")\\s*(:)\\s*",
561 | "captures": {
562 | "1": { "name": "variable.other.nushell" },
563 | "2": {
564 | "name": "variable.other.nushell",
565 | "patterns": [{ "include": "#paren-expression" }]
566 | },
567 | "3": { "name": "keyword.control.nushell" }
568 | },
569 | "name": "meta.record-entry.nushell"
570 | },
571 | {
572 | "match": "(\"(?:[^\"\\\\]|\\\\.)*\")\\s*(:)\\s*",
573 | "captures": {
574 | "1": { "name": "variable.other.nushell" },
575 | "2": { "name": "keyword.control.nushell" }
576 | },
577 | "name": "meta.record-entry.nushell"
578 | },
579 | {
580 | "match": "(\\$'([^']*)')\\s*(:)\\s*",
581 | "captures": {
582 | "1": { "name": "variable.other.nushell" },
583 | "2": {
584 | "name": "variable.other.nushell",
585 | "patterns": [{ "include": "#paren-expression" }]
586 | },
587 | "3": { "name": "keyword.control.nushell" }
588 | },
589 | "name": "meta.record-entry.nushell"
590 | },
591 | {
592 | "match": "('[^']*')\\s*(:)\\s*",
593 | "captures": {
594 | "1": { "name": "variable.other.nushell" },
595 | "2": { "name": "keyword.control.nushell" }
596 | },
597 | "name": "meta.record-entry.nushell"
598 | },
599 | { "include": "#spread" },
600 | { "include": "source.nushell" }
601 | ]
602 | },
603 | "define-variable": {
604 | "match": "(let|mut|(?:export\\s+)?const)\\s+(\\w+)\\s+(=)",
605 | "captures": {
606 | "1": { "name": "keyword.other.nushell" },
607 | "2": { "name": "variable.other.nushell" },
608 | "3": {
609 | "patterns": [{ "include": "#operators" }]
610 | }
611 | }
612 | },
613 | "define-alias": {
614 | "match": "((?:export )?alias)\\s+([\\w\\-!]+)\\s*(=)",
615 | "captures": {
616 | "1": { "name": "entity.name.function.nushell" },
617 | "2": { "name": "entity.name.type.nushell" },
618 | "3": {
619 | "patterns": [{ "include": "#operators" }]
620 | }
621 | }
622 | },
623 | "pre-command": {
624 | "begin": "(\\w+)(=)",
625 | "beginCaptures": {
626 | "1": { "name": "variable.other.nushell" },
627 | "2": {
628 | "patterns": [{ "include": "#operators" }]
629 | }
630 | },
631 | "end": "(?=\\s+)",
632 | "patterns": [{ "include": "#value" }]
633 | },
634 |
635 | "command": {
636 | "begin": "(?export def --env my-function --env [] {}
2 | #^^^^^^^^^^^^^^^^ source.nushell entity.name.function.nushell
3 | # ^ source.nushell
4 | # ^^^^^^^^^^^^^^^^^^ source.nushell entity.name.type.nushell entity.name.type.nushell
5 | # ^ source.nushell meta.function.parameters.nushell meta.brace.square.begin.nushell
6 | # ^ source.nushell meta.function.parameters.nushell meta.brace.square.end.nushell
7 | # ^ source.nushell
8 | # ^ source.nushell meta.function.body.nushell punctuation.definition.function.begin.nushell
9 | # ^ source.nushell meta.function.body.nushell punctuation.definition.function.end.nushell
10 | >
11 | >export def --env "my function1" --env [] {}
12 | #^^^^^^^^^^^^^^^^ source.nushell entity.name.function.nushell
13 | # ^ source.nushell
14 | # ^ source.nushell entity.name.type.nushell
15 | # ^^^^^^^^^^^^ source.nushell entity.name.type.nushell entity.name.type.nushell
16 | # ^ source.nushell entity.name.type.nushell
17 | # ^^^^^^ source.nushell entity.name.type.nushell
18 | # ^ source.nushell
19 | # ^ source.nushell meta.function.parameters.nushell meta.brace.square.begin.nushell
20 | # ^ source.nushell meta.function.parameters.nushell meta.brace.square.end.nushell
21 | # ^ source.nushell
22 | # ^ source.nushell meta.function.body.nushell punctuation.definition.function.begin.nushell
23 | # ^ source.nushell meta.function.body.nushell punctuation.definition.function.end.nushell
24 | >
25 | >export def --env 'my function2' --env [] {}
26 | #^^^^^^^^^^^^^^^^ source.nushell entity.name.function.nushell
27 | # ^ source.nushell
28 | # ^ source.nushell entity.name.type.nushell
29 | # ^^^^^^^^^^^^ source.nushell entity.name.type.nushell entity.name.type.nushell
30 | # ^ source.nushell entity.name.type.nushell
31 | # ^^^^^^ source.nushell entity.name.type.nushell
32 | # ^ source.nushell
33 | # ^ source.nushell meta.function.parameters.nushell meta.brace.square.begin.nushell
34 | # ^ source.nushell meta.function.parameters.nushell meta.brace.square.end.nushell
35 | # ^ source.nushell
36 | # ^ source.nushell meta.function.body.nushell punctuation.definition.function.begin.nushell
37 | # ^ source.nushell meta.function.body.nushell punctuation.definition.function.end.nushell
38 | >
39 | >export def --env my_function --env [] {}
40 | #^^^^^^^^^^^^^^^^ source.nushell entity.name.function.nushell
41 | # ^^ source.nushell
42 | # ^^^^^^^^^^^^^^^^^^ source.nushell entity.name.type.nushell entity.name.type.nushell
43 | # ^ source.nushell meta.function.parameters.nushell meta.brace.square.begin.nushell
44 | # ^ source.nushell meta.function.parameters.nushell meta.brace.square.end.nushell
45 | # ^ source.nushell
46 | # ^ source.nushell meta.function.body.nushell punctuation.definition.function.begin.nushell
47 | # ^ source.nushell meta.function.body.nushell punctuation.definition.function.end.nushell
48 | >
49 | >export def --env "my_function1" --env [] {}
50 | #^^^^^^^^^^^^^^^^^ source.nushell entity.name.function.nushell
51 | # ^ source.nushell
52 | # ^ source.nushell entity.name.type.nushell
53 | # ^^^^^^^^^^^^ source.nushell entity.name.type.nushell entity.name.type.nushell
54 | # ^ source.nushell entity.name.type.nushell
55 | # ^^^^^^ source.nushell entity.name.type.nushell
56 | # ^ source.nushell
57 | # ^ source.nushell meta.function.parameters.nushell meta.brace.square.begin.nushell
58 | # ^ source.nushell meta.function.parameters.nushell meta.brace.square.end.nushell
59 | # ^ source.nushell
60 | # ^ source.nushell meta.function.body.nushell punctuation.definition.function.begin.nushell
61 | # ^ source.nushell meta.function.body.nushell punctuation.definition.function.end.nushell
62 | >
63 | >export def --env 'my_function2' --env [] {}
64 | #^^^^^^^^^^^^^^^^ source.nushell entity.name.function.nushell
65 | # ^ source.nushell
66 | # ^ source.nushell entity.name.type.nushell
67 | # ^^^^^^^^^^^^ source.nushell entity.name.type.nushell entity.name.type.nushell
68 | # ^ source.nushell entity.name.type.nushell
69 | # ^^^^^^ source.nushell entity.name.type.nushell
70 | # ^ source.nushell
71 | # ^ source.nushell meta.function.parameters.nushell meta.brace.square.begin.nushell
72 | # ^ source.nushell meta.function.parameters.nushell meta.brace.square.end.nushell
73 | # ^ source.nushell
74 | # ^ source.nushell meta.function.body.nushell punctuation.definition.function.begin.nushell
75 | # ^ source.nushell meta.function.body.nushell punctuation.definition.function.end.nushell
76 | >
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "target": "es2020",
5 | "lib": ["es2020"],
6 | "outDir": "out",
7 | "rootDir": "src",
8 | "sourceMap": true,
9 | "strict": true,
10 | "composite": true
11 | },
12 | "include": ["src"],
13 | "exclude": ["node_modules", ".vscode-test"],
14 | "references": [{ "path": "./client" }, { "path": "./server" }]
15 | }
16 |
--------------------------------------------------------------------------------
/used_keywords.jsonc:
--------------------------------------------------------------------------------
1 | // This serves no purpose other than to let one
2 | // know which scopes are used so far in specific
3 | // nushell coloring
4 |
5 | "FlatShape__InternalCommand": "#55FFFF", //"Cyan.bold"
6 | {
7 | "scope": [
8 | "keyword.control",
9 | "source.cpp keyword.operator.new",
10 | "keyword.operator.delete",
11 | "keyword.other.using",
12 | "keyword.other.operator",
13 | "entity.name.operator"
14 | ],
15 | "settings": {
16 | "foreground": "#55FFFF"
17 | }
18 | },
19 |
20 | "FlatShape__String": "#00AA00", //"Green"
21 | {
22 | "scope": [
23 | "string",
24 | "meta.embedded.assembly"
25 | ],
26 | "settings": {
27 | "foreground": "#00AA00"
28 | }
29 | },
30 |
31 | "FlatShape__Variable_or_FlatShape__Identifier": "#AA00AA", //"Purple"
32 | {
33 | "scope": [
34 | "variable",
35 | "meta.definition.variable.name",
36 | "support.variable",
37 | "entity.name.variable"
38 | ],
39 | "settings": {
40 | "foreground": "#03af03"
41 | }
42 | },
43 |
44 | "FlatShape__Flag": "#5555FF", //"Blue.bold"
45 | "FlatShape__ShorthandFlag": "#5555FF", //"Blue.bold"
46 | {
47 | "scope": [
48 | "variable.parameter.function.nushell"
49 | ],
50 | "settings": {
51 | "foreground": "#5555FF",
52 | // "fontStyle": "bold"
53 | }
54 | },
55 |
56 | "FlatShape__Int": "#FF55FF", //"Purple.bold"
57 | "FlatShape__Decimal": "#FF55FF", //"Purple.bold"
58 | {
59 | "scope": [
60 | "constant.numeric",
61 | "variable.other.enummember",
62 | "keyword.operator.plus.exponent",
63 | "keyword.operator.minus.exponent"
64 | ],
65 | "settings": {
66 | "foreground": "#FF55FF"
67 | }
68 | },
69 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable @typescript-eslint/no-var-requires */
2 | //@ts-check
3 |
4 | 'use strict';
5 |
6 | // eslint-disable-next-line no-undef
7 | const path = require('path');
8 |
9 | /**@type {import('webpack').Configuration}*/
10 | const config = {
11 | target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
12 |
13 | entry: './client/src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
14 | output: {
15 | // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
16 | // eslint-disable-next-line no-undef
17 | path: path.resolve(__dirname, 'out'),
18 | filename: 'extension.js',
19 | libraryTarget: 'commonjs2',
20 | devtoolModuleFilenameTemplate: '../[resource-path]',
21 | },
22 | devtool: 'source-map',
23 | externals: {
24 | vscode: 'commonjs vscode', // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
25 | },
26 | resolve: {
27 | // support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
28 | extensions: ['.ts', '.js'],
29 | },
30 | module: {
31 | rules: [
32 | {
33 | test: /\.ts$/,
34 | exclude: /node_modules/,
35 | use: [
36 | {
37 | loader: 'ts-loader',
38 | },
39 | ],
40 | },
41 | ],
42 | },
43 | };
44 | // eslint-disable-next-line no-undef
45 | module.exports = config;
46 |
--------------------------------------------------------------------------------