IPython Tab Completion Broken - ipython

I am new to using IPython 4.0.0 and I am having a problem with tab completion.
At the moment, tab completion works for navigating through my directory structure, but it doesn't work for Python modules etc. If I import numpy and type:
numpy.[tab]
then nothing shows up.
So following the advice on this question: IPython tab completion not working, I installed readline and pyreadline, but it still didn't help. Then I added this code to my startup.py file:
try:
import readline
except ImportError:
print("Module readline not available.")
else:
import rlcompleter
readline.parse_and_bind("tab: complete")
Now when I type
numpy.[tab]
it shows me a list of attributes as I would expect. However, now I can't use tab complete to navigate around my directory structure, which is incredibly frustrating. It seems that IPython is meant to have this functionality built in, so can anyone suggest how I might get it working?
Cheers

Related

vscode "applying code action organize Imports"

Currently got an annoying issue with VS and saving ts files.
every time I save a ts file I get a little popup in the bottom right telling me its "applying code action organize Imports".
I've tried uninstalled VSCode, removing all extensions, deleting the code folder in Roaming. As far as I can tell all my user settings are blank and it should be back to a clean install of VSCode. I've tried looking in the settings for something similar, even adding this to my settings.
{
"editor.codeActionsOnSave": {
"source.organizeImports": false
}
}
However, I'm still getting the same message on save and its restructuring the imports.
I've got vs code installed on another 2 machines and don't get the same issue.
Any ideas?
Turns out the folder I was opening had its own custom .vscode folder with its own settings.json which had the organizeImports setting enabled. So no matter what I did to my local settings file this one was always overriding it and nothing was showing up within VS directly.
I had forgotten to select a Python interpreter in vscode. Once I did this, the pop up on bottom right telling saying its "applying code action organize Imports" stopped appearing. This solved it for me.

VS Code Autocomplete Re-imports Package with Full Path

Every time I want to add a widget by selecting it on the autocomplete list from VS Code, let it be a Container, Column, etc., the full path is re-imported. Sometimes the autocomplete list will also show multiple lines for the same widget. import 'package:flutter/material.dart';' is already included on the file.
e.g.
import '../../../../../flutter_linux_v1.0.0-stable/flutter/packages/flutter/lib/src/widgets/framework.dart';
import '../../../../../flutter_linux_v1.0.0-stable/flutter/packages/flutter/lib/src/widgets/container.dart';
Image here: screenshot of autocomplete
It goes away if I run Flutter clean but comes right back. Any ideas to make this go away?
Which extensions are you using? Might there might be some extensions which is overriding flutters default extension behaviour.
You can run code --list-extensions from command line to get all extension installed. You can post it here so that me or someone else can help you out.

Python autocompletion in neovim using deoplete

I am trying to set up deoplete in neovim for autocompletion in python. In the screen shot below, you can see that it recognizes numpy module, but when I add "." following "np", I get no autocomplete suggestions at all. How do I debug it?
You need to wait a second for autosuggestion to pop up.
Also you can try typing some letters to narrow it down.

Pycharm 4 code autocompletion does not work in IPython

Hi I've been trying out Pycharms integrated IPython and at first the code autocompletion was working just fine, but now it stopped working.. It still works in a .py file inside the IDE but not in .ipynb files. Any idea why this would be happening?
OK by trial and error I got a fix. For some reason if you put %pylab inline or %matplolib inline in the same cell with your imports this will mess up the code autocompletion. Put %pylab in its own cell and it fixes the problem

PyCharm - autocomplete for Gtk3 magically stops working

I have this weird problem - I'm learning Gtk3 on Windows 7 with PyCharm Community 3.4.1. When I try to import Gtk:
from gi.repository import Gtk
it underlines Gtk as unresolved reference, becouse it's a binary module. Then I press Alt+Enter and choose "Generate methon stubs for binary module..." and wait until it it finishes indexing. Then I happily write this simple empty window with autocomplete working correctly:
class Okienko(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title='Okienko')
app = Okienko()
app.connect('delete-event', Gtk.main_quit)
app.show_all()
Gtk.main()
I run it, it shows me a nice empty Gtk window. So far so good.
BUT.
Bad things happen - autocomplete for Gtk module simply vanishes! from gi.repository import Gtk gets underlined red and autocomplete gives me just names which I've previously used (Window and main in this case). The only thing I can do is to Invalidate cache and restart Pycharm and go over this procedure again... I also tried .NET classes in IronPython - it's even worse, indexing takes several minutes and doesn't even finish.
In PyCharm community edition 3.4.1 (mint 17), to make Gtk3 autocompletion works:
In file: "pycharm.community-3.4.1/bin/idea.properties" comment the
line: "idea.max.intellisense.filesize=2500"
Restart the IDE
In your code: from gi.repository import Gtk strike Alt-Enter and select
"Generate stubs for binary module"
I had the same issue and found out that the Gtk.py file is too big for IDE file size limit allowed by PyCharm. I changed the config value "idea.max.intellisense.filesize" in idea.properties from 2500 to 10000. The stub generation takes some time but finishes now.
Hope that helps even Windows users. Feedback appreciated.