Skip to content

LSP completions shouldn't ignore lexical scope #13549

Description

@jtran

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/lspkclLanguage and compiler features

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions