pydev source helpers for indirect packages - eclipse

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.

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.

PyDev Code Completion for Shared Libraries (.so) in Linux

How do I get code completion for shared Python libraries (.so) in PyDev?
If it's just a matter of adding it to the python path, then which one and do I add the .so's directory of the full .so path? None of them seem to work although it could be because I am forced to use an old version of PyDev (if so which version introduced the funcionality)?
This should work out of the box... (and this functionality is there for many years already).
Can you post a screenshot of your pydev package explorer showing your project contents expanded up to the .so you're using as well as your editor showing where code completion is not working?

Add ttcn3 syntax highlighting to eclipse

I don't work with ttcn3 full-time, what I need is just basic syntax highlighting and commenting on Ctrl+/ added to eclipse.
After some googling I discovered Eclipse Titan, but it seems to be a full-blown IDE for ttcn3 with compiler and stuff, and I need just a plugin to eclipse.
I would like to find something like "Set syntax: ttcn3" from SublimeText, is it possible in eclipse?
if you go to this link:
https://projects.eclipse.org/projects/tools.titan/downloads
you will find that you can download the Titan plugins for Eclipse (today they look like this):
Eclipse plug-ins 6.2.0
You may want to install them in your current Eclipse and find out if that is what you are after.
Gustavo.
After installing the plugin
1.change the nature of your ttcn project for "TITAN Nature" this way:
Project popup>Properties>Project Natures>Add...>TITAN Nature.
(if this is not enough:)
2.Select Window>Preferences>TITAN Preferences>On-the-fly checker>Enable parsing of TTCN-3, ASN.1 and runtime configuration files
(You can also set perspective TITAN Editing/Titan Executing/TITAN Log Viewer)

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 "go to definition" problem

I'm using PyDev for eclipse and am experiencing some issues with "go to definition". It works for most modules, but for some site packages it does not. It does the "bump" sound and then nothing happens. One of the packages that doesn't work is Twisted, which is weird since the source is included and right there. Any idea how to fix this?
The go to definition works just fine. The problem was that eclipse didn't know where to find the source. You can go to window > preferences > pydev > interpreter > New folder, and add the folders missing. Even though you've added site-packages to the configuration, you still have to add subfolders separately to get code assist and to be able to go to the definition.
Pydev (also bundle with the Aptana distro) does not seem to have any bug exactly similar to the one you are describing.
Here is the list of bugs including the word "definition" for PyDev: bugs
You could open a bug report there with the exact version of eclipse, pydev, java used
But first:
What version of Pydev are you using? The open-source one or the commercial one (i.e. open-source + Pydev extensions)?
Because the matrix feature is quite clear:
Feature List Pydev "Open Source" Pydev Extensions
---------------------------------------------------------------
Go to definition BRM* Pydev Extensions(2)
BRM*: Bicycle Repair Man is an open-source program that provides 'go-to-definition' and refactoring. Its 'go-to-definition' only works for Python, and only works 'well' for global or local tokens (does not work very well on methods from parameters or on 'self'). It is currently 'unsupported'.
Pydev Extensions (2): Pydev extensions provides a 'go-to-definition' that works for python and jython, and should work even on methods from parameters and 'self'.