are not suggesting... Is that normal?
Sometimes the languageserver needs an restart or one import is broken. Especially the latter happened more often for me.
I restarted the server. Still the same 😢
Its working for me after i fixed the broken imports after installing the missing dependencies or fixed them by hiding them in an try-except
I guess you didn't get my question. def test(a): a. data = [1, 2, 3] test(data) here when I type a. Do the vscode will suggest the functions of a list?
the test function is missing an annotation for this. Currently it could be an int, a string or a tuple. if you change the signature to def test(a: list): then the language server knows that only lists are accepted and provides the nessesary attributes.
Oooh okay thank you bro
No problem.
if you want an more specific type i would recommend looking at the typing module (part of the standard lib). It has generic types that can be used to describe an set consisting of floats (Set[float]) or an function argument that itself is an function (Callable).
Обсуждают сегодня