Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvmanila committed Feb 18, 2025
1 parent 62ff785 commit 8408d65
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions crates/ruff_server/src/server/api/requests/execute_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<_>>(),
config_files = session.config_file_paths().collect::<Vec<_>>(),
open_documents = session.open_documents(),
open_documents_len = session.open_documents_len(),
client_capabilities = session.resolved_client_capabilities(),
)?;

Expand All @@ -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}
Expand All @@ -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!(
Expand Down
4 changes: 2 additions & 2 deletions crates/ruff_server/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_server/src/session/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit 8408d65

Please sign in to comment.