Skip to content

Server doesn't sync cell content if copy-pasted directly #12201

@matrs

Description

@matrs

I've been using the ruff server the last days without problems (for linting and formatting), and suddenly this message appeared in vscode:

The Ruff language server exited with a panic. See the logs for more details.

I'm not aware of doing any different when it happened, just editing code, notebooks and scripts (ruff is configured to recognize .ipynb too).
I'm using ruff 0.5.0 , vscode 1.90.2 and extension ruff-2024.30. My Linux is 6.6.32-1-MANJARO.

2024-07-02 16:06:46.430 [info] Server: Start requested.
2024-07-02 16:07:23.830 [info] Name: Ruff
2024-07-02 16:07:23.830 [info] Module: ruff
2024-07-02 16:07:23.830 [info] Python extension loading
2024-07-02 16:07:23.830 [info] Waiting for interpreter from python extension.
2024-07-02 16:07:23.830 [info] Python extension loaded
2024-07-02 16:07:23.830 [info] Server run command: ~/.vscode/extensions/charliermarsh.ruff-2024.30.0-linux-x64/bundled/tool/ruff_server.py server --preview
2024-07-02 16:07:23.830 [info] Server: Start requested.
2024-07-03 12:20:55.252 [info] panicked at crates/ruff_source_file/src/line_index.rs:176:13:
index out of bounds: the len is 1 but the index is 2

2024-07-03 12:20:55.253 [info]    0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: <unknown>
  13: <unknown>
  14: <unknown>

2024-07-03 12:22:55.296 [info] panicked at crates/ruff_source_file/src/line_index.rs:176:13:
index out of bounds: the len is 1 but the index is 2
   0: <unknown>
   1: <unknown>
   2: <unknown>
   
2024-07-03 12:22:55.297 [info] 3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: <unknown>
  13: <unknown>
  14: <unknown>

Then I tried to restart the server from the command palette, which worked after the second time:

2024-07-03 12:31:16.160 [info] Server: Stop requested
2024-07-03 12:31:16.178 [info] Server run command: /home/mibu/miniconda3/envs/scrapped/bin/python /home/mibu/.vscode/extensions/charliermarsh.ruff-2024.30.0-linux-x64/bundled/tool/ruff_server.py server --preview
2024-07-03 12:31:16.180 [info] Server: Start requested.
2024-07-03 12:31:16.211 [info] panicked at /home/conda/feedstock_root/build_artifacts/ruff_1719517977307/_build_env/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jod-thread-0.1.2/src/lib.rs:21:21:
called `Result::unwrap()` on an `Err` value: Any { .. }
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: <unknown>
  13: <unknown>
  14: <unknown>

panicked at /home/conda/feedstock_root/build_artifacts/ruff_1719517977307/_build_env/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jod-thread-0.1.2/src/lib.rs:33:22:
called `Result::unwrap()` on an `Err` value: Any { .. }
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: <unknown>
  13: <unknown>
  14: <unknown>
  15: <unknown>
  16: <unknown>
  17: __libc_start_main
  18: <unknown>


2024-07-03 12:31:47.637 [info] Server: Stop requested
2024-07-03 12:31:47.657 [info] Server run command: /home/mibu/miniconda3/envs/scrapped/bin/python /home/mibu/.vscode/extensions/charliermarsh.ruff-2024.30.0-linux-x64/bundled/tool/ruff_server.py server --preview
2024-07-03 12:31:47.658 [info] Server: Start requested.

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