File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
crates/ark/src/lsp/completions/sources/composite Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ use libr::R_lsInternal;
18
18
use libr:: ENCLOS ;
19
19
use tower_lsp:: lsp_types:: CompletionItem ;
20
20
21
- use crate :: interface:: RMain ;
22
21
use crate :: lsp:: completions:: completion_context:: CompletionContext ;
23
22
use crate :: lsp:: completions:: completion_item:: completion_item_from_package;
24
23
use crate :: lsp:: completions:: completion_item:: completion_item_from_symbol;
@@ -63,9 +62,13 @@ fn completions_from_search_path(
63
62
64
63
// If we're waiting for input in `read_console()` with a debugger
65
64
// prompt, start from current environment
66
- if let Some ( debug_env) = & RMain :: get ( ) . debug_env {
67
- // Mem-Safety: Object protected by `RMain` for the duration of the `r_task()`
68
- env = debug_env. sexp ;
65
+ #[ cfg( not( test) ) ] // Unit tests do not have an `RMain`
66
+ {
67
+ use crate :: interface:: RMain ;
68
+ if let Some ( debug_env) = & RMain :: get ( ) . debug_env {
69
+ // Mem-Safety: Object protected by `RMain` for the duration of the `r_task()`
70
+ env = debug_env. sexp ;
71
+ }
69
72
}
70
73
71
74
while env != R_EmptyEnv {
You can’t perform that action at this time.
0 commit comments