Hello.
My name is Marcelo Taube.
In my organization we use python a lot. I am in charge of the python
environment and do some tool development or installing for my users.
We have decided we will install Pydev and probably acquire a Pydev
extensions license. The environment will be heavily used inside our
company.
In spite of pydev being quite good we have decided that we need some extra
features, I think that some of the features require that I develop a plugin
extension to pydev and some other might just be solved by better
configuration. I know that some of the extensions I will write will be
insteresting to pydev and maybe you will accept a patch in the future, some
others will be too specific to my company.
This mail is to ask for some initial advise on one of the issues I am
interested.
One of the most important requirements for my users is completion according
to our needs. The problems comes from two fronts
1) In our python installation we have modules which were wrote by us in the
C language, we would like our users to get proper completion proposals.
Logically this wont work in the initial installation because pydev has not
python code to parse.
2) Sometimes we would like our users to have completion on function return
values and even concatenations like in " foo(3,4).bar([3,4],5).doit(). ".
If I am right the first problem might be solvable by just configuring the
builtin completion in pydev (right?). The second problem is not problem with
most of python code since i saw that pydev has good code analysis. However
both together are a problem since I don't think pydev is able to check the
return type of function written in C.
If there is a current solution to this i want to know. But in any case i
would like to be able to add my own completions in order to be able to fix
problems if they appear.
I think there might be two approaches, one is being able to connect to the
logical engine of pydev and suppling extra information like the return type
of some functions. The other approach would be to supply textual completions
by a separate engine.
I have not discarded the first approach but it seems to be easier to
implement the second one since i noticed that you have an extension point in
pydev to add completions participants, so i started investigating that
option.
I have studyed a little the code of pydev as a way of learning. since i have
not found material about the desing of your completion and how to extend it.
I readed the classes PyCodeCompletion, PythonCompletionProcessor,
CompletionState, CompletionRequest and most important
IPyDevCompletionParticipant.
Please correct me if i am not learning in the proper way.
I also wrote a kind of example completion participant to add some dumb
completion.
My example would always return a token for the completion 'abcdef', not
depending in the activation token. It seems that pydev correctly filters out
the completion if the activation token is not a prefix of the proposal.
Anyway, the example worked, but now I found an extra problem. PyDev would
only allow me to add completion proposals to global variables but would not
allow me to give proposals which include dots. If i return the proposal
'abcdef.ghi' and the user writes 'abcedf.' + Ctrl +Space my proposal does
not appear.
After some debugging i noticed my code is never called and after reading
what is happening in PyCodeCompletion i realized that there two distinct
cases, one for global variables and one for tokens. It seems that in the
second case contributors are never called. Is that a bug?
Thank you for your time and your answers, i hope you can help me and also
that i will be able to contribute back for this help.
An thanks to Fabio for all the completion code he wrote :)
Have a nice day,
Marcelo Taube
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
pydev-code mailing list
pydev-code@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pydev-code