diff --git a/crates/ruff_server/src/server/api/requests/execute_command.rs b/crates/ruff_server/src/server/api/requests/execute_command.rs index 9339b5920f8901..069bf7226727e2 100644 --- a/crates/ruff_server/src/server/api/requests/execute_command.rs +++ b/crates/ruff_server/src/server/api/requests/execute_command.rs @@ -160,14 +160,14 @@ version = {version} position_encoding = {encoding:?} workspace_root_folders = {workspace_folders:#?} indexed_configuration_files = {config_files:#?} -open_documents = {open_documents} +open_documents_len = {open_documents_len} client_capabilities = {client_capabilities:#?} ", version = crate::version(), encoding = session.encoding(), workspace_folders = session.workspace_root_folders().collect::>(), config_files = session.config_file_paths().collect::>(), - open_documents = session.open_documents(), + open_documents_len = session.open_documents_len(), client_capabilities = session.resolved_client_capabilities(), )?; @@ -176,10 +176,11 @@ client_capabilities = {client_capabilities:#?} writeln!(buffer, "Unable to take a snapshot of the document at {uri}")?; return Ok(buffer); }; + let query = snapshot.query(); writeln!( buffer, - "Document: + "Open document: uri = {uri} kind = {kind} version = {version} @@ -193,10 +194,10 @@ config_path = {config_path:?} DocumentKey::NotebookCell(_) => "NotebookCell", DocumentKey::Text(_) => "Text", }, - version = snapshot.query().version(), + version = query.version(), client_settings = snapshot.client_settings(), - config_path = snapshot.query().settings().path(), - settings = snapshot.query().settings(), + config_path = query.settings().path(), + settings = query.settings(), )?; } else { writeln!( diff --git a/crates/ruff_server/src/session.rs b/crates/ruff_server/src/session.rs index a71b9e102df60f..4b5da29068c417 100644 --- a/crates/ruff_server/src/session.rs +++ b/crates/ruff_server/src/session.rs @@ -168,8 +168,8 @@ impl Session { } /// Returns the number of open documents in the session. - pub(crate) fn open_documents(&self) -> usize { - self.index.open_documents() + pub(crate) fn open_documents_len(&self) -> usize { + self.index.open_documents_len() } /// Returns an iterator over the workspace root folders in the session. diff --git a/crates/ruff_server/src/session/index.rs b/crates/ruff_server/src/session/index.rs index cefbfc1f0f8590..3ca1ac5ba283b5 100644 --- a/crates/ruff_server/src/session/index.rs +++ b/crates/ruff_server/src/session/index.rs @@ -396,7 +396,7 @@ impl Index { } /// Returns the number of open documents. - pub(super) fn open_documents(&self) -> usize { + pub(super) fn open_documents_len(&self) -> usize { self.documents.len() }