|
1 | 1 | use crate::completions::{Completer, CompletionOptions, SemanticSuggestion, SuggestionKind}; |
2 | | -use nu_engine::{column::get_columns, eval_expression, eval_variable}; |
| 2 | +use nu_engine::{column::get_columns, eval_variable}; |
3 | 3 | use nu_protocol::{ |
4 | 4 | ast::{Expr, FullCellPath, PathMember}, |
5 | | - debugger::WithoutDebug, |
6 | 5 | engine::{Stack, StateWorkingSet}, |
| 6 | + eval_const::eval_constant, |
7 | 7 | Span, Value, VarId, |
8 | 8 | }; |
9 | 9 | use reedline::Suggestion; |
@@ -124,12 +124,9 @@ impl Completer for CellPathCompletion<'_> { |
124 | 124 | .get_variable(var_id) |
125 | 125 | .const_val |
126 | 126 | .to_owned() |
127 | | - .or(eval_variable(working_set.permanent_state, stack, var_id, span).ok()) |
| 127 | + .or_else(|| eval_variable(working_set.permanent_state, stack, var_id, span).ok()) |
128 | 128 | } else { |
129 | | - let mut stack = stack.clone(); |
130 | | - let mut new_engine = working_set.permanent_state.clone(); |
131 | | - let _ = new_engine.merge_delta(working_set.delta.clone()); |
132 | | - eval_expression::<WithoutDebug>(&new_engine, &mut stack, &self.full_cell_path.head).ok() |
| 129 | + eval_constant(working_set, &self.full_cell_path.head).ok() |
133 | 130 | } |
134 | 131 | .unwrap_or_default(); |
135 | 132 |
|
|
0 commit comments