Re: [Pydev-code] Autocompletion using CPython only
Brought to you by:
fabioz
From: Dana M. <dan...@ya...> - 2004-08-10 02:03:29
|
I forgot to check in PydevPlugin; sorry. It should compile fine now. --- Aleks Totic <a...@to...> wrote: > 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. > Hmmm, so are you saying that "python" doesn't work from a normal command line shell? Because if it does, then my scheme works fine. On my linux system where I dot a .bashrc, this seems to work fine. I have not tried on Mac OSX, but should be able to as soon as I take delivery of my Mac. > In my tree, PythonCompletionProcessor fails to compile: > > throw new CoreException(PydevPlugin.makeStatus(IStatus.ERROR, > "Can't find python debug script", null)); > See above comment. Should build clean now. > 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. > Right now it's on by default and can't be turned off just like in the Java IDE, the Semantic Web (SWeDe) IDE, IDLE for Python, JEdit, BOA Constructor, Komodo,( others??) I _suppose_ we could turn it off, but will anyone actually want that? Currently, we trigger on '.' and '(' and it really looks great. Actually, wrt the to "python on path" point, if a user does not have python, autocompletion will just silently not work. Further, if they do not have python, they may not be that interested in editing Python anyway. As far as the weight of this solution, It runs without any perceivable delay on my laptop, which is a a 1.8 Ghz Centrino (ecept for the built in 500 msec built in delay) Hmmm, Is there actually some preferable design solution to the need to interpret code in orde to autocomplete a runtime interpreted language? I implemented a Jython version, and that worked less nicely than we would have liked. Do you want to scrap this implementation too and reinstate that one again? > Also, please before the final checking try to: > - remove all the problem warnings > - remove the System.out.printfs > Done.The only warnings remaining in either of the files I checked in are a deprecation for "The type IAutoIndentStrategy is deprecated" I didn't implement that and I am loathe to mod that tonight, lest it break your or Fabio's code, since I think one of you must have provided that implementation. Looks like we can use (and extend) IAutoEditStrategy directly. We do have 12 other warnings, but they look like something we can fix later. > Looking forward to trying it out, > Yeah, it finally looks production quality :-) > 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" > > > > > ------------------------------------------------------- > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank > Media > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > _______________________________________________ > Pydev-code mailing list > Pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > ===== _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ _/ Dana Moore _/ _/ BBN Technologies LLC _/ _/ M: 240.350.4196 _/ _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ _______________________________ Do you Yahoo!? Express yourself with Y! Messenger! Free. Download now. http://messenger.yahoo.com |