Skip to content

Ruff Server errors when using a VSCode interactive session #11851

@MichaReiser

Description

@MichaReiser

Apologies for commenting on a closed ticket, but it looks to be related:
There seems to be a similar issue when using a VSCode interactive session (VSCode > Run Current File in Interactive Window or Create Interactive Window:

My local Ruff is on 0.4.8

2024-06-12 16:23:08.468 [info] Name: Ruff
2024-06-12 16:23:08.468 [info] Module: ruff
2024-06-12 16:23:08.469 [info] Python extension loading
2024-06-12 16:23:08.469 [info] Waiting for interpreter from python extension.
2024-06-12 16:23:08.469 [info] Python extension loaded
2024-06-12 16:23:08.469 [info] Server run command: $HOME/.local/bin/ruff server --preview
2024-06-12 16:23:08.469 [info] Server: Start requested.
2024-06-12 16:23:08.567 [info]    0.843883s INFO ruff_server::server Configuration file watcher successfully registered

2024-06-12 16:23:26.985 [info]   19.307727s WARN ruff_server::session::index No settings available for untitled:/Interactive-1.interactive - falling back to default settings
  19.308549s DEBUG ruff_server::lint Ignored path via `exclude`: /Interactive-1.interactive

2024-06-12 16:23:28.934 [info]   21.293249s WARN ruff_server::session::index No settings available for untitled:/Interactive-1.interactive - falling back to default settings

2024-06-12 16:23:28.934 [info]   21.293530s DEBUG ruff_server::lint Ignored path via `exclude`: /Interactive-1.interactive

2024-06-12 16:23:29.143 [info]   21.488888s WARN ruff_server::session::index No settings available for untitled:/Interactive-1.interactive - falling back to default settings
  21.489236s DEBUG ruff_server::lint Ignored path via `exclude`: /Interactive-1.interactive
  21.489315s WARN ruff_server::session::index No settings available for untitled:/Interactive-1.interactive - falling back to default settings
  21.489531s DEBUG ruff_server::lint Ignored path via `exclude`: /Interactive-1.interactive

2024-06-12 16:23:29.225 [info]   21.576600s WARN ruff_server::session::index No settings available for untitled:/Interactive-1.interactive - falling back to default settings
  21.578133s DEBUG ruff_server::lint Ignored path via `exclude`: /Interactive-1.interactive
  21.578433s WARN ruff_server::session::index No settings available for untitled:/Interactive-1.interactive - falling back to default settings
  21.578733s DEBUG ruff_server::lint Ignored path via `exclude`: /Interactive-1.interactive

2024-06-12 16:23:30.044 [info]   22.403670s WARN ruff_server::session::index No settings available for untitled:/Interactive-1.interactive - falling back to default settings

2024-06-12 16:23:30.045 [info]   22.404434s DEBUG ruff_server::lint Ignored path via `exclude`: /Interactive-1.interactive
  22.404564s WARN ruff_server::session::index No settings available for untitled:/Interactive-1.interactive - falling back to default settings

2024-06-12 16:23:30.045 [info]   22.404794s DEBUG ruff_server::lint Ignored path via `exclude`: /Interactive-1.interactive

I've attempted excluding the interactive file type via my user settings like the below, but warnings still loop:

{
...
    "ruff.path": ["$HOME/.local/bin/ruff"],
    "ruff.exclude": ["*.interactive"],
    "ruff.nativeServer": true,
}

What the logs look like when ruff.nativeServer is disabled:

2024-06-12 16:31:11.131 [info] Name: Ruff
2024-06-12 16:31:11.131 [info] Module: ruff
2024-06-12 16:31:11.131 [info] Python extension loading
2024-06-12 16:31:11.131 [info] Waiting for interpreter from python extension.
2024-06-12 16:31:11.131 [info] Python extension loaded
2024-06-12 16:31:11.131 [info] Server run command: $HOME/.micromamba/envs/seg/bin/python $HOME/.vscode-server/extensions/charliermarsh.ruff-2024.26.0-linux-x64/bundled/tool/server.py
2024-06-12 16:31:11.131 [info] Server: Start requested.
2024-06-12 16:31:11.360 [info] 2024-06-12 16:31:11,285 INFO Starting IO server

2024-06-12 16:31:11.431 [info] Workspace settings: [
    {
        "nativeServer": false,
        "cwd": "$HOME/Dev/projects/seg-2023/seg_2023",
        "workspace": "file://$HOME/Dev/projects/seg-2023/seg_2023",
        "path": [
            "$HOME/.local/bin/ruff"
        ],
        "ignoreStandardLibrary": true,
        "interpreter": [
            "$HOME/.micromamba/envs/seg/bin/python"
        ],
        "configuration": null,
        "importStrategy": "fromEnvironment",
        "codeAction": {
            "fixViolation": {
                "enable": true
            },
            "disableRuleComment": {
                "enable": true
            }
        },
        "lint": {
            "enable": true,
            "run": "onType",
            "args": [],
            "preview": null,
            "select": null,
            "extendSelect": null,
            "ignore": null
        },
        "format": {
            "args": [],
            "preview": null
        },
        "enable": true,
        "organizeImports": true,
        "fixAll": true,
        "showNotifications": "off",
        "exclude": null,
        "lineLength": null,
        "configurationPreference": "editorFirst"
    }
]
2024-06-12 16:31:11.433 [info] Global settings: {
    "nativeServer": false,
    "cwd": "$HOME/AppData/Local/Programs/Microsoft VS Code",
    "workspace": "$HOME/AppData/Local/Programs/Microsoft VS Code",
    "path": [
        "$HOME/.local/bin/ruff"
    ],
    "ignoreStandardLibrary": true,
    "interpreter": [],
    "configuration": null,
    "importStrategy": "fromEnvironment",
    "codeAction": {
        "fixViolation": {
            "enable": true
        },
        "disableRuleComment": {
            "enable": true
        }
    },
    "lint": {
        "enable": true,
        "run": "onType",
        "args": []
    },
    "format": {
        "args": []
    },
    "enable": true,
    "organizeImports": true,
    "fixAll": true,
    "showNotifications": "off",
    "configurationPreference": "editorFirst"
}
2024-06-12 16:31:11.576 [info] Using 'path' setting: $HOME/.local/bin/ruff
2024-06-12 16:31:11.601 [info] Inferred version 0.4.8 for: $HOME/.local/bin/ruff
2024-06-12 16:31:11.614 [info] Found ruff 0.4.8 at $HOME/.local/bin/ruff
2024-06-12 16:31:11.617 [info] Running Ruff with: $HOME/.local/bin/ruff ['check', '--force-exclude', '--no-cache', '--no-fix', '--quiet', '--output-format', 'json', '-', '--stdin-filename', '$HOME/Dev/projects/seg-2023/seg_2023/src/seg_2023/config.py']
2024-06-12 16:31:31.659 [info] Using 'path' setting: $HOME/.local/bin/ruff
2024-06-12 16:31:31.673 [info] Found ruff 0.4.8 at $HOME/.local/bin/ruff
2024-06-12 16:31:31.676 [info] Running Ruff with: $HOME/.local/bin/ruff ['check', '--force-exclude', '--no-cache', '--no-fix', '--quiet', '--output-format', 'json', '-', '--stdin-filename', '/Interactive-1.interactive']
2024-06-12 16:31:33.781 [info] Using 'path' setting: $HOME/.local/bin/ruff
2024-06-12 16:31:33.804 [info] Found ruff 0.4.8 at $HOME/.local/bin/ruff
2024-06-12 16:31:33.836 [info] Running Ruff with: $HOME/.local/bin/ruff ['check', '--force-exclude', '--no-cache', '--no-fix', '--quiet', '--output-format', 'json', '-', '--stdin-filename', '/Interactive-1.interactive']
2024-06-12 16:31:33.842 [info] Using 'path' setting: $HOME/.local/bin/ruff
2024-06-12 16:31:33.842 [info] Found ruff 0.4.8 at $HOME/.local/bin/ruff
2024-06-12 16:31:33.842 [info] Running Ruff with: $HOME/.local/bin/ruff ['check', '--force-exclude', '--no-cache', '--no-fix', '--quiet', '--output-format', 'json', '-', '--stdin-filename', '/Interactive-1.interactive']
2024-06-12 16:31:33.843 [info] 2024-06-12 16:31:33,842 WARNING Cancel notification for unknown message id "6"

2024-06-12 16:31:33.844 [info] Using 'path' setting: $HOME/.local/bin/ruff
2024-06-12 16:31:33.844 [info] Found ruff 0.4.8 at $HOME/.local/bin/ruff
2024-06-12 16:31:33.844 [info] Running Ruff with: $HOME/.local/bin/ruff ['check', '--force-exclude', '--no-cache', '--no-fix', '--quiet', '--output-format', 'json', '-', '--stdin-filename', '/Interactive-1.interactive']
2024-06-12 16:31:33.845 [info] Using 'path' setting: $HOME/.local/bin/ruff
2024-06-12 16:31:33.845 [info] Found ruff 0.4.8 at $HOME/.local/bin/ruff
2024-06-12 16:31:33.845 [info] Running Ruff with: $HOME/.local/bin/ruff ['check', '--force-exclude', '--no-cache', '--no-fix', '--quiet', '--output-format', 'json', '-', '--stdin-filename', '/Interactive-1.interactive']
2024-06-12 16:31:33.846 [info] Using 'path' setting: $HOME/.local/bin/ruff
2024-06-12 16:31:33.846 [info] Found ruff 0.4.8 at $HOME/.local/bin/ruff
2024-06-12 16:31:33.846 [info] Running Ruff with: $HOME/.local/bin/ruff ['check', '--force-exclude', '--no-cache', '--no-fix', '--quiet', '--output-format', 'json', '-', '--stdin-filename', '/Interactive-1.interactive']
2024-06-12 16:31:34.037 [info] 2024-06-12 16:31:34,036 WARNING Cancel notification for unknown message id "8"

2024-06-12 16:31:34.176 [info] Using 'path' setting: $HOME/.local/bin/ruff
2024-06-12 16:31:34.177 [info] Found ruff 0.4.8 at $HOME/.local/bin/ruff
2024-06-12 16:31:34.177 [info] Running Ruff with: $HOME/.local/bin/ruff ['check', '--force-exclude', '--no-cache', '--no-fix', '--quiet', '--output-format', 'json', '-', '--stdin-filename', '/Interactive-1.interactive']
2024-06-12 16:31:34.183 [info] Using 'path' setting: $HOME/.local/bin/ruff
2024-06-12 16:31:34.184 [info] Found ruff 0.4.8 at $HOME/.local/bin/ruff
2024-06-12 16:31:34.185 [info] Running Ruff with: $HOME/.local/bin/ruff ['check', '--force-exclude', '--no-cache', '--no-fix', '--quiet', '--output-format', 'json', '-', '--stdin-filename', '/Interactive-1.interactive']

Originally posted by @pep-sanwer in #11674 (comment)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingserverRelated to the LSP server

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions