1# Deno
2
3Deno support is available through the [Deno extension](https://github.com/zed-extensions/deno).
4
5- Language server: [Deno Language Server](https://docs.deno.com/runtime/manual/advanced/language_server/overview/)
6
7## Deno Configuration
8
9To 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`:
10
11```json [settings]
12{
13 "lsp": {
14 "deno": {
15 "settings": {
16 "deno": {
17 "enable": true
18 }
19 }
20 }
21 },
22 "languages": {
23 "JavaScript": {
24 "language_servers": [
25 "deno",
26 "!typescript-language-server",
27 "!vtsls",
28 "!eslint"
29 ],
30 "formatter": "language_server"
31 },
32 "TypeScript": {
33 "language_servers": [
34 "deno",
35 "!typescript-language-server",
36 "!vtsls",
37 "!eslint"
38 ],
39 "formatter": "language_server"
40 },
41 "TSX": {
42 "language_servers": [
43 "deno",
44 "!typescript-language-server",
45 "!vtsls",
46 "!eslint"
47 ],
48 "formatter": "language_server"
49 }
50 }
51}
52```
53
54See [Configuring supported languages](../configuring-languages.md) in the Zed documentation for more information.
55
56<!--
57TBD: Deno TypeScript REPL instructions [docs/repl#typescript-deno](../repl.md#typescript-deno)
58-->
59
60## Configuration completion
61
62To 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)
63
64```json [settings]
65"lsp": {
66 "json-language-server": {
67 "settings": {
68 "json": {
69 "schemas": [
70 {
71 "fileMatch": [
72 "deno.json",
73 "deno.jsonc"
74 ],
75 "url": "https://raw.githubusercontent.com/denoland/deno/refs/heads/main/cli/schemas/config-file.v1.json"
76 },
77 {
78 "fileMatch": [
79 "package.json"
80 ],
81 "url": "http://json.schemastore.org/package"
82 }
83 ]
84 }
85 }
86 }
87 }
88```
89
90## DAP support
91
92To debug deno programs, add this to `.zed/debug.json`
93
94```json [debug]
95[
96 {
97 "adapter": "JavaScript",
98 "label": "Deno",
99 "request": "launch",
100 "type": "pwa-node",
101 "cwd": "$ZED_WORKTREE_ROOT",
102 "program": "$ZED_FILE",
103 "runtimeExecutable": "deno",
104 "runtimeArgs": ["run", "--allow-all", "--inspect-wait"],
105 "attachSimplePort": 9229
106 }
107]
108```
109
110## Runnable support
111
112To run deno tasks like tests from the ui, add this to `.zed/tasks.json`
113
114```json [tasks]
115[
116 {
117 "label": "deno test",
118 "command": "deno test -A --filter '/^$ZED_CUSTOM_DENO_TEST_NAME$/' '$ZED_FILE'",
119 "tags": ["js-test"]
120 }
121]
122```
123
124## See also:
125
126- [TypeScript](./typescript.md)
127- [JavaScript](./javascript.md)