Skip to content

Completion list doesn't include local variable that is later shadowed in the same scope #897

@minestarks

Description

@minestarks

Introduced in #880 .

Playground link

namespace MyQuantumProgram {
    @EntryPoint()
    operation Main() : Result[] {

        // correct: completion list does not include `foo`
        let foo = 3;
        // INCORRECT: completion list does not include `foo`
        let foo = "hi";
        // correct: completion list includes `foo`
        
        return [];
    }
}

When the cursor is in between the two declarations, we should show foo in the list, with type Int. Instead, today, because we have set the "valid at" offset based on the last declaration in the scope, we don't show foo anywhere above that last declaration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions