Add Jupyter Notebook document change snapshot test (#11944)

## Summary

Closes #11914.

This PR introduces a snapshot test that replays the LSP requests made
during a document formatting request, and confirms that the notebook
document is updated in the expected way.
This commit is contained in:
Jane Lewis 2024-06-20 22:29:27 -07:00 committed by GitHub
parent 927069c12f
commit 3ab7a8da73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 921 additions and 20 deletions

View file

@ -49,7 +49,7 @@ enum DocumentController {
/// This query can 'select' a text document, full notebook, or a specific notebook cell.
/// It also includes document settings.
#[derive(Clone)]
pub(crate) enum DocumentQuery {
pub enum DocumentQuery {
Text {
file_url: Url,
document: Arc<TextDocument>,
@ -519,7 +519,7 @@ impl DocumentQuery {
}
/// Attempts to access the underlying notebook document that this query is selecting.
pub(crate) fn as_notebook(&self) -> Option<&NotebookDocument> {
pub fn as_notebook(&self) -> Option<&NotebookDocument> {
match self {
Self::Notebook { notebook, .. } => Some(notebook),
Self::Text { .. } => None,

View file

@ -18,7 +18,7 @@ use walkdir::WalkDir;
use crate::session::settings::{ConfigurationPreference, ResolvedEditorSettings};
pub(crate) struct RuffSettings {
pub struct RuffSettings {
/// The path to this configuration file, used for debugging.
/// The default fallback configuration does not have a file path.
path: Option<PathBuf>,

View file

@ -60,7 +60,7 @@ pub(crate) enum ConfigurationPreference {
#[derive(Debug, Deserialize, Default)]
#[cfg_attr(test, derive(PartialEq, Eq))]
#[serde(rename_all = "camelCase")]
pub(crate) struct ClientSettings {
pub struct ClientSettings {
configuration: Option<String>,
fix_all: Option<bool>,
organize_imports: Option<bool>,