You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reset ruff.configuration if it contains VS Code variables (#746)
## Summary
fixes: #741
## Test Plan
`settings.json`:
```json
{
"ruff.configuration": "${workspaceFolder}/formatter/ruff.toml"
}
```
"Ruff" output channel:
> [!NOTE]
>
> I've only kept the necessary settings here but the actual log output
includes everything
```
2025-05-01 10:38:43.029 [info] Workspace settings for /Users/dhruv/playground/ruff: {
"nativeServer": "on",
"cwd": "/Users/dhruv/playground/ruff",
"workspace": "file:///Users/dhruv/playground/ruff",
"path": [
"/Users/dhruv/work/astral/ruff/target/debug/ruff"
],
"configuration": "/Users/dhruv/playground/ruff/formatter/ruff.toml",
}
2025-05-01 10:38:43.030 [info] Resetting 'ruff.configuration' to null in global settings because it contains workspace specific variables
2025-05-01 10:38:43.030 [info] Global settings: {
"nativeServer": "on",
"cwd": "/",
"workspace": "/",
"path": [
"/Users/dhruv/work/astral/ruff/target/debug/ruff"
],
"configuration": null,
}
```
`settings.json`:
```json
{
"ruff.configuration": "${workspaceFolder:root}/formatter/ruff.toml"
}
```
"Ruff" output channel:
```
2025-05-01 10:40:42.200 [info] Workspace settings for /Users/dhruv/playground/ruff: {
"nativeServer": "on",
"cwd": "/Users/dhruv/playground/ruff",
"workspace": "file:///Users/dhruv/playground/ruff",
"path": [
"/Users/dhruv/work/astral/ruff/target/debug/ruff"
],
"configuration": "${workspaceFolder:root}/formatter/ruff.toml",
}
2025-05-01 10:40:42.200 [info] Resetting 'ruff.configuration' to null in global settings because it contains workspace specific variables
2025-05-01 10:40:42.200 [info] Global settings: {
"nativeServer": "on",
"cwd": "/",
"workspace": "/",
"path": [
"/Users/dhruv/work/astral/ruff/target/debug/ruff"
],
"configuration": null,
}
```
For this specific test case, you can see that the workspace settings
also includes the `${workspaceFolder:root}` because it doesn't exists.
That would also create an error:
```
2025-05-01 10:42:14.245925000 ERROR Failed to load settings from `configuration`: error looking key 'workspaceFolder:root' up: environment variable not found
```
I think we should handle that as well.
0 commit comments