astral-sh / ruff-vscode

A Visual Studio Code extension with support for the Ruff linter.
Other
1.04k stars 52 forks source link

How to find out what config file ruff discovered? #534

Open parthmishra opened 1 month ago

parthmishra commented 1 month ago

Is there a way to see what configuration file the Ruff extension is using in the project? When using the cli, I can see this with --verbose but that's not supported in the extension.

My current issue is that I don't why the CLI can pick up the correct pyproject.toml in the root of the repo but the extension can't, but in general I'd like to know how I can debug these issues myself.

Current workspace settings:

{
    "[python]": {
        "editor.formatOnSave": true,
        "editor.defaultFormatter": "charliermarsh.ruff",
        "editor.codeActionsOnSave": {
            "source.fixAll.ruff": "explicit",
            "source.organizeImports.ruff": "explicit"
        }    
    },
}

All user settings are default.

dhruvmanila commented 1 month ago

It depends on which backend server are you using? Is it ruff-lsp or the native server? Do you have the ruff.nativeServer setting set in VS Code?

parthmishra commented 1 month ago

It depends on which backend server are you using? Is it ruff-lsp or the native server? Do you have the ruff.nativeServer setting set in VS Code?

Using the normal LSP (whichever is default), although I'd like to understand how to find out in both scenarios as I'll probably switch us over to the native server at some point.

dhruvmanila commented 1 month ago

Can you checkout the Troubleshooting guide and see if that helps?