You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specifically it's return type is declared as List[Union[CompletionItem, str]]. This means a list where any item can be either a CompletionItem or str instance.
Instead the code that uses it tests the type of the first member of this list and assumes every other member of the list has the same type. So either the usage is wrong or the type annotation is wrong.
I.e. either the usage should be something akin to:
Or the type annotation should have t.Union[t.List["CompletionItem"], t.List[str]] as its return type. I.e. the union should be on the outside, not the inside of the list.
FYI the type annotation was introduced by #1856 (0103c95), while the (current) code that converts to a list of CompletionItems was introduced by #1622 (3faede8).
The text was updated successfully, but these errors were encountered:
The declared signature of
shell_complete
does not match the way it is used:Specifically it's return type is declared as
List[Union[CompletionItem, str]]
. This means a list where any item can be either aCompletionItem
orstr
instance.Instead the code that uses it tests the type of the first member of this list and assumes every other member of the list has the same type. So either the usage is wrong or the type annotation is wrong.
I.e. either the usage should be something akin to:
Or the type annotation should have
t.Union[t.List["CompletionItem"], t.List[str]]
as its return type. I.e. the union should be on the outside, not the inside of the list.FYI the type annotation was introduced by #1856 (0103c95), while the (current) code that converts to a list of
CompletionItem
s was introduced by #1622 (3faede8).The text was updated successfully, but these errors were encountered: