Skip to content

Auto completion doesn't show values of variables whose value is known #813

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

Closed
segevfiner opened this issue Feb 17, 2018 · 2 comments
Closed
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. feature-request Request for new features or functionality

Comments

@segevfiner
Copy link

segevfiner commented Feb 17, 2018

Environment data

VS Code version: 1.20.1
Python Extension version: 2018.1.0
Python Version: 2.7.12
OS and version: Ubuntu 16.04.3 amd64

Actual behavior

The auto completion support doesn't show the value of variables whose value is known which the autocomplete-python[-jedi] extensions for Atom does show. (The code in this extension seems copied and modified from it).

Expected behavior

It should show them like the extension for Atom does. The code in completion.py is already there. It's a matter of wiring it up into the VS Code API nicely (It's something the extension for Atom implemented and not a pure stock feature of Jedi).

Showing the values of stuff is done by this bit of code:
https://github.com/Microsoft/vscode-python/blob/fafd0f8888b8d6a9a995b8da4495c8a83d3f9a9e/pythonFiles/completion.py#L60-L70
Called from here:
https://github.com/Microsoft/vscode-python/blob/fafd0f8888b8d6a9a995b8da4495c8a83d3f9a9e/pythonFiles/completion.py#L220

It shows it on the right hand side of a completion suggestion. VS Code is calculating this but than not using this property. Only showing the doc string for the type of the completion which is what we are seeing (I think it might even be getting the doc string by itself rather than relying on Jedi).

Steps to reproduce:

  • Try auto completion for SPA below:
SPAM = 123

SPA

Screenshots

Atom

atom-autocomplete-value

VS Code

vscode-autocomplete-value

P.S. The code throws a bunch of lint warnings from a linter like flake8, and in particular ARGUMENT_RE is not defined for this bit of code:
https://github.com/Microsoft/vscode-python/blob/fafd0f8888b8d6a9a995b8da4495c8a83d3f9a9e/pythonFiles/completion.py#L254-L255
Though it's probably currently unused by this extension.

Originally: #171 (comment)

@MikhailArkhipov

@DonJayamanne
Copy link

DonJayamanne commented Feb 17, 2018

show values of variables whose value

This isn't a feature that we support today. Even if it were possible it would introduce some complexity in providing these values.

@DonJayamanne DonJayamanne added feature-request Request for new features or functionality closed-wontfix area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. labels Feb 17, 2018
@segevfiner
Copy link
Author

@DonJayamanne Are you sure? As I noted, the code for getting the value is already there... (Copied from the Atom extension apparently).

@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants