Skip to content

Commit cc18218

Browse files
committed
update zed config & docs to use the project version of basedpyright again. i incorrectly assumed this was no longer necessary
1 parent dc463b5 commit cc18218

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

.zed/settings.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,22 @@
77
],
88
"format_on_save": "on",
99
"formatter": [
10-
{
11-
"code_actions": {
12-
"source.organizeImports.ruff": true,
13-
"source.fixAll.ruff": true
14-
}
15-
},
1610
{
1711
"language_server": {
1812
"name": "ruff"
1913
}
2014
}
21-
]
15+
]
16+
}
17+
},
18+
"lsp": {
19+
"basedpyright": {
20+
"binary": {
21+
"path": ".venv/bin/basedpyright-langserver",
22+
"arguments": ["--stdio"]
23+
}
2224
}
23-
},
25+
},
2426
"auto_install_extensions": {
2527
"ruff": true
2628
}

docs/installation/ides.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,22 @@ You can verify the active configuration by running `hx --health python`
183183
## Zed
184184

185185
basedpyright is the default language server for python in zed. [see the docs](https://zed.dev/docs/languages/python#basedpyright) for more information.
186+
187+
??? tip "adding basedpyright as a development dependency to your project"
188+
189+
we highly recommend installing and pinning basedpyright as a dev dependency for your project and using project settings (`.zed/settings.json`) to confiigure zed to use the that version instead of a globally installed version. this enaures that zed doesn't automatically update basedpyright unexpectedly, which can result in different errors being reported in your IDE than your CI.
190+
191+
```json title=".zed/settings.json"
192+
{
193+
"lsp": {
194+
"basedpyright": {
195+
"binary": {
196+
"path": ".venv/bin/basedpyright-langserver",
197+
"arguments": ["--stdio"]
198+
}
199+
}
200+
}
201+
}
202+
```
203+
204+
you should commit this file so that these settings are automatically applied for other developers working on your project.

0 commit comments

Comments
 (0)