completion_items walks the entire AST and returns every variable, import, and tag. Its position argument is otherwise unused. Consequently, variable declarations from nested scopes are offered inside sibling blocks and after the blocks, where they are invalid. This is made worse in KCL 3.0 where if-else also has scope. The LSP uses these results directly in lsp/kcl/mod.rs.
completion_items walks the entire AST and returns every variable, import, and tag. Its
positionargument is otherwise unused. Consequently, variable declarations from nested scopes are offered inside sibling blocks and after the blocks, where they are invalid. This is made worse in KCL 3.0 where if-else also has scope. The LSP uses these results directly in lsp/kcl/mod.rs.