astral-sh / ruff-vscode

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

Unable to find the ruff setting file when starting the server. #475

Closed ArcticOc closed 1 month ago

ArcticOc commented 1 month ago

Hi,

After I enabled rust-based ruff server, it seemed unable to find the setting file pyproject.toml.

Cheers

Ver

Ruff: 0.4.5 VS Code: 1.89.1

Settings

    "ruff.nativeServer": true,
    "ruff.configuration": "$HOME/.config/pyproject.toml",
    "[python]": {
        "editor.defaultFormatter": "charliermarsh.ruff",
        "editor.codeActionsOnSave": {
          "source.fixAll": "explicit",
          "source.organizeImports": "explicit",
        },
        "editor.formatOnSave": true
    },

Output

2024-05-23 16:26:55.745 [info] Name: Ruff
2024-05-23 16:26:55.745 [info] Module: ruff
2024-05-23 16:26:55.745 [info] Python extension loading
2024-05-23 16:26:55.745 [info] Waiting for interpreter from python extension.
2024-05-23 16:26:55.745 [info] Python extension loaded
2024-05-23 16:26:55.745 [info] Server run command: /Users/koko/micromamba/envs/Research/bin/python /Users/koko/.vscode/extensions/charliermarsh.ruff-2024.22.0-darwin-arm64/bundled/tool/ruff_server.py server --preview
2024-05-23 16:26:55.745 [info] Server: Start requested.
2024-05-23 16:26:55.778 [info] [Trace - 4:26:55 PM] Sending request 'textDocument/codeAction - (2)'.
2024-05-23 16:26:55.778 [info] ┐ruff_server::server::api::notifications::did_open::run{file=file:///Volumes/Repo/Novel/split.py}
┘
   0.005204s INFO ruff_server::session::workspace::ruff_settings No Ruff settings file found for /Volumes/Repo/Novel/split.py; falling back to default configuration

2024-05-23 16:26:55.780 [info]    0.011362s INFO ruff_server::session::workspace::ruff_settings No Ruff settings file found for /Volumes/Repo/Novel/split.py; falling back to default configuration

2024-05-23 16:26:55.780 [info] [Trace - 4:26:55 PM] Received request 'client/registerCapability - (1)'.
2024-05-23 16:26:55.780 [info] [Trace - 4:26:55 PM] Sending response 'client/registerCapability - (1)'. Processing request took 0ms
2024-05-23 16:26:55.780 [info] [Trace - 4:26:55 PM] Received response 'textDocument/diagnostic - (1)' in 10ms.
2024-05-23 16:26:55.781 [info]    0.012561s INFO ruff_server::server Configuration file watcher successfully registered

2024-05-23 16:26:55.781 [info] [Trace - 4:26:55 PM] Received response 'textDocument/codeAction - (2)' in 3ms.
2024-05-23 16:26:56.033 [info] [Trace - 4:26:56 PM] Sending request 'textDocument/codeAction - (3)'.
2024-05-23 16:26:56.034 [info]    0.265609s INFO ruff_server::session::workspace::ruff_settings No Ruff settings file found for /Volumes/Repo/Novel/split.py; falling back to default configuration
ArcticOc commented 1 month ago

It works fine now after I upgraded ruff to the latest version using brew.