Closes #48537 **Explanation:** The Deno test task example wasn't appearing because the undefined ZED_CUSTOM_DENO_TEST_NAME variable made the filter invalid. Instead of adding a default value, simplify the example to run all tests in the file, which is the most common use case and works out of the box. Before you mark this PR as ready for review, make sure that you have: Screenshots: Before: <img width="3434" height="1349" alt="image" src="https://github.com/user-attachments/assets/bc514103-9b33-489f-a69e-84257ea82acf" /> After: <img width="3438" height="1376" alt="image" src="https://github.com/user-attachments/assets/47674dde-ede8-4a9d-b365-d2df8e128e18" /> Release Notes: - N/A
2.8 KiB
2.8 KiB
Deno
Deno support is available through the Deno extension.
- Language server: Deno Language Server
Deno Configuration
To use the Deno Language Server with TypeScript and TSX files, you will likely wish to disable the default language servers and enable deno by adding the following to your settings.json:
{
"lsp": {
"deno": {
"settings": {
"deno": {
"enable": true
}
}
}
},
"languages": {
"JavaScript": {
"language_servers": [
"deno",
"!typescript-language-server",
"!vtsls",
"!eslint"
],
"formatter": "language_server"
},
"TypeScript": {
"language_servers": [
"deno",
"!typescript-language-server",
"!vtsls",
"!eslint"
],
"formatter": "language_server"
},
"TSX": {
"language_servers": [
"deno",
"!typescript-language-server",
"!vtsls",
"!eslint"
],
"formatter": "language_server"
}
}
}
See Configuring supported languages in the Zed documentation for more information.
Configuration completion
To get completions for deno.json or package.json you can add the following to your settings.json: (More info here https://zed.dev/docs/languages/json)
"lsp": {
"json-language-server": {
"settings": {
"json": {
"schemas": [
{
"fileMatch": [
"deno.json",
"deno.jsonc"
],
"url": "https://raw.githubusercontent.com/denoland/deno/refs/heads/main/cli/schemas/config-file.v1.json"
},
{
"fileMatch": [
"package.json"
],
"url": "https://www.schemastore.org/package"
}
]
}
}
}
}
DAP support
To debug deno programs, add this to .zed/debug.json
[
{
"adapter": "JavaScript",
"label": "Deno",
"request": "launch",
"type": "pwa-node",
"cwd": "$ZED_WORKTREE_ROOT",
"program": "$ZED_FILE",
"runtimeExecutable": "deno",
"runtimeArgs": ["run", "--allow-all", "--inspect-wait"],
"attachSimplePort": 9229
}
]
Runnable support
To run deno tasks like tests from the ui, add this to .zed/tasks.json
[
{
"label": "deno test",
"command": "deno test -A '$ZED_FILE'",
"tags": ["js-test"]
}
]