astral-sh / ruff-vscode

A Visual Studio Code extension with support for the Ruff linter.
Other
946 stars 45 forks source link

Better documentation (import sorting) #449

Open danielniccoli opened 2 months ago

danielniccoli commented 2 months ago

I've been trying to get import sorting working.

There is one settings-sample that shows this:

grafik

Looking into the default settings, I found this

grafik

The way I first understood it was, that the setting from the first screenshot is already set by default. It took me some research to understand that the first setting by default only allows the setting from the second screenshot to be enabled in the first place. And I still had to explicitly set "source.organizeImports": "explicit".

I find this confusing, because I expected the first table to be a comprehensive list of possible settings. But the table shows only half of what's possible and the samples add the rest. That settings for different stuff have the same name's adds to the confusion. I also found the samples a bit confusing, because it doesn't really explain why a certain configuration is achieved with a certain set of settings.

What I think would improve this, is a comprehensive list of all settings and what they do.

dhruvmanila commented 2 months ago

I've been trying to get import sorting working.

Can you expand on what you're trying to achieve?

I find this confusing, because I expected the first table to be a comprehensive list of possible settings. But the table shows only half of what's possible and the samples add the rest. That settings for different stuff have the same name's adds to the confusion. I also found the samples a bit confusing, because it doesn't really explain why a certain configuration is achieved with a certain set of settings.

Correct me if I'm wrong but I think there's some confusion here. Assuming that the table you're mentioning is this, the table only lists the VS Code settings that the extension provides while the sample shows how you can configure the VS Code editor for common scenarios. This means that the settings shown in the samples are all part of the editor and not the extension. For a comprehensive list of settings that the editor provides, you might want to refer to their documentation.

I guess the confusion is coming from the fact that both the extension and the editor provides a setting where "organizeImports" is being used while both have a different meaning.