Skip to content

[Panic] Server crashes when setting exclude in VS Code settings #17010

@flying-sheep

Description

@flying-sheep

I tried to exclude this (literal, but weird-looking) path used by our template because Ruff complains about not being able to parse the templated pyproject.toml in there. But the Ruff server doesn’t like that exclude either, apparently.

{
  "ruff.exclude": ["{{cookiecutter.project_name}}"],
}
thread 'main' panicked at crates/ruff_server/src/session/index/ruff_settings.rs:117:82:
editor configuration should merge successfully with default configuration: error parsing glob '/home/phil/Dev/Python/Single Cell/cookiecutter-scverse/{{cookiecutter.project_name}}': nested alternate groups are not allowed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[Error - 11:27:07] Client Ruff: connection to server is erroring. Shutting down server.
[Error - 11:27:07] Sending document notification textDocument/didOpen failed
Error: write EPIPE
	at afterWriteDispatched (node:internal/stream_base_commons:161:15)
	at writeGeneric (node:internal/stream_base_commons:152:3)
	at Socket._writeGeneric (node:net:958:11)
	at Socket._write (node:net:970:8)
	at writeOrBuffer (node:internal/streams/writable:572:12)
	at _write (node:internal/streams/writable:501:10)
	at Writable.write (node:internal/streams/writable:510:10)
	at /home/phil/.vscode/extensions/charliermarsh.ruff-2025.22.0-linux-x64/dist/extension.js:1:124667
	at new Promise (<anonymous>)
	at a.write (/home/phil/.vscode/extensions/charliermarsh.ruff-2025.22.0-linux-x64/dist/extension.js:1:124585)
	at y.doWrite (/home/phil/.vscode/extensions/charliermarsh.ruff-2025.22.0-linux-x64/dist/extension.js:1:112201)
	at /home/phil/.vscode/extensions/charliermarsh.ruff-2025.22.0-linux-x64/dist/extension.js:1:112096
[Error - 11:27:07] Connection to server got closed. Server will not be restarted.
[Error - 11:27:07] Stopping server failed
  Message: Cannot call write after a stream was destroyed
  Code: -32099 
[Error - 11:27:07] Stopping server failed
  Message: Cannot call write after a stream was destroyed
  Code: -32099 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingconfigurationRelated to settings and configurationserverRelated to the LSP server

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions