ruff/crates/ruff_server/src
Dhruv Manilawala f3c14a4276
Keep track of deleted cell for reorder change request (#12575)
## Summary

This PR fixes a bug where the server wouldn't retain the cell content in
case of a reorder change request.

As mentioned in
https://github.com/astral-sh/ruff/issues/12573#issuecomment-2257819298,
this change request is modeled as (a) remove these cell URIs and (b) add
these cell URIs. The cell content isn't provided. But, the way we've
modeled the `NotebookCell` (it contains the underlying `TextDocument`),
we need to keep track of the deleted cells to get the content.

This is not an ideal solution and a better long term solution would be
to model it as per the spec but that is a big structural change and will
affect multiple parts of the server. Modeling as per the spec would also
avoid bugs like https://github.com/astral-sh/ruff/pull/11864. For
context, that model would add complexity per
https://github.com/astral-sh/ruff/pull/11206#discussion_r1600165481.

fixes: #12573

## Test Plan

This video shows the before and after the bug is fixed:


https://github.com/user-attachments/assets/2fcad4b5-f9af-4776-8640-4cd1fa16e325
2024-07-30 09:51:26 +00:00
..
edit Keep track of deleted cell for reorder change request (#12575) 2024-07-30 09:51:26 +00:00
server Do not bail code action resolution when a quick fix is requested (#12462) 2024-07-23 10:30:03 +05:30
session Consider `--preview` flag for `server` subcommand (#12208) 2024-07-18 11:05:01 +05:30
edit.rs Add Jupyter Notebook document change snapshot test (#11944) 2024-06-21 05:29:27 +00:00
fix.rs Conside `include`, `extend-include` for the native server (#12252) 2024-07-10 04:12:57 +00:00
format.rs `ruff server`: Formatting a document with syntax problems no longer spams a visible error popup (#11745) 2024-06-04 17:18:21 -07:00
lib.rs Conside `include`, `extend-include` for the native server (#12252) 2024-07-10 04:12:57 +00:00
lint.rs Conside `include`, `extend-include` for the native server (#12252) 2024-07-10 04:12:57 +00:00
message.rs `ruff server`: Tracing system now respects log level and trace level, with options to log to a file (#11747) 2024-06-11 11:29:47 -07:00
resolve.rs Conside `include`, `extend-include` for the native server (#12252) 2024-07-10 04:12:57 +00:00
server.rs Use `$/logTrace` for server trace logs in Zed and VS Code (#12564) 2024-07-30 08:32:20 +05:30
session.rs Add Jupyter Notebook document change snapshot test (#11944) 2024-06-21 05:29:27 +00:00
trace.rs Use `$/logTrace` for server trace logs in Zed and VS Code (#12564) 2024-07-30 08:32:20 +05:30