astral-sh / ruff-vscode

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

Cannot resolve the configuration path in settings.json #627

Open ArcticOc opened 1 day ago

ArcticOc commented 1 day ago

Hi,

The ruff extension could not resolve the configuration path set in the settings.json suddenly.

"ruff.nativeServer": "on",
"ruff.configuration": "$HOME/.config/pyproject.toml",

During the initialization of ruff, the following error appeared: Error while resolving settings from workspace /. Please refer to the logs for more details.

Here is the log.

2024-10-07 15:47:39.080 [info] Name: Ruff
2024-10-07 15:47:39.080 [info] Module: ruff
2024-10-07 15:47:39.080 [info] Python extension loading
2024-10-07 15:47:39.080 [info] Waiting for interpreter from python extension.
2024-10-07 15:47:39.080 [info] Python extension loaded
2024-10-07 15:47:39.080 [info] Using interpreter: /Users/craig/micromamba/envs/Research/bin/python
2024-10-07 15:47:39.150 [info] Using environment executable: /opt/homebrew/bin/ruff
2024-10-07 15:47:39.158 [info] Found Ruff 0.6.9 at /opt/homebrew/bin/ruff
2024-10-07 15:47:39.158 [info] Server run command: /opt/homebrew/bin/ruff server
2024-10-07 15:47:39.158 [info] Server: Start requested.
2024-10-07 15:47:40.447 [info] warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `System/Volumes/Data/Users/craig/micromamba/envs/Research/lib/python3.12/site-packages/pandas/pyproject.toml`:
  - 'ignore' -> 'lint.ignore'
  - 'select' -> 'lint.select'
  - 'typing-modules' -> 'lint.typing-modules'
  - 'unfixable' -> 'lint.unfixable'
  - 'per-file-ignores' -> 'lint.per-file-ignores'
warning: `PGH001` has been remapped to `S307`.

2024-10-07 15:47:40.512 [info] warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `Users/craig/micromamba/envs/Research/lib/python3.12/site-packages/pandas/pyproject.toml`:
  - 'ignore' -> 'lint.ignore'
  - 'select' -> 'lint.select'
  - 'typing-modules' -> 'lint.typing-modules'
  - 'unfixable' -> 'lint.unfixable'
  - 'per-file-ignores' -> 'lint.per-file-ignores'

Version

Ruff: 0.6.6 (v2024.50.0) VSCode: 1.94

dhruvmanila commented 1 day ago

Can you provide the logs using the following VS Code settings?

{
    "ruff.trace.server": "messages",
    "ruff.logLevel": "debug"
}
dhruvmanila commented 1 day ago

During the initialization of ruff, the following error appeared: Error while resolving settings from workspace /. Please refer to the logs for more details.

Have you opened the editor in the system root directory? If so, then the extension would traverse the entire system to collect all the configuration that are present in the nested directories and it could happen that one or the other configuration file is invalid.

ArcticOc commented 1 day ago

Can you provide the logs using the following VS Code settings?

{
  "ruff.trace.server": "messages",
  "ruff.logLevel": "debug"
}

I think I get it. When opening a single file instead of a folder, Ruff cannot find the workspace and can only use workspace /, which causes an error. But when opening a folder, there is no problem.

2024-10-08 17:19:07.605 [info] [Trace - 5:19:07 PM]    0.000051083s  WARN main ruff_server::server: No workspace(s) were provided during initialization. Using the current working directory as a default workspace...

2024-10-08 17:19:07.605 [info] [Trace - 5:19:07 PM]    0.000541417s  WARN main ruff_server::server: No workspace settings found for file:///
ffisc commented 1 day ago

Same issue here. Interestingly, I tried reverting to previous versions of the extension but the problem is also there.

dhruvmanila commented 1 day ago

When opening a single file instead of a folder, Ruff cannot find the workspace and can only use workspace /, which causes an error. But when opening a folder, there is no problem.

This is not exactly true. The client is responsible for providing the workspace, so in your case, the client wasn't able to find any workspace. This leads to Ruff using the current working directory as the default workspace which in your case seems to be the system root directory (/).

Can you provide the log messages after turning them on to diagnose the error notification that you received?

Same issue here. Interestingly, I tried reverting to previous versions of the extension but the problem is also there.

@ffisc Please provide any log messages if possible to help diagnose the issue.

ArcticOc commented 23 hours ago

This is not exactly true. The client is responsible for providing the workspace, so in your case, the client wasn't able to find any workspace. This leads to Ruff using the current working directory as the default workspace which in your case seems to be the system root directory (/).

However, when I open the folder containing the file, it finds the correct workspace and works fine.

Here is the entire log.

log ``` 2024-10-08 17:19:07.404 [info] Name: Ruff 2024-10-08 17:19:07.404 [info] Module: ruff 2024-10-08 17:19:07.404 [info] Python extension loading 2024-10-08 17:19:07.404 [info] Waiting for interpreter from python extension. 2024-10-08 17:19:07.437 [info] Python extension loaded 2024-10-08 17:19:07.440 [info] Using interpreter: /Users/craig/micromamba/envs/Research/bin/python 2024-10-08 17:19:07.578 [info] Using environment executable: /opt/homebrew/bin/ruff 2024-10-08 17:19:07.589 [info] Found Ruff 0.6.9 at /opt/homebrew/bin/ruff 2024-10-08 17:19:07.589 [info] Server run command: /opt/homebrew/bin/ruff server 2024-10-08 17:19:07.589 [info] Server: Start requested. 2024-10-08 17:19:07.601 [info] [Trace - 5:19:07 PM] Sending request 'initialize - (0)'. 2024-10-08 17:19:07.602 [info] [Trace - 5:19:07 PM] Received response 'initialize - (0)' in 2ms. 2024-10-08 17:19:07.602 [info] [Trace - 5:19:07 PM] Sending notification 'initialized'. 2024-10-08 17:19:07.605 [info] [Trace - 5:19:07 PM] Sending notification 'textDocument/didOpen'. 2024-10-08 17:19:07.605 [info] [Trace - 5:19:07 PM] Sending request 'textDocument/diagnostic - (1)'. 2024-10-08 17:19:07.605 [info] [Trace - 5:19:07 PM] 0.000051083s WARN main ruff_server::server: No workspace(s) were provided during initialization. Using the current working directory as a default workspace... 2024-10-08 17:19:07.605 [info] [Trace - 5:19:07 PM] 0.000541417s WARN main ruff_server::server: No workspace settings found for file:/// 2024-10-08 17:19:07.658 [info] [Trace - 5:19:07 PM] 0.055370083s DEBUG ThreadId(13) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /Volumes/Repo/Novel Utilities/.git 2024-10-08 17:19:07.663 [info] [Trace - 5:19:07 PM] 0.060454000s DEBUG ThreadId(13) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /Volumes/Repo/CV/.git 2024-10-08 17:19:07.680 [info] [Trace - 5:19:07 PM] 0.061193667s DEBUG ThreadId(09) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Volumes/Repo/Novel Utilities/.git 2024-10-08 17:19:07.680 [info] [Trace - 5:19:07 PM] 0.061716083s DEBUG ThreadId(09) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Volumes/Repo/CV/.git 2024-10-08 17:19:07.680 [info] [Trace - 5:19:07 PM] 0.064608292s DEBUG ThreadId(12) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /usr/share/httpd/build 2024-10-08 17:19:07.750 [info] [Trace - 5:19:07 PM] 0.146139625s DEBUG ThreadId(10) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /Applications/Slack.app/Contents/Resources/app.asar.unpacked/node_modules 2024-10-08 17:19:07.789 [info] [Trace - 5:19:07 PM] 0.146288667s DEBUG ThreadId(10) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /Applications/Slack.app/Contents/Resources/app.asar.unpacked/dist 2024-10-08 17:19:07.890 [info] [Trace - 5:19:07 PM] 0.212185625s DEBUG ThreadId(12) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /usr/share/vim/vim90/import/dist 2024-10-08 17:19:07.905 [info] [Trace - 5:19:07 PM] 0.213851708s DEBUG ThreadId(12) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /usr/share/vim/vim90/autoload/dist 2024-10-08 17:19:07.906 [info] [Trace - 5:19:07 PM] 0.215170583s DEBUG ThreadId(12) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /usr/share/vim/vim90/pack/dist 2024-10-08 17:19:07.908 [info] [Trace - 5:19:07 PM] 0.243216375s DEBUG ThreadId(07) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Applications/Slack.app/Contents/Resources/app.asar.unpacked/node_modules 2024-10-08 17:19:07.908 [info] [Trace - 5:19:07 PM] 0.243259083s DEBUG ThreadId(07) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Applications/Slack.app/Contents/Resources/app.asar.unpacked/dist 2024-10-08 17:19:07.908 [info] [Trace - 5:19:07 PM] 0.246850625s DEBUG ThreadId(13) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/venv 2024-10-08 17:19:07.910 [info] [Trace - 5:19:07 PM] 0.298163958s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/redhat.vscode-yaml-1.15.0/node_modules 2024-10-08 17:19:07.912 [info] [Trace - 5:19:07 PM] 0.298269208s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/redhat.vscode-yaml-1.15.0/dist 2024-10-08 17:19:07.922 [info] [Trace - 5:19:07 PM] 0.312313500s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/github.remotehub-0.64.0/dist 2024-10-08 17:19:07.930 [info] [Trace - 5:19:07 PM] 0.318190500s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-vscode.remote-explorer-0.4.3/build 2024-10-08 17:19:07.933 [info] [Trace - 5:19:07 PM] 0.321519917s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-vscode.remote-explorer-0.4.3/dist 2024-10-08 17:19:07.933 [info] [Trace - 5:19:07 PM] 0.323522542s DEBUG ThreadId(04) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/Research/Paper/.git 2024-10-08 17:19:07.936 [info] [Trace - 5:19:07 PM] 0.327700875s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-toolsai.vscode-jupyter-powertoys-0.1.1/build 2024-10-08 17:19:07.936 [info] [Trace - 5:19:07 PM] 0.332256417s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/brandonkirbyson.vscode-animations-2.0.4/dist 2024-10-08 17:19:07.940 [info] [Trace - 5:19:07 PM] 0.335455917s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/zhuangtongfa.material-theme-3.17.5/build 2024-10-08 17:19:07.941 [info] [Trace - 5:19:07 PM] 0.335854833s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/zhuangtongfa.material-theme-3.17.5/node_modules 2024-10-08 17:19:07.950 [info] [Trace - 5:19:07 PM] 0.340798917s DEBUG ThreadId(13) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/operations/build 2024-10-08 17:19:08.052 [info] [Trace - 5:19:08 PM] 0.448139708s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/bierner.markdown-preview-github-styles-2.1.0/build 2024-10-08 17:19:08.054 [info] [Trace - 5:19:08 PM] 0.450247625s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/bierner.markdown-preview-github-styles-2.1.0/dist 2024-10-08 17:19:08.065 [info] [Trace - 5:19:08 PM] 0.456169042s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/robertz.code-snapshot-0.2.1/node_modules 2024-10-08 17:19:08.087 [info] [Trace - 5:19:08 PM] 0.477712708s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-vscode.cpptools-1.21.6-darwin-arm64/dist 2024-10-08 17:19:08.088 [info] [Trace - 5:19:08 PM] 0.480263208s DEBUG ThreadId(09) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /Applications/Obsidian.app/Contents/Resources/app.asar.unpacked/node_modules 2024-10-08 17:19:08.089 [info] [Trace - 5:19:08 PM] 0.484746583s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-vscode-remote.remote-ssh-edit-0.87.0/build 2024-10-08 17:19:08.586 [info] [Trace - 5:19:08 PM] 0.501499917s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-toolsai.jupyter-2024.9.1-darwin-arm64/dist 2024-10-08 17:19:08.603 [info] [Trace - 5:19:08 PM] 0.507281208s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/haaleo.timing-2.7.2/dist 2024-10-08 17:19:08.618 [info] [Trace - 5:19:08 PM] 0.509051958s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-python.vscode-pylance-2024.10.1/dist 2024-10-08 17:19:08.630 [info] [Trace - 5:19:08 PM] 0.512702875s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/formulahendry.code-runner-0.12.2/node_modules 2024-10-08 17:19:08.634 [info] [Trace - 5:19:08 PM] 0.520166583s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/eamodio.gitlens-15.6.0/dist 2024-10-08 17:19:08.638 [info] [Trace - 5:19:08 PM] Sending notification '$/setTrace'. 2024-10-08 17:19:08.638 [info] [Trace - 5:19:08 PM] 0.521200292s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/psioniq.psi-header-1.23.1/node_modules 2024-10-08 17:19:08.639 [info] [Trace - 5:19:08 PM] 0.523063208s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-vscode.hexeditor-1.10.0/node_modules 2024-10-08 17:19:08.639 [info] [Trace - 5:19:08 PM] 0.523137667s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-vscode.hexeditor-1.10.0/dist 2024-10-08 17:19:08.791 [info] [Trace - 5:19:08 PM] 0.527756792s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/github.copilot-1.236.0/dist 2024-10-08 17:19:08.792 [info] [Trace - 5:19:08 PM] 0.599551083s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-python.python-2024.16.0-darwin-arm64/python_files/lib/jedilsp/jedi/third_party/typeshed/stdlib/3/venv 2024-10-08 17:19:08.793 [info] [Trace - 5:19:08 PM] 0.674728375s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-python.python-2024.16.0-darwin-arm64/dist 2024-10-08 17:19:08.794 [info] [Trace - 5:19:08 PM] 0.676383375s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-python.python-2024.16.0-darwin-arm64/out/client/node_modules 2024-10-08 17:19:08.794 [info] [Trace - 5:19:08 PM] 0.679328292s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.19/out/node_modules 2024-10-08 17:19:08.794 [info] [Trace - 5:19:08 PM] 0.683586542s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/christian-kohler.path-intellisense-2.9.0/build 2024-10-08 17:19:08.795 [info] [Trace - 5:19:08 PM] 0.683830875s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/christian-kohler.path-intellisense-2.9.0/node_modules 2024-10-08 17:19:08.795 [info] [Trace - 5:19:08 PM] 0.694477292s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-vscode-remote.remote-ssh-0.115.0/build 2024-10-08 17:19:08.795 [info] [Trace - 5:19:08 PM] 0.705330542s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ivhernandez.vscode-plist-0.1.3/node_modules 2024-10-08 17:19:08.795 [info] [Trace - 5:19:08 PM] 0.706173458s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ivhernandez.vscode-plist-0.1.3/dist 2024-10-08 17:19:08.795 [info] [Trace - 5:19:08 PM] 0.711564250s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `extend-exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/charliermarsh.ruff-2024.50.0-darwin-arm64/bundled/libs 2024-10-08 17:19:08.796 [info] [Trace - 5:19:08 PM] 0.711624292s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/charliermarsh.ruff-2024.50.0-darwin-arm64/dist 2024-10-08 17:19:08.796 [info] [Trace - 5:19:08 PM] 0.715589167s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/jock.svg-1.5.4/client/out/codicons/dist 2024-10-08 17:19:08.796 [info] [Trace - 5:19:08 PM] 0.720285958s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/usernamehw.errorlens-3.20.0/dist 2024-10-08 17:19:08.796 [info] [Trace - 5:19:08 PM] 0.721747500s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/be5invis.vscode-custom-css-7.3.1/node_modules 2024-10-08 17:19:08.796 [info] [Trace - 5:19:08 PM] 0.723867417s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/alefragnani.bookmarks-13.5.0/dist 2024-10-08 17:19:08.796 [info] [Trace - 5:19:08 PM] 0.728372875s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/saoudrizwan.claude-dev-1.9.7/webview-ui/build 2024-10-08 17:19:08.797 [info] [Trace - 5:19:08 PM] 0.728575583s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/saoudrizwan.claude-dev-1.9.7/node_modules 2024-10-08 17:19:08.797 [info] [Trace - 5:19:08 PM] 0.728729375s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/saoudrizwan.claude-dev-1.9.7/dist 2024-10-08 17:19:08.798 [info] [Trace - 5:19:08 PM] 0.731381708s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-vscode-remote.remote-wsl-0.88.4/dist 2024-10-08 17:19:08.798 [info] [Trace - 5:19:08 PM] 0.733181458s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/mhutchie.git-graph-1.30.0/node_modules 2024-10-08 17:19:08.798 [info] [Trace - 5:19:08 PM] 0.735168250s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-toolsai.jupyter-keymap-1.1.2/build 2024-10-08 17:19:08.798 [info] [Trace - 5:19:08 PM] 0.811995833s DEBUG ThreadId(08) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /Applications/Termius.app/Contents/Resources/app.asar.unpacked/node_modules 2024-10-08 17:19:08.798 [info] [Trace - 5:19:08 PM] 0.920150125s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/valentjn.vscode-ltex-13.1.0/dist 2024-10-08 17:19:08.798 [info] [Trace - 5:19:08 PM] 0.921680875s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-vscode.remote-repositories-0.42.0/dist 2024-10-08 17:19:08.798 [info] [Trace - 5:19:08 PM] 0.924769042s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/mechatroner.rainbow-csv-3.12.0/dist 2024-10-08 17:19:08.798 [info] [Trace - 5:19:08 PM] 0.942403375s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/ms-python.debugpy-2024.10.0-darwin-arm64/dist 2024-10-08 17:19:08.798 [info] [Trace - 5:19:08 PM] 0.983308500s DEBUG ThreadId(08) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /Applications/TeX/TeX Live Utility.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/venv 2024-10-08 17:19:08.798 [info] [Trace - 5:19:08 PM] 0.984234875s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/james-yu.latex-workshop-10.5.0/node_modules 2024-10-08 17:19:08.798 [info] [Trace - 5:19:08 PM] 1.016070333s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/github.copilot-chat-0.21.0/dist 2024-10-08 17:19:08.798 [info] [Trace - 5:19:08 PM] 1.017714208s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/.vscode/extensions/chouzz.vscode-better-align-1.4.2/dist 2024-10-08 17:19:08.798 [info] [Trace - 5:19:08 PM] 1.104754833s DEBUG ThreadId(08) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /Applications/TeX/TeX Live Utility.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/operations/build 2024-10-08 17:19:08.798 [info] [Trace - 5:19:08 PM] 1.152612417s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/micromamba/envs/Research/share/zoneinfo/build 2024-10-08 17:19:08.798 [info] [Trace - 5:19:08 PM] 1.183919667s DEBUG ThreadId(05) ruff_server::session::index::ruff_settings: Ignored path via `exclude`: /System/Volumes/Data/Users/craig/micromamba/envs/Research/lib/python3.12/venv 2024-10-08 17:19:08.810 [info] warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `System/Volumes/Data/Users/craig/micromamba/envs/Research/lib/python3.12/site-packages/pandas/pyproject.toml`: - 'ignore' -> 'lint.ignore' - 'select' -> 'lint.select' - 'typing-modules' -> 'lint.typing-modules' - 'unfixable' -> 'lint.unfixable' - 'per-file-ignores' -> 'lint.per-file-ignores' 2024-10-08 17:19:08.811 [info] warning: `PGH001` has been remapped to `S307`. ```
dhruvmanila commented 22 hours ago

However, when I open the folder containing the file, it finds the correct workspace and works fine.

I think that is an expected behavior.

Thanks for providing the logs although I don't see any error messages in it. As mentioned, I think you were opening the editor in the system root directory which means it would take some time to load the extension completely because it tries to index the entire root directory. I'm really curious to know why the error is occurring although I'm mostly sure that one of the config on your system is invalid :)

MichaReiser commented 6 hours ago

I can reproduce this behavior.

Ruff ends up indexing the entire root partition. This is unlikely what the user wanted. I don't have a good suggestion on what the extension should do in this case. What are other extensions doing in this case?

dhruvmanila commented 6 hours ago

And that file is in the root directory, right? This is related to https://github.com/astral-sh/ruff/issues/11366 then. One solution would be to not index the workspace if there's none provided aka using the server for single file. Any nested configs shouldn't affect the output for this specific file.

MichaReiser commented 6 hours ago

No. The file is in a subdirectory of my home directory

ffisc commented 2 hours ago

@ffisc Please provide any log messages if possible to help diagnose the issue.

Sure, here:

2024-10-09 13:01:55.788 [info] Name: Ruff
2024-10-09 13:01:55.788 [info] Module: ruff
2024-10-09 13:01:55.788 [info] Python extension loading
2024-10-09 13:01:55.788 [info] Waiting for interpreter from python extension.
2024-10-09 13:01:56.175 [info] Python extension loaded
2024-10-09 13:01:56.190 [info] Using interpreter: /Users/ffi/dev/benchmarks/foo/bar/.venv/bin/python
2024-10-09 13:01:56.206 [info] Using bundled executable: /Users/ff/.vscode-insiders/extensions/charliermarsh.ruff-2024.50.0-darwin-arm64/bundled/libs/bin/ruff
2024-10-09 13:01:56.318 [info] Resolved 'ruff.nativeServer: auto' to use the native server
2024-10-09 13:01:56.321 [info] Found Ruff 0.6.6 at /Users/ff/.vscode-insiders/extensions/charliermarsh.ruff-2024.50.0-darwin-arm64/bundled/libs/bin/ruff
2024-10-09 13:01:56.321 [info] Server run command: /Users/ff/.vscode-insiders/extensions/charliermarsh.ruff-2024.50.0-darwin-arm64/bundled/libs/bin/ruff server
2024-10-09 13:01:56.322 [info] Server: Start requested.