-
Notifications
You must be signed in to change notification settings - Fork 676
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
Comments
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. |
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. |
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? |
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? |
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. |
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. |
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.
The text was updated successfully, but these errors were encountered: