-
Notifications
You must be signed in to change notification settings - Fork 1.6k
docs: revise Ruff setup instructions for Zed editor #20935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: revise Ruff setup instructions for Zed editor #20935
Conversation
Updated Ruff installation instructions for Zed editor. Ruff support is now built in and does not require installing an extension anymore. zed-industries/zed#37804 Also FWI this open issue is related: zed-industries/zed#40266. But I've just tried the last code snippet from the docs on a fresh Zed install on Windows and it worked well without installing any extension.
|
Thank you. There's probably more that we can remove, now that ruff is used as the default formatter and linter (it's enabled by default) as mentioned here https://zed.dev/docs/languages/python#code-formatting--linting |
|
I can have a look |
|
Zed comes with formatting and linting out-of-the-box now. If you want Ruff to organize imports: {
"languages": {
"Python": {
"code_actions_on_format": { "source.organizeImports.ruff": true }
}
}
}If you want Ruff to apply fixes (which includes organizing imports): {
"languages": {
"Python": {
"code_actions_on_format": { "source.fixAll.ruff": true }
}
}
} |
|
I'll do a commit tonight. Strange that Zed's documentation does not mention the BTW do we want do add this in ty's documentation, or is this section https://docs.astral.sh/ty/editors/#other-editors enough?: {
"languages": {
"Python": {
"language_servers": [
// Disable basedpyright and enable Ty, and otherwise
// use the default configuration.
"ty",
"!basedpyright",
"..."
]
}
}
} |
|
Adding Zed to other editors makes sense to me, considering that we have a dedicated tab for Zed on the editor settings page.
Thank you! |
|
Okay tell me what you think. I put back "code_actions_on_format" since this is what has to be used at the moment apparently |
|
Sorry for the late review
Do you have a reference for this. Our recommendation is to run code actions (fixes and organize imports) before format but That's why I'd prefer to keep our existing recommended configuration, unless there are issues with it that we aren't aware of. |
See zed-industries/zed#40409. Zed removed {
"languages": {
"Python": {
"formatter": [{ "code_action": "source.fixAll.ruff" }]
}
}
}to this: {
"languages": {
"Python": {
"code_actions_on_format": { "source.fixAll.ruff": true }
}
}
} |
|
cc @probably-neb if you have more insight on the |
|
Thanks for the ping @injust
Where are you seeing this documentation @MichaReiser? I'd love to fix it. I wrote the code that runs |
Oh great! That's exactly what we need. The description is from Zed's on hover tooltip
|
MichaReiser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
* main: (188 commits) [ty] Discover site-packages from the environment that ty is installed in (astral-sh#21286) [ty] Make special cases for `UnionType` slightly narrower (astral-sh#21276) Require ignore 0.4.24 in `Cargo.toml` (astral-sh#21292) [ty] Favour imported symbols over builtin symbols (astral-sh#21285) docs: revise Ruff setup instructions for Zed editor (astral-sh#20935) [ty] Update salsa (astral-sh#21281) [syntax-error]: no binding for nonlocal PLE0117 as a semantic syntax error (astral-sh#21032) [ty] Constraining a typevar with itself (possibly via union or intersection) (astral-sh#21273) [`ruff`] Fix false positives on starred arguments (`RUF057`) (astral-sh#21256) [ty] Simplify unions containing multiple type variables during inference (astral-sh#21275) [ty] Add `ty_server::Db` trait (astral-sh#21241) [ty] Refactor `Range` to/from `TextRange` conversion as prep for notebook support (astral-sh#21230) [ty] Fix playground crash when file name includes path separator (astral-sh#21151) [`refurb`] Fix false negative for underscores before sign in `Decimal` constructor (`FURB157`) (astral-sh#21190) [ty] Allow values of type `None` in type expressions (astral-sh#21263) Run codspeed benchmarks with `profiling` profile (astral-sh#21261) [ty] Update expected diagnostic count in benchmarks (astral-sh#21269) Avoid extra parentheses for long `match` patterns with `as` captures (astral-sh#21176) [ty] Update salsa (astral-sh#21265) [ty] `dict` is not assignable to `TypedDict` (astral-sh#21238) ...
|
Docs are fixed in zed-industries/zed#42128. Thanks all! |
* origin/main: Remove duplicate preview tests for `FURB101` and `FURB103` (#21303) [ty] Add support for `Literal`s in implicit type aliases (#21296) [ty] Add missing `heap_size` to `variance_of` queries (#21318) [`pyupgrade`] Fix false positive on relative imports from local `.builtins` module (`UP029`) (#21309) [ty] Make range/position conversions fallible (#21297) Bump 0.14.4 (#21306) Fix main by using `infer_expression` (#21299) [ty] Understand legacy and PEP 695 `ParamSpec` (#21139) [ty] Discover site-packages from the environment that ty is installed in (#21286) [ty] Make special cases for `UnionType` slightly narrower (#21276) Require ignore 0.4.24 in `Cargo.toml` (#21292) [ty] Favour imported symbols over builtin symbols (#21285) docs: revise Ruff setup instructions for Zed editor (#20935) [ty] Update salsa (#21281) [syntax-error]: no binding for nonlocal PLE0117 as a semantic syntax error (#21032)

Summary
Updated Ruff installation instructions for Zed editor.
Details
Ruff support is now built in and does not require installing an extension anymore. zed-industries/zed#37804
Also FYI this open issue is related: zed-industries/zed#40266.
But I've just tried the last code snippet from the docs on a fresh Zed install on Windows and it worked well without installing any extension.