Skip to content
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

Add setup docs for Zed editor #12501

Merged
merged 1 commit into from
Jul 25, 2024
Merged

Add setup docs for Zed editor #12501

merged 1 commit into from
Jul 25, 2024

Conversation

dhruvmanila
Copy link
Member

@dhruvmanila dhruvmanila commented Jul 25, 2024

Summary

This PR adds the setup documentation for using Ruff with the Zed editor.

Closes: #12388

@dhruvmanila dhruvmanila added the documentation Improvements or additions to documentation label Jul 25, 2024
docs/editors/setup.md Outdated Show resolved Hide resolved
docs/editors/setup.md Outdated Show resolved Hide resolved
@dhruvmanila dhruvmanila enabled auto-merge (squash) July 25, 2024 13:06
@dhruvmanila dhruvmanila merged commit 6bbb4a2 into main Jul 25, 2024
19 checks passed
@dhruvmanila dhruvmanila deleted the dhruv/zed-setup branch July 25, 2024 13:09
@samueller
Copy link

I've read the setup docs, but still can't figure out how to add linting options. For example, where in Zed's settings.json do I add the option for quote-style? The docs give examples for pyproject.toml and ruff.toml and I've tried many possible places in settings.json, but can't figure it out.

@MichaReiser
Copy link
Member

@samueller sorry that you're struggling with this.

The editor doesn't support all ruff settings. It only supports a subset and quote-style isn't part of that subset. To configure the quote-style, you have to create a pyproject.toml or ruff.toml and set the quote style in there.

@samueller
Copy link

It only supports a subset and quote-style isn't part of that subset.

I understand, thank you for letting me know

@dhruvmanila
Copy link
Member Author

@samueller Sorry that you struggled with this. Do you have any recommendation on how can we improve this in the documentation to make it clearer?

@samueller
Copy link

@samueller Do you have any recommendation on how can we improve this in the documentation to make it clearer?

Would have been great to have read which subset of features work in Zed's settings.json and which don't in the Zed configuration section.

@dhruvmanila
Copy link
Member Author

dhruvmanila commented Aug 23, 2024

Would have been great to have read which subset of features work in Zed's settings.json and which don't in the Zed configuration section.

I'm curious to know whether the following section in https://docs.astral.sh/ruff/editors/setup/#zed conveys this:

To configure the language server, you can provide the server settings under the lsp.ruff.initialization_options.settings key:

{
  "lsp": {
    "ruff": {
      "initialization_options": {
        "settings": {
          // Ruff server settings goes here
          "lineLength": 80,
          "lint": {
            "extendSelect": ["I"],
          }
        }
      }
    }
  }
}

@samueller
Copy link

I'm curious to know whether the following section in https://docs.astral.sh/ruff/editors/setup/#zed conveys this:

I had seen that, but it didn't tell me the settings that won't work, such as quote-reply. I had assumed all settings would work, I just needed to figure out how to specify them in settings.json.

@dhruvmanila
Copy link
Member Author

I see, thanks for the insight. I think it makes sense to explicitly clarify this point in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ruff LSP Setup Guide for Zed
4 participants