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

Auto complete for file/path name and pandas column name with bracket access #851

Closed
noppGithub opened this issue Jan 19, 2021 · 5 comments
Closed
Labels
enhancement New feature or request

Comments

@noppGithub
Copy link

  1. In Juypter notebook, when you are trying to read a file with command df = pd.read_csv('./myfile.csv')
    for the file name, you can just type './m then press TAB to get a list of your file that you can pick from.

  2. In Jupyter notebook, when you are typing the name of a column, e.g. you are accessing df['date_start'], while you are typing df['d then you press TAB, it's will show the option or autocomplete for you,

I think it's would be nice if we have this feature in VSCODE

@jakebailey
Copy link
Member

Both of these rely on runtime data, things we don't have access to as a static analyzer. Jupyter itself has this data in memory and should already be suggesting it. Are you not seeing these completions when using the Jupyter extension in a notebook?

@judej judej added the enhancement New feature or request label Jan 19, 2021
@github-actions github-actions bot removed the triage label Jan 19, 2021
@noppGithub
Copy link
Author

Both of these rely on runtime data, things we don't have access to as a static analyzer. Jupyter itself has this data in memory and should already be suggesting it. Are you not seeing these completions when using the Jupyter extension in a notebook?

I can't see these completions when using Jupyter in VSCODE.
I'm not sure if I use VSCODE correctly, below are my steps for this issue.

  • Create a new folder
  • Create Python virtual environment in this folder
  • Open VSCODE
  • Select Python interpreter.
  • Install pandas to the environment
  • Create a CSV file
  • Create a .ipynb file, click on it
  • Get prompt to install ipykernel
  • Press install
  • Create some codes(as shown in the images below)
  • Try to get autocompletion while pd.read_csv
  • Try to get autocompletion while typing

Reference images.

I expected to see filename autocompletion here.

I expected to see column name autocompletion here.

@jakebailey
Copy link
Member

Can you try manually triggering a completion by hitting Ctrl+Space inside of one of those strings? And is this the new or old notebook system in the Jupyter extension?

@gramster
Copy link
Member

gramster commented Mar 5, 2021

The pandas part is a dup? #102

@jakebailey
Copy link
Member

Yes, it is.

As for the file-path one, I can't find it, but I believe that's a feature request we said we weren't going to do either (as it escapes the bounds of what's reasonable in a python analyzer). For notebooks, they already handle this because jupyter has this built-in and already accesses loads of runtime data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants