-
Notifications
You must be signed in to change notification settings - Fork 768
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect hover/definition for compound string key #4695
Comments
Pulled out a helper for finding the type that the string is a key for. Copied some logic for verifying that the StringNode is the only node within a StringListNode from the completion logic. There appears to be some jank in the find definition logic that doesn't verify if a StringNode is the only element in a StringListNode. https://github.com/microsoft/pyright/issues/5655 https://github.com/microsoft/pyright/issues/5654
@rchiodo or @debonte, please transfer this to the pylance-relase project since it's related to a language server feature. I don't know if this is worth addressing since it's such an edge case and the workaround is obvious — replace the compound key strings with a single string literal. I'll leave it to the pylance team to decide whether to address this. |
Moving this issue to discussion as an enhancement request for comments and upvotes. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Description
If a compound string (
'prefix' 'suffix'
) is used as a key when constructing aTypedDict
expression where the either the first string or last string section is also a valid key into theTypedDict
, then the info/definition when hovering over those segments is incorrect.Expected behaviour
Either the whole compound string is highlighted and the correct type info for the whole key is shown or no type info should be shown for compound string keys.
Steps
The text was updated successfully, but these errors were encountered: