Rename to SessionSnapshot, move unwind assertion closer (#19177)

This PR addresses the post-merge review comments from
https://github.com/astral-sh/ruff/pull/19041, specifically it:
- Rename `WorkspaceSnapshot` to `SessionSnapshot`
- Rename `take_workspace_snapshot` to `take_session_snapshot`
- Rename `take_snapshot` to `take_document_snapshot`
- Move `AssertUnwindSafe` closer to the `catch_unwind` call which
requires the assertion
This commit is contained in:
Dhruv Manilawala 2025-07-07 19:44:23 +05:30 committed by GitHub
parent 1fd48120ba
commit 8cf1b876ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 28 additions and 22 deletions

View file

@ -80,7 +80,7 @@ pub(super) fn publish_diagnostics(
let path = key.path();
let snapshot = session
.take_snapshot(url.clone())
.take_document_snapshot(url.clone())
.ok_or_else(|| anyhow::anyhow!("Unable to take snapshot for document with URL {url}"))
.with_failure_code(lsp_server::ErrorCode::InternalError)?;