Skip to content
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

No intellisense for untyped **kwargs #119

Closed
russelldavis opened this issue Jul 15, 2020 · 6 comments
Closed

No intellisense for untyped **kwargs #119

russelldavis opened this issue Jul 15, 2020 · 6 comments
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@russelldavis
Copy link

Environment data

  • Language Server version: Pylance 2020.7.1
  • OS and version: macOS 10.15.5
  • Python version: 3.8

Code Snippet

def bug(**kwargs):
   # Reveals Dict[str, Unknown]
   reveal_type(kwargs)   

Expected behaviour

When typing kwargs. inside the function, intellisense should pop up the list of members.

Actual behaviour

Nothing happens.

Logs

[Info  - 3:19:46 PM] Pylance language server 2020.7.1 starting
[Info  - 3:19:46 PM] Server root directory: /Users/russell/.vscode/extensions/ms-python.vscode-pylance-2020.7.1/server
[Info  - 3:19:46 PM] Loading configuration file at /Users/russell/dev/python/exek/pyrightconfig.json
[Info  - 3:19:46 PM] Assuming Python version 3.8
[Info  - 3:19:46 PM] Assuming Python platform Darwin
[Info  - 3:19:46 PM] No include entries specified; assuming /Users/russell/dev/python/exek/pyrightconfig.json
[Info  - 3:19:46 PM] Auto-excluding **/node_modules
[Info  - 3:19:46 PM] Auto-excluding **/__pycache__
[Info  - 3:19:46 PM] Auto-excluding .git
[Info  - 3:19:46 PM] Setting pythonPath for service "exek": "/Users/russell/dev/python/exek/.venv/bin/python"
[Info  - 3:19:46 PM] stubPath /Users/russell/dev/python/exek/typings is not a valid directory.
[Info  - 3:19:46 PM] Searching for source files
[Info  - 3:19:46 PM] Auto-excluding /Users/russell/dev/python/exek/.venv
[Info  - 3:19:46 PM] Found 5 source files
[Info  - 3:19:46 PM] Background analysis root directory: /Users/russell/.vscode/extensions/ms-python.vscode-pylance-2020.7.1/server
[Info  - 3:19:46 PM] Background analysis started
[BG] analyzing: /Users/russell/dev/python/exek/exek/foo.py ...
[BG]   parsing: /Users/russell/dev/python/exek/exek/foo.py (46ms)
[BG]   parsing: /Users/russell/.vscode/extensions/ms-python.vscode-pylance-2020.7.1/server/typeshed-fallback/stdlib/2and3/builtins.pyi (100ms)
[BG]   binding: /Users/russell/.vscode/extensions/ms-python.vscode-pylance-2020.7.1/server/typeshed-fallback/stdlib/2and3/builtins.pyi (48ms)
[BG]   binding: /Users/russell/dev/python/exek/exek/foo.py (0ms)
[BG]   checking: /Users/russell/dev/python/exek/exek/foo.py ...
[BG]     parsing: /Users/russell/.vscode/extensions/ms-python.vscode-pylance-2020.7.1/server/typeshed-fallback/stdlib/3/typing.pyi (19ms)
[BG]     binding: /Users/russell/.vscode/extensions/ms-python.vscode-pylance-2020.7.1/server/typeshed-fallback/stdlib/3/typing.pyi (16ms)
[BG]   checking: /Users/russell/dev/python/exek/exek/foo.py (58ms)
[BG] analyzing: /Users/russell/dev/python/exek/exek/foo.py (254ms)
@erictraut
Copy link
Contributor

Can you elaborate what you mean by "list of member"? Are you referring to the members of the kwargs dictionary? The keys within this dictionary are unknown to a type checker. Where do you think it would get that information?

@russelldavis
Copy link
Author

russelldavis commented Jul 15, 2020

Ah sorry, no, I just mean the members of Dict itself, e.g., keys, items, setdefault, etc. The same behavior you'd see if you changed def bug(**kwargs): to def bug(**kwargs: Any):.

@erictraut erictraut added the waiting for user response Requires more information from user label Jul 15, 2020
@erictraut
Copy link
Contributor

Ah, got it. Thanks for the additional explanation. We'll look into it.

@erictraut erictraut added bug Something isn't working and removed waiting for user response Requires more information from user labels Jul 15, 2020
@erictraut
Copy link
Contributor

Thanks for the bug report. This will be fixed in the next version of Pylance/Pyright.

@erictraut erictraut added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Jul 16, 2020
@russelldavis
Copy link
Author

Wow, amazing turnaround time. You've been super helpful - thanks!

@jakebailey
Copy link
Member

This issue has been fixed in version 2020.7.3, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202073-21-july-2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

3 participants