Get Import Suggestions in IntelliJ - import

Is there a way to get a list of import suggestions in IntelliJ IDE? I'm looking for the equivalent of CTRL+SHIFT+O functionality from Eclipse, which automaticaly lists import suggestions.
Thanks!

On my current machine (on Windows), it's Ctrl-Alt-O, and the command is named "Optimize imports".
In general, in IntelliJ IDEA, you can use Ctrl-Shift-A and press part of a command to find it and know the appropriate shortcut. Typing Ctrl-Shift-A (or if you're on
a Mac ⌘-Shift-A) and then search for "import" allows finding this command easily.
That said, it seems this command doesn't suggest imports like Eclipse does.

Related

PyDev doesn't auto-complete my imported modules

I have Eclipse 4.7.3 with PyDev installed. When I import modules from another directory (or any for that matter) pydev doesn't show a warning that it can't find the import but it doesn't do autocomplete for functions within that import.
Ex import DataDefines as df and then when using it like df.INSERTFUNCTIONHERE it doesn't give any usefull suggestions for functions found in that file. When I run it, it grabs the imports fine but I want to be able to auto-complete for syntax and spelling reasons. What could be going wrong? I have configured my python interpreter which helped make the program actually run and I have modified settings in Preferences -> PyDev -> Code Completion but now I am stuck.
Are your sources under a source folder?
Have you tried following the getting started?
http://www.pydev.org/manual_101_root.html
If you're not able to figure out from that, please provide a screenshot of your pydev package explorer showing the modules you have and the actual issue on the completion.

interactive debug console for Intellij and Eclipse like Pycharm has

PyCharm has interactive debugging console:
It allows you to check various things in runtime.
I've searched for similar functionality in Eclipse and in Intellij, and couldn't find.
Does it exists there? Thanks
Eclipse has Debug shell which you can use to write custom code and execute when you are in debug mode.
In IntelliJ, you can right click on any code that is in scope of debugging, evaluate expression and in that dialog you can keep custom code and evaluate.

pydev source helpers for indirect packages

I'm using PyDev 6.0.0 under Eclipse Neon, and I find that PyDev doesn't find the source for some modules.
For example, when using wxPython, when I edit a source file that contains:
mylist = wx.ListCtrl(parent, ID)
If I hover over ListCtrl, I only see:
ListCtrl.__init__ found at wx.__init__
and in wx.init has:
# Import all items from the core wxPython module so they appear in the wx
# package namespace.
from wx.core import *
# Clean up the package namespace
del core
del wx
So, ListCtrl is really in wx.core but imported into wx.
PyDev can't provide code completion, or doc hover help, etc. etc for this kind of structure.
Is there anyway to configure around this problem?
I'm new to the wxPython library and it would really be nice to have IDE support for it.
You will almost certainly have to create stubs for it. Because wxPython is a wrapper around C++, it can be harder for some IDEs to autocomplete. I think Wingware and PyCharm work though. See the following for more information on creating stubs:
How do I fix PyDev "Undefined variable from import" errors?
I think it may be a bug in PyDev though:
Autocompletion in Pydev- Eclipse for wxpython
The bug tracker for PyDev is not very friendly, so I wasn't able to actually find a bug number for you.

how to set the interpreter of wxpython for eclipse once for all

I've Eclipse, python 2.7, wxpython 2.8, and OSx 10.5.8
I would like wxpython is included correctly in my eclipse environment, to have not all the wxpython commands underlined as errors.
I've imported in the PYTHONPATH, via preferences, the correct path of the wx library. Once I import them manually in the Eclipse, save settings, then it works.
But if i close Eclipse, and open it again, even if the interpreter have its own path of wxpython, it seems it's not recognized, and I've no autocomplete, no documentation. I need to remove and add again the same path to make everything work. It still happen after months. I guess it maybe a problem of macosx eclipse.
Do you know why?
Do you agree?
thank you in advance
I always go to Preferences / PyDev / Interpreter - Python. Then add a new interpreter, and just click Add and Apply. Wait until everything is parsed, this takes a while. Then click OK.
Change the interpreter from "Default" to your newly set-up interpreter.
Check if correct interpreter is set for your project. Right-click the project / Properties / PyDev - Interpreter/Grammar. New projects should get this by default.

Eclipse plugin for auto import java classes

Is there a plugin in eclipse that when you type 'new JavaClass' it will auto import like 'import java.class.JavaClass' just like in FlashDevelop where-in when you type 'new MovieClip' it will put automatically 'import flash.display.MovieClip' ?
Thanks.
When you type a class name without the package, invoke the Content Assist feature by pressing Ctrl+Space (on Mac, use Command+Space) and Eclipse will auto-complete it by adding an import statement. You can also use the Organize Imports shortcut (Ctrl+Shift+o or Command+Shift+o) at any time to complete and organize the imports.
If the dependent libraries locations are added to Eclipse, eclipse does that by default. There is no need for a separate plugin for it.