Skip to content

Commit 4be91aa

Browse files
committed
Don't expose debug_env
1 parent 8e15b09 commit 4be91aa

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

crates/ark/src/interface.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ pub struct RMain {
259259
/// Current topmost environment on the stack while waiting for input in the
260260
/// debugger. This is `Some()` only when R is idle and in a `browser()`
261261
/// prompt.
262-
pub(crate) debug_env: Option<RObject>,
262+
debug_env: Option<RObject>,
263263
}
264264

265265
/// Represents the currently active execution request from the frontend. It
@@ -2072,6 +2072,11 @@ impl RMain {
20722072
StdInRpcReply::Interrupt => Ok(RObject::null()),
20732073
}
20742074
}
2075+
2076+
#[cfg(not(test))] // Avoid warnings in unit test
2077+
pub(crate) fn debug_env(&self) -> Option<RObject> {
2078+
self.debug_env.clone()
2079+
}
20752080
}
20762081

20772082
/// Report an incomplete request to the frontend

crates/ark/src/lsp/completions/sources/composite/search_path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ fn completions_from_search_path(
6565
#[cfg(not(test))] // Unit tests do not have an `RMain`
6666
{
6767
use crate::interface::RMain;
68-
if let Some(debug_env) = &RMain::get().debug_env {
68+
if let Some(debug_env) = &RMain::get().debug_env() {
6969
// Mem-Safety: Object protected by `RMain` for the duration of the `r_task()`
7070
env = debug_env.sexp;
7171
}

0 commit comments

Comments
 (0)