qdk
qdk copied to clipboard
Completion list doesn't include local variable that is later shadowed in the same scope
Introduced in #880 .
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.