Pass Stack ref to Completer::fetch (#12783)

# Description
Adds an additional `&Stack` parameter to `Completer::fetch` so that the
completers don't have to store a `Stack` themselves. I also removed
unnecessary `EngineState`s from the completers, since the same
`EngineState` is available in the `working_set.permanent_state` also
passed to `Completer::fetch`.
This commit is contained in:
Ian Manske
2024-05-09 05:38:24 +00:00
committed by GitHub
parent 3b3f48202c
commit 7271ad7909
13 changed files with 146 additions and 183 deletions

View File

@ -552,8 +552,8 @@ impl LanguageServer {
&params.text_document_position.text_document.uri,
)?;
let stack = Stack::new();
let mut completer = NuCompleter::new(Arc::new(engine_state.clone()), stack);
let mut completer =
NuCompleter::new(Arc::new(engine_state.clone()), Arc::new(Stack::new()));
let location =
Self::lsp_position_to_location(&params.text_document_position.position, rope_of_file);