Skip to content

Commit 682e528

Browse files
Update pyrefly/lib/state/lsp.rs
Co-authored-by: Kyle Into <[email protected]>
1 parent a9a6a3c commit 682e528

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

pyrefly/lib/state/lsp.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,15 +2437,14 @@ impl<'a> Transaction<'a> {
24372437
}
24382438
}
24392439

2440-
if let Some(base_type) = self.get_type_trace(handle, base_expr.range()) {
2441-
if let Some(typed_keys) = self.collect_typed_dict_keys(handle, base_type) {
2442-
for (key, ty) in typed_keys {
2443-
let entry = suggestions.entry(key).or_insert(None);
2444-
if entry.is_none() {
2445-
*entry = Some(ty);
2446-
}
2447-
}
2448-
}
2440+
if let Some(base_type) = self.get_type_trace(handle, base_expr.range())
2441+
&& let Some(typed_keys) = self.collect_typed_dict_keys(handle, base_type) {
2442+
for (key, ty) in typed_keys {
2443+
let entry = suggestions.entry(key).or_insert(None);
2444+
if entry.is_none() {
2445+
*entry = Some(ty);
2446+
}
2447+
}
24492448
}
24502449

24512450
if suggestions.is_empty() {

0 commit comments

Comments
 (0)