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

Code completion in console #1175

Closed
dave-fl opened this issue Mar 21, 2016 · 6 comments
Closed

Code completion in console #1175

dave-fl opened this issue Mar 21, 2016 · 6 comments

Comments

@dave-fl
Copy link

dave-fl commented Mar 21, 2016

Having some issues with Pandas.

E.g.

import pandas as pd
df = pd.read_csv(r"C:\some_file.csv")
df.loc[:3]. <-- no code completion here.

Should be going deeper than this.

@zooba
Copy link
Member

zooba commented Mar 21, 2016

Unfortunately, without type hints (both in PTVS and in pandas), there's no way for us to figure out what will be returned. We simply don't have the information available without actually executing all of your code (which would be problematic if, say, you had code that deleted files - we wouldn't want to run that behind your back).

Hopefully with type hinting support (#82), pandas will be able to declare what type is returned from an indexing operation, or perhaps with #731 we'll just go ahead and special-case pandas (and hope that they don't change their design, or we'll be broken again).

I'm closing this as a duplicate, but it's a much wider concern for us than just one issue, so I can't point directly to a single equivalent report. We're certainly well aware that we need to improve in this area though.

@zooba zooba closed this as completed Mar 21, 2016
@dave-fl
Copy link
Author

dave-fl commented Mar 22, 2016

Just an FYI, this is within the actual Console i.e. not in the editor (although that does not work but I would not expect that it would).

iPython console is capable of completing in this case.

@zooba
Copy link
Member

zooba commented Mar 22, 2016

Ah, you're right, I misread that part.

We may disable inline evaluation for indexing, to avoid running arbitrary code too often. There's options to change the completion mode. But I believe that should only affect actual calls.

Is it possible that you're trying to get completions for an object that shouldn't have any?

@dave-fl
Copy link
Author

dave-fl commented Mar 22, 2016

No it definitely does. If I manually type in something I get results back.

If I do the exact same call in Jupyter or iPython I get auto complete results. For whatever reason the console in this case is acting differently. I tried changing the option you mentioned but for some reason it won't save. The interactive window seems to be fixed on "Never evaluate expressions containing calls".

EDIT:

I just realized something. If you configure interactive mode as "Standard" it works. If you configure as "IPython" it does not. Is there a setting that could prevent the IPython mode from working when the standard mode doesn't appear to have the issue?

@zooba
Copy link
Member

zooba commented Mar 22, 2016

I think in the latter case we let IPython provide the completions, so maybe it's returning something here that we're not handling correctly.

@zooba
Copy link
Member

zooba commented Nov 11, 2017

This is still not evaluating indexing for the sake of completions, and it appears to be a limitation of IPyKernel (does the same thing in https://notebooks.azure.com). Changing this to an enhancement request, as we'll have to bypass the processing that we're explicitly exposing in order to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants