Re: [Pydev-code] Autocompletion using CPython only
Brought to you by:
fabioz
From: Aleks T. <a...@to...> - 2004-08-10 00:46:58
|
Hi Dana, I am one of those that does not have python in his system path. Mine is set inside .bashrc. You should use the interpreter set by the debugger, or implement an additional completion interpreter preference. My choice would be to use the debugger one, since that covers 99% case. There is also an interpreter verification routine you can use to check if interpreter is there. In my tree, PythonCompletionProcessor fails to compile: throw new CoreException(PydevPlugin.makeStatus(IStatus.ERROR, "Can't find python debug script", null)); How will autocompletion work? Will it be triggered automatically after every '.', or does user have to launch it? My preference is that user needs to act to turn it out. I am not too happy with the CPython solution, it is heavyweight, and the "python on path" problem cannot be solved nicely. Also, please before the final checking try to: - remove all the problem warnings - remove the System.out.printfs Looking forward to trying it out, Aleks PS: I just came back from a family vacation, back to hacking. Dana Moore wrote: > Hi all > I just added autocompletion using a spawned CPython interpreter only > (replaces the old jython strategy). > The affected files are: > org.python.pydev\src\org\python\pydev\editor\PyEditConfiguration.java > org.python.pydev\src\org\python\pydev\editor\PythonCompletionProcessor.java > and pretty much all the python source files. > org.python.pydev\PySrc\:: > debug.py > inspect.py > introspect.py > jintrospect.py > tipper.py > Let me know if something is a problem. > let me know if yo ulike the autocompletion style > It should sutocomplete on the occurence of '.' or '(' in the workbench > code > If there are any robustness problems. The one which I know aout > _potentially_ biting us is that I assume the existence of a Python > interpreter somewhere in the user's path, thus I don't attempt to do > full discovery of wher ethe python interpreter actually lives, rather I > simply exec the string: > "python <abs-path-of-org.python.pydev\PySrc>\tipper.py > <tmp-file-containing-the-editor-content>" > If it doesn't exist on the user path, autocmpletion simply won't work > > I plan next to do a set of CTRL-SPACE completions a la the JDT: > so for example, if the user types: iff <CTRL><SPACE> > we might emit the text (on user selection): > "if condition: > action > else: > action" |