Skip to content

feat: offer string literal completions always when expected type of e…#2

Merged
Minibrams merged 2 commits intostring-literal-completionsfrom
feature/expected-type
Jan 10, 2026
Merged

feat: offer string literal completions always when expected type of e…#2
Minibrams merged 2 commits intostring-literal-completionsfrom
feature/expected-type

Conversation

@Minibrams
Copy link
Owner

…xpression is string literal

Summary

Test Plan

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cc193c23ab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 11887 to 11891
Type::Union(union) => {
for ty in union.elements(db) {
let Type::TypedDict(typed_dict) = *ty else {
return None;
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve TypedDict key completions for mixed unions

The new expected_subscript_slice_type returns None as soon as it encounters a union member that isn’t a TypedDict. Since completions now require an expected type, this suppresses key literal suggestions for common cases like TypedDict | None or TypedDict | Mapping, even though the old collect_typed_dict_key_literals logic would still surface keys from the typed‑dict members. That’s a regression in completion coverage for valid typed‑dict access patterns. Consider collecting keys from any typed‑dict members (and skipping non‑typed‑dict ones) instead of bailing out.

Useful? React with 👍 / 👎.

@Minibrams Minibrams merged commit 15fd69d into string-literal-completions Jan 10, 2026
31 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant