pydev-cvs Mailing List for PyDev for Eclipse (Page 22)
Brought to you by:
fabioz
You can subscribe to this list here.
2004 |
Jan
|
Feb
(4) |
Mar
(48) |
Apr
(56) |
May
(64) |
Jun
(27) |
Jul
(66) |
Aug
(81) |
Sep
(148) |
Oct
(194) |
Nov
(78) |
Dec
(46) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(125) |
Feb
(126) |
Mar
(163) |
Apr
(133) |
May
(115) |
Jun
(307) |
Jul
(387) |
Aug
(417) |
Sep
(283) |
Oct
(148) |
Nov
(45) |
Dec
(53) |
2006 |
Jan
(240) |
Feb
(200) |
Mar
(267) |
Apr
(231) |
May
(245) |
Jun
(361) |
Jul
(142) |
Aug
(12) |
Sep
(210) |
Oct
(99) |
Nov
(7) |
Dec
(30) |
2007 |
Jan
(161) |
Feb
(511) |
Mar
(265) |
Apr
(74) |
May
(147) |
Jun
(151) |
Jul
(94) |
Aug
(68) |
Sep
(98) |
Oct
(144) |
Nov
(26) |
Dec
(36) |
2008 |
Jan
(98) |
Feb
(107) |
Mar
(199) |
Apr
(113) |
May
(119) |
Jun
(112) |
Jul
(92) |
Aug
(71) |
Sep
(101) |
Oct
(16) |
Nov
|
Dec
|
From: Fabio Z. <fa...@us...> - 2008-04-13 16:55:13
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13464/src/org/python/pydev/debug/ui Modified Files: InterpreterTab.java Log Message: Better error message when launch config is not valid. Index: InterpreterTab.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/InterpreterTab.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InterpreterTab.java 9 Mar 2008 14:27:59 -0000 1.2 --- InterpreterTab.java 13 Apr 2008 16:55:18 -0000 1.3 *************** *** 29,32 **** --- 29,33 ---- import org.python.pydev.core.docutils.WordUtils; import org.python.pydev.debug.core.Constants; + import org.python.pydev.debug.ui.launching.InvalidRunException; import org.python.pydev.debug.ui.launching.PythonRunnerConfig; import org.python.pydev.plugin.PydevPlugin; *************** *** 88,93 **** * @return a PythonRunnerConfig configured with the given launch configuration * @throws CoreException */ ! private PythonRunnerConfig getConfig(ILaunchConfiguration configuration, ILaunchConfigurationDialog launchConfigurationDialog) throws CoreException { String run; if (fInterpreterManager.isJython()) { --- 89,95 ---- * @return a PythonRunnerConfig configured with the given launch configuration * @throws CoreException + * @throws InvalidRunException */ ! private PythonRunnerConfig getConfig(ILaunchConfiguration configuration, ILaunchConfigurationDialog launchConfigurationDialog) throws CoreException, InvalidRunException { String run; if (fInterpreterManager.isJython()) { |
From: Fabio Z. <fa...@us...> - 2008-04-12 20:15:14
|
Update of /cvsroot/pydev/org.python.pydev.debug/pysrc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32518/pysrc Modified Files: pydevd_frame.py Log Message: Backward compatibility of old jython versions. Index: pydevd_frame.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/pydevd_frame.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** pydevd_frame.py 12 Apr 2008 18:09:10 -0000 1.25 --- pydevd_frame.py 12 Apr 2008 20:15:17 -0000 1.26 *************** *** 57,61 **** curr_func_name = '' ! for _b, condition, func_name in breakpoint.itervalues(): #will match either global or some function if func_name in ('None', curr_func_name): --- 57,61 ---- curr_func_name = '' ! for _b, condition, func_name in breakpoint.values(): #jython does not support itervalues() #will match either global or some function if func_name in ('None', curr_func_name): |
From: Fabio Z. <fa...@us...> - 2008-04-12 19:51:20
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23451 Modified Files: Changes.txt Log Message: Launching: The default launch with Ctrl+F11 will not ask again for the launch associated with a file http://sourceforge.net/tracker/index.php?func=detail&aid=1929696&group_id=85796&atid=577329 Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.371 retrieving revision 1.372 diff -C2 -d -r1.371 -r1.372 *** Changes.txt 12 Apr 2008 19:09:43 -0000 1.371 --- Changes.txt 12 Apr 2008 19:51:19 -0000 1.372 *************** *** 9,12 **** --- 9,13 ---- <li>Debugger: Step over/Step return can now execute with untraced frames (much faster)</li> <li>Launching: F9 will reuse an existing launch instead of creating a new one every time</li> + <li>Launching: The default launch with Ctrl+F11 will not ask again for the launch associated with a file</li> after 1.3.14 |
From: Fabio Z. <fa...@us...> - 2008-04-12 19:51:12
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23429/src/org/python/pydev/debug/ui/launching Modified Files: AbstractLaunchShortcut.java Log Message: Launching: The default launch with Ctrl+F11 will not ask again for the launch associated with a file http://sourceforge.net/tracker/index.php?func=detail&aid=1929696&group_id=85796&atid=577329 Index: AbstractLaunchShortcut.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/AbstractLaunchShortcut.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** AbstractLaunchShortcut.java 12 Apr 2008 19:09:38 -0000 1.16 --- AbstractLaunchShortcut.java 12 Apr 2008 19:51:14 -0000 1.17 *************** *** 322,325 **** --- 322,327 ---- workingCopy.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, captureOutput); + workingCopy.setMappedResources(resource); + // Common Tab Arguments CommonTab tab = new CommonTab(); |
From: Fabio Z. <fa...@us...> - 2008-04-12 19:51:12
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/blocks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23429/src/org/python/pydev/debug/ui/blocks Modified Files: MainModuleBlock.java Log Message: Launching: The default launch with Ctrl+F11 will not ask again for the launch associated with a file http://sourceforge.net/tracker/index.php?func=detail&aid=1929696&group_id=85796&atid=577329 Index: MainModuleBlock.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/blocks/MainModuleBlock.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MainModuleBlock.java 9 Mar 2008 14:27:59 -0000 1.2 --- MainModuleBlock.java 12 Apr 2008 19:51:13 -0000 1.3 *************** *** 171,174 **** --- 171,175 ---- String value = fMainModuleText.getText().trim(); setAttribute(configuration, Constants.ATTR_LOCATION, value); + configuration.setMappedResources(new IResource[]{getMainModuleFile()}); } |
From: Fabio Z. <fa...@us...> - 2008-04-12 19:51:12
|
Update of /cvsroot/pydev/org.python.pydev.debug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23429 Modified Files: plugin.xml Log Message: Launching: The default launch with Ctrl+F11 will not ask again for the launch associated with a file http://sourceforge.net/tracker/index.php?func=detail&aid=1929696&group_id=85796&atid=577329 Index: plugin.xml =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/plugin.xml,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** plugin.xml 26 Mar 2008 01:25:38 -0000 1.74 --- plugin.xml 12 Apr 2008 19:51:14 -0000 1.75 *************** *** 198,201 **** --- 198,202 ---- </enablement> </contextualLaunch> + <configurationType id="org.python.pydev.debug.regularLaunchConfigurationType"/> </shortcut> <shortcut *************** *** 219,222 **** --- 220,224 ---- </enablement> </contextualLaunch> + <configurationType id="org.python.pydev.debug.jythonLaunchConfigurationType"/> </shortcut> <shortcut *************** *** 241,244 **** --- 243,247 ---- </enablement> </contextualLaunch> + <configurationType id="org.python.pydev.debug.coverageLaunchConfigurationType"/> </shortcut> <shortcut *************** *** 261,264 **** --- 264,268 ---- </enablement> </contextualLaunch> + <configurationType id="org.python.pydev.debug.unittestLaunchConfigurationType"/> </shortcut> <shortcut *************** *** 281,284 **** --- 285,289 ---- </enablement> </contextualLaunch> + <configurationType id="org.python.pydev.debug.jythonUnittestLaunchConfigurationType"/> </shortcut> </extension> |
From: Fabio Z. <fa...@us...> - 2008-04-12 19:09:51
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7220 Modified Files: Changes.txt Log Message: Launching: F9 will reuse an existing launch instead of creating a new one every time Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.370 retrieving revision 1.371 diff -C2 -d -r1.370 -r1.371 *** Changes.txt 12 Apr 2008 18:09:15 -0000 1.370 --- Changes.txt 12 Apr 2008 19:09:43 -0000 1.371 *************** *** 8,11 **** --- 8,12 ---- <li>Code completion: calltips context info correctly made 'bold'</li> <li>Debugger: Step over/Step return can now execute with untraced frames (much faster)</li> + <li>Launching: F9 will reuse an existing launch instead of creating a new one every time</li> after 1.3.14 |
From: Fabio Z. <fa...@us...> - 2008-04-12 19:09:43
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7211/src/org/python/pydev/debug/ui/launching Modified Files: AbstractLaunchShortcut.java Log Message: Launching: F9 will reuse an existing launch instead of creating a new one every time Index: AbstractLaunchShortcut.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/AbstractLaunchShortcut.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** AbstractLaunchShortcut.java 18 Mar 2008 17:03:01 -0000 1.15 --- AbstractLaunchShortcut.java 12 Apr 2008 19:09:38 -0000 1.16 *************** *** 183,190 **** try { ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type); ! String defaultLocation = getDefaultLocation(file); for (int i = 0; i < configs.length; i++) { String configPath = configs[i].getAttribute(Constants.ATTR_LOCATION, ""); ! if (defaultLocation.equals(configPath)) { validConfigs.add(configs[i]); } --- 183,194 ---- try { ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type); ! ! //let's see if we can find it with a location relative or not. ! String defaultLocation = getDefaultLocation(file, true); ! String defaultLocation2 = getDefaultLocation(file, false); ! for (int i = 0; i < configs.length; i++) { String configPath = configs[i].getAttribute(Constants.ATTR_LOCATION, ""); ! if (defaultLocation.equals(configPath) || defaultLocation2.equals(configPath)) { validConfigs.add(configs[i]); } *************** *** 200,204 **** * @return default string for the location field */ ! public static String getDefaultLocation(IResource[] file) { StringBuffer buffer = new StringBuffer(); --- 204,208 ---- * @return default string for the location field */ ! public static String getDefaultLocation(IResource[] file, boolean makeRelative) { StringBuffer buffer = new StringBuffer(); *************** *** 207,211 **** buffer.append("|"); } ! buffer.append(r.getRawLocation().toString()); } return buffer.toString(); --- 211,224 ---- buffer.append("|"); } ! ! String loc; ! ! if(makeRelative){ ! IStringVariableManager varManager = VariablesPlugin.getDefault().getStringVariableManager(); ! loc = makeFileRelativeToWorkspace(file, varManager); ! }else{ ! loc = r.getRawLocation().toString(); ! } ! buffer.append(loc); } return buffer.toString(); *************** *** 222,226 **** IInterpreterManager pythonInterpreterManager = getInterpreterManager(); String projName = resource[0].getProject().getName(); ! return createDefaultLaunchConfiguration(resource, getLaunchConfigurationType(), getDefaultLocation(resource), pythonInterpreterManager, projName); } --- 235,239 ---- IInterpreterManager pythonInterpreterManager = getInterpreterManager(); String projName = resource[0].getProject().getName(); ! return createDefaultLaunchConfiguration(resource, getLaunchConfigurationType(), getDefaultLocation(resource, false), //it'll be made relative later on pythonInterpreterManager, projName); } *************** *** 280,285 **** // Build the location to a path relative to the workspace_loc ! moduleFile = resource[0].getFullPath().makeRelative().toString(); ! moduleFile = varManager.generateVariableExpression("workspace_loc", moduleFile); resourceType = resource[0].getType(); }else{ --- 293,297 ---- // Build the location to a path relative to the workspace_loc ! moduleFile = makeFileRelativeToWorkspace(resource, varManager); resourceType = resource[0].getType(); }else{ *************** *** 324,327 **** --- 336,346 ---- } + private static String makeFileRelativeToWorkspace(IResource[] resource, IStringVariableManager varManager) { + String moduleFile; + moduleFile = resource[0].getFullPath().makeRelative().toString(); + moduleFile = varManager.generateVariableExpression("workspace_loc", moduleFile); + return moduleFile; + } + /** * @return the interpreter manager associated with this shortcut (may be overridden if it is not python) |
From: Fabio Z. <fa...@us...> - 2008-04-12 18:38:32
|
Update of /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/bundle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28007/src/org/python/pydev/core/bundle Modified Files: BundleUtils.java Log Message: Not using deprecated methods anymore. Index: BundleUtils.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/bundle/BundleUtils.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BundleUtils.java 14 Mar 2006 19:33:34 -0000 1.1 --- BundleUtils.java 12 Apr 2008 18:38:11 -0000 1.2 *************** *** 4,9 **** import java.net.URL; import org.eclipse.core.runtime.IPath; - import org.eclipse.core.runtime.Platform; import org.osgi.framework.Bundle; --- 4,9 ---- import java.net.URL; + import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.IPath; import org.osgi.framework.Bundle; *************** *** 12,18 **** public static File getRelative(IPath relative, Bundle bundle) { try { ! URL bundleURL = Platform.find(bundle, relative); URL fileURL; ! fileURL = Platform.asLocalURL(bundleURL); File f = new File(fileURL.getPath()); --- 12,18 ---- public static File getRelative(IPath relative, Bundle bundle) { try { ! URL bundleURL = FileLocator.find(bundle, relative, null); URL fileURL; ! fileURL = FileLocator.toFileURL(bundleURL); File f = new File(fileURL.getPath()); |
From: Fabio Z. <fa...@us...> - 2008-04-12 18:09:11
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17107 Modified Files: Changes.txt Log Message: Debugger: Step over/Step return can now execute with untraced frames (much faster) Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.369 retrieving revision 1.370 diff -C2 -d -r1.369 -r1.370 *** Changes.txt 12 Apr 2008 15:40:10 -0000 1.369 --- Changes.txt 12 Apr 2008 18:09:15 -0000 1.370 *************** *** 7,10 **** --- 7,11 ---- <li>Interactive console: backspace will also delete the selected text</li> <li>Code completion: calltips context info correctly made 'bold'</li> + <li>Debugger: Step over/Step return can now execute with untraced frames (much faster)</li> after 1.3.14 |
From: Fabio Z. <fa...@us...> - 2008-04-12 18:09:05
|
Update of /cvsroot/pydev/org.python.pydev.debug/pysrc/tests_python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17087/pysrc/tests_python Modified Files: test_debugger.py Log Message: Debugger: Step over/Step return can now execute with untraced frames (much faster) Index: test_debugger.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/tests_python/test_debugger.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_debugger.py 18 Feb 2008 17:11:48 -0000 1.12 --- test_debugger.py 12 Apr 2008 18:09:10 -0000 1.13 *************** *** 21,24 **** --- 21,25 ---- SHOW_WRITES_AND_READS = False SHOW_RESULT_STR = False + SHOW_OTHER_DEBUG_INFO = False *************** *** 86,92 **** --- 87,98 ---- def StartSocket(self): + if SHOW_WRITES_AND_READS: + print 'StartSocket' + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(('', port)) s.listen(1) + if SHOW_WRITES_AND_READS: + print 'Waiting in socket.accept()' newSock, addr = s.accept() if SHOW_WRITES_AND_READS: *************** *** 500,504 **** #run as jython args = [ ! r'D:\bin\jdk_1_5_09\bin\javaw.exe', '-classpath', 'D:/bin/jython-2.2.1/jython.jar', --- 506,510 ---- #run as jython args = [ ! r'D:\bin\jdk_1_5_09\bin\java.exe', '-classpath', 'D:/bin/jython-2.2.1/jython.jar', *************** *** 514,517 **** --- 520,526 ---- ] + if SHOW_OTHER_DEBUG_INFO: + print 'executing', ' '.join(args) + process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) class ProcessReadThread(threading.Thread): *************** *** 527,542 **** processReadThread.setDaemon(True) processReadThread.start() while writerThread.isAlive(): time.sleep(.2) ! for i in range(10): ! if processReadThread.resultStr is None: ! time.sleep(.5) else: ! break else: ! writerThread.DoKill() ! if SHOW_RESULT_STR: print processReadThread.resultStr --- 536,566 ---- processReadThread.setDaemon(True) processReadThread.start() + if SHOW_OTHER_DEBUG_INFO: + print 'Both processes started' + #polls can fail (because the process may finish and the thread still not -- so, we give it some more chances to + #finish successfully). + pools_failed = 0 while writerThread.isAlive(): + if process.poll() is not None: + pools_failed += 1 time.sleep(.2) + if pools_failed == 10: + break ! if process.poll() is None: ! for i in range(10): ! if processReadThread.resultStr is None: ! time.sleep(.5) ! else: ! break else: ! writerThread.DoKill() ! else: ! if process.poll() < 0: ! self.fail("The other process exited with error code: "+str(process.poll())+" result:"+processReadThread.resultStr) ! ! if SHOW_RESULT_STR: print processReadThread.resultStr *************** *** 617,621 **** # suite = unittest.TestSuite() ! # suite.addTest(Test('testCase9')) ! unittest.TextTestRunner().run(suite) --- 641,645 ---- # suite = unittest.TestSuite() ! # suite.addTest(Test('testCase1')) ! unittest.TextTestRunner(verbosity=1).run(suite) |
From: Fabio Z. <fa...@us...> - 2008-04-12 18:09:05
|
Update of /cvsroot/pydev/org.python.pydev.debug/pysrc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17087/pysrc Modified Files: pydevd_vars.py pydevd.py pydevd_frame.py Log Message: Debugger: Step over/Step return can now execute with untraced frames (much faster) Index: pydevd.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/pydevd.py,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** pydevd.py 12 Apr 2008 16:19:50 -0000 1.92 --- pydevd.py 12 Apr 2008 18:09:10 -0000 1.93 *************** *** 616,623 **** getInternalQueue = psyco.proxy(getInternalQueue) except ImportError: ! sys.exc_clear() #don't keep the traceback if not sys.platform.startswith("java"): print >> sys.stderr, 'pydev debugger: warning: psyco not available for debugger speedups' ! def run(self, file, globals=None, locals=None): --- 616,625 ---- getInternalQueue = psyco.proxy(getInternalQueue) except ImportError: ! if hasattr(sys, 'exc_clear'): #jython does not have it ! sys.exc_clear() #don't keep the traceback (let's keep it clear for when we go to the point of executing client code) ! if not sys.platform.startswith("java"): print >> sys.stderr, 'pydev debugger: warning: psyco not available for debugger speedups' ! def run(self, file, globals=None, locals=None): *************** *** 821,825 **** import psyco except ImportError: ! sys.exc_clear() pass #that's ok, no need to mock psyco if it's not available anyways else: --- 823,828 ---- import psyco except ImportError: ! if hasattr(sys, 'exc_clear'): #jython does not have it ! sys.exc_clear() #don't keep the traceback -- clients don't want to see it pass #that's ok, no need to mock psyco if it's not available anyways else: Index: pydevd_frame.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/pydevd_frame.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** pydevd_frame.py 12 Apr 2008 16:19:51 -0000 1.24 --- pydevd_frame.py 12 Apr 2008 18:09:10 -0000 1.25 *************** *** 31,38 **** breakpoint = mainDebugger.breakpoints.get(filename) ! #print 'frame: trace_dispatch', self.base, frame.f_lineno, event, frame.f_code.co_name ! ! can_skip = info.pydev_state == STATE_RUN and info.pydev_step_stop is None \ ! and info.pydev_step_cmd is None # Let's check to see if we are in a function that has a breakpoint. If we don't have a breakpoint, --- 31,43 ---- breakpoint = mainDebugger.breakpoints.get(filename) ! ! if info.pydev_state == STATE_RUN: ! #we can skip if: ! #- we have no stop marked ! #- we should make a step return/step over and we're not in the current frame ! can_skip = (info.pydev_step_cmd is None and info.pydev_step_stop is None)\ ! or (info.pydev_step_cmd in (CMD_STEP_RETURN, CMD_STEP_OVER) and info.pydev_step_stop is not frame) ! else: ! can_skip = False # Let's check to see if we are in a function that has a breakpoint. If we don't have a breakpoint, *************** *** 63,67 **** #We may have hit a breakpoint or we are already in step mode. Either way, let's check what we should do in this frame ! #print 'NOT skipped', base, frame.f_lineno, info.pydev_state, info.pydev_step_stop, info.pydev_step_cmd --- 68,72 ---- #We may have hit a breakpoint or we are already in step mode. Either way, let's check what we should do in this frame ! #print 'NOT skipped', frame.f_lineno, frame.f_code.co_name *************** *** 109,117 **** elif info.pydev_step_cmd == CMD_STEP_OVER: ! stop = info.pydev_step_stop == frame and event in ('line', 'return') elif info.pydev_step_cmd == CMD_STEP_RETURN: ! stop = event == 'return' and info.pydev_step_stop == frame else: --- 114,122 ---- elif info.pydev_step_cmd == CMD_STEP_OVER: ! stop = info.pydev_step_stop is frame and event in ('line', 'return') elif info.pydev_step_cmd == CMD_STEP_RETURN: ! stop = event == 'return' and info.pydev_step_stop is frame else: *************** *** 152,155 **** trace_dispatch = psyco.proxy(trace_dispatch) except ImportError: ! sys.exc_clear() #don't keep the traceback pass #ok, psyco not available --- 157,161 ---- trace_dispatch = psyco.proxy(trace_dispatch) except ImportError: ! if hasattr(sys, 'exc_clear'): #jython does not have it ! sys.exc_clear() #don't keep the traceback pass #ok, psyco not available Index: pydevd_vars.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/pydevd_vars.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** pydevd_vars.py 12 Apr 2008 16:19:50 -0000 1.44 --- pydevd_vars.py 12 Apr 2008 18:09:10 -0000 1.45 *************** *** 157,161 **** varToXML = psyco.proxy(varToXML) except ImportError: ! sys.exc_clear() #don't keep the traceback --- 157,162 ---- varToXML = psyco.proxy(varToXML) except ImportError: ! if hasattr(sys, 'exc_clear'): #jython does not have it ! sys.exc_clear() #don't keep the traceback -- clients don't want to see it |
From: Fabio Z. <fa...@us...> - 2008-04-12 16:19:47
|
Update of /cvsroot/pydev/org.python.pydev.debug/pysrc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8149/pysrc Modified Files: pydevd_vars.py pydevd.py pydevd_constants.py pydevd_frame.py pydevd_comm.py Log Message: sys.exc_clear() used if ImportError is found while looking for psyco. http://sourceforge.net/tracker/index.php?func=detail&aid=1938529&group_id=85796&atid=577329 Index: pydevd.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/pydevd.py,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** pydevd.py 6 Mar 2008 11:33:03 -0000 1.91 --- pydevd.py 12 Apr 2008 16:19:50 -0000 1.92 *************** *** 2,7 **** from pydevd_constants import * #@UnusedWildImport - import sys - from pydevd_comm import CMD_CHANGE_VARIABLE,\ CMD_EVALUATE_EXPRESSION,\ --- 2,5 ---- *************** *** 618,621 **** --- 616,620 ---- getInternalQueue = psyco.proxy(getInternalQueue) except ImportError: + sys.exc_clear() #don't keep the traceback if not sys.platform.startswith("java"): print >> sys.stderr, 'pydev debugger: warning: psyco not available for debugger speedups' *************** *** 816,820 **** usage(1) ! #as to get here all our imports are already resovled, the psyco module can be #changed and we'll still get the speedups in the debugger, as those functions #are already compiled at this time. --- 815,819 ---- usage(1) ! #as to get here all our imports are already resolved, the psyco module can be #changed and we'll still get the speedups in the debugger, as those functions #are already compiled at this time. *************** *** 822,825 **** --- 821,825 ---- import psyco except ImportError: + sys.exc_clear() pass #that's ok, no need to mock psyco if it's not available anyways else: Index: pydevd_frame.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/pydevd_frame.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** pydevd_frame.py 18 Feb 2008 17:11:48 -0000 1.23 --- pydevd_frame.py 12 Apr 2008 16:19:51 -0000 1.24 *************** *** 152,154 **** --- 152,155 ---- trace_dispatch = psyco.proxy(trace_dispatch) except ImportError: + sys.exc_clear() #don't keep the traceback pass #ok, psyco not available Index: pydevd_comm.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/pydevd_comm.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** pydevd_comm.py 16 Feb 2008 23:37:35 -0000 1.39 --- pydevd_comm.py 12 Apr 2008 16:19:51 -0000 1.40 *************** *** 57,61 **** import time - import sys import threading import Queue as PydevQueue --- 57,60 ---- Index: pydevd_vars.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/pydevd_vars.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** pydevd_vars.py 18 Mar 2008 02:55:03 -0000 1.43 --- pydevd_vars.py 12 Apr 2008 16:19:50 -0000 1.44 *************** *** 157,161 **** varToXML = psyco.proxy(varToXML) except ImportError: ! pass --- 157,161 ---- varToXML = psyco.proxy(varToXML) except ImportError: ! sys.exc_clear() #don't keep the traceback Index: pydevd_constants.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/pydevd_constants.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pydevd_constants.py 18 Mar 2008 02:55:03 -0000 1.11 --- pydevd_constants.py 12 Apr 2008 16:19:51 -0000 1.12 *************** *** 25,29 **** #Hold a reference to the original _getframe (because psyco will change that as soon as it's imported) ! import sys GetFrame = sys._getframe --- 25,29 ---- #Hold a reference to the original _getframe (because psyco will change that as soon as it's imported) ! import sys #Note: the sys import must be here anyways (others depend on it) GetFrame = sys._getframe |
From: Fabio Z. <fa...@us...> - 2008-04-12 15:41:12
|
Update of /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26511/src_completions/org/python/pydev/editor/codecompletion Modified Files: PyContextInformationValidator.java Log Message: removed prints Index: PyContextInformationValidator.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/PyContextInformationValidator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyContextInformationValidator.java 12 Apr 2008 15:40:09 -0000 1.3 --- PyContextInformationValidator.java 12 Apr 2008 15:41:17 -0000 1.4 *************** *** 48,52 **** */ public void install(IContextInformation info, IDocument doc, int offset) { - System.out.println("Install"); this.returnedFalseOnce = false; this.fInformation = (PyCalltipsContextInformation) info; --- 48,51 ---- *************** *** 68,72 **** */ public boolean isContextInformationValid(int position) { - System.out.println("isContextInformationValid:" + position); if (doc == null) { this.returnedFalseOnce = true; --- 67,70 ---- *************** *** 110,114 **** */ public boolean updatePresentation(int position, TextPresentation presentation) { - System.out.println("updatePresentation: " + position); int currentParameter = -1; --- 108,111 ---- *************** *** 119,123 **** } - System.out.println("updatePresentation: current param: " + currentParameter); if (fCurrentParameter != -1) { if (currentParameter == fCurrentParameter) { --- 116,119 ---- |
From: Fabio Z. <fa...@us...> - 2008-04-12 15:40:05
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25756 Modified Files: Changes.txt Log Message: - Interactive console: backspace will also delete the selected text - Code completion: calltips context info correctly made 'bold' Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.368 retrieving revision 1.369 diff -C2 -d -r1.368 -r1.369 *** Changes.txt 12 Apr 2008 13:04:09 -0000 1.368 --- Changes.txt 12 Apr 2008 15:40:10 -0000 1.369 *************** *** 5,8 **** --- 5,10 ---- <li>Interactive console: help() works</li> <li>Interactive console: context information showing in completions</li> + <li>Interactive console: backspace will also delete the selected text</li> + <li>Code completion: calltips context info correctly made 'bold'</li> after 1.3.14 |
From: Fabio Z. <fa...@us...> - 2008-04-12 15:40:05
|
Update of /cvsroot/pydev/org.python.pydev/src_dltk_console/org/python/pydev/dltk/console/ui/internal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25756/src_dltk_console/org/python/pydev/dltk/console/ui/internal Modified Files: ScriptConsoleViewer.java Log Message: - Interactive console: backspace will also delete the selected text - Code completion: calltips context info correctly made 'bold' Index: ScriptConsoleViewer.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_dltk_console/org/python/pydev/dltk/console/ui/internal/ScriptConsoleViewer.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ScriptConsoleViewer.java 6 Apr 2008 19:51:34 -0000 1.18 --- ScriptConsoleViewer.java 12 Apr 2008 15:40:10 -0000 1.19 *************** *** 17,20 **** --- 17,21 ---- import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IDocumentListener; + import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.text.contentassist.ContentAssistEvent; import org.eclipse.jface.text.contentassist.ICompletionListener; *************** *** 277,281 **** case ST.DELETE_PREVIOUS: ! handleBackspaceAction.execute(getDocument(), getCaretOffset(), getCommandLineOffset()); return; --- 278,282 ---- case ST.DELETE_PREVIOUS: ! handleBackspaceAction.execute(getDocument(), (ITextSelection) ScriptConsoleViewer.this.getSelection(), getCommandLineOffset()); return; |
From: Fabio Z. <fa...@us...> - 2008-04-12 15:40:05
|
Update of /cvsroot/pydev/org.python.pydev/src_dltk_console/org/python/pydev/dltk/console/ui/internal/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25756/src_dltk_console/org/python/pydev/dltk/console/ui/internal/actions Modified Files: HandleBackspaceAction.java Log Message: - Interactive console: backspace will also delete the selected text - Code completion: calltips context info correctly made 'bold' Index: HandleBackspaceAction.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_dltk_console/org/python/pydev/dltk/console/ui/internal/actions/HandleBackspaceAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HandleBackspaceAction.java 19 Mar 2008 19:59:21 -0000 1.1 --- HandleBackspaceAction.java 12 Apr 2008 15:40:10 -0000 1.2 *************** *** 2,5 **** --- 2,6 ---- import org.eclipse.jface.text.IDocument; + import org.eclipse.jface.text.ITextSelection; import org.python.pydev.core.docutils.PySelection; import org.python.pydev.editor.actions.PyBackspace; *************** *** 12,21 **** public class HandleBackspaceAction { ! public void execute(IDocument doc, int caretPosition, int commandLineOffset) { PyBackspace pyBackspace = new PyBackspace(); pyBackspace.setDontEraseMoreThan(commandLineOffset); ! PySelection ps = new PySelection(doc, caretPosition); pyBackspace.perform(ps); --- 13,22 ---- public class HandleBackspaceAction { ! public void execute(IDocument doc, ITextSelection selection, int commandLineOffset) { PyBackspace pyBackspace = new PyBackspace(); pyBackspace.setDontEraseMoreThan(commandLineOffset); ! PySelection ps = new PySelection(doc, selection); pyBackspace.perform(ps); |
Update of /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25756/src_completions/org/python/pydev/editor/codecompletion Modified Files: PyCalltipsContextInformation.java AbstractPyCodeCompletion.java PyContextInformationValidator.java Log Message: - Interactive console: backspace will also delete the selected text - Code completion: calltips context info correctly made 'bold' Index: PyCalltipsContextInformation.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/PyCalltipsContextInformation.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyCalltipsContextInformation.java 12 Apr 2008 13:04:08 -0000 1.3 --- PyCalltipsContextInformation.java 12 Apr 2008 15:40:09 -0000 1.4 *************** *** 12,47 **** ! /** The name of the context. */ ! private final String fContextDisplayString; ! /** The information to be displayed. */ ! private final String fInformationDisplayString; ! /** The image to be displayed. */ private final Image fImage; ! /** * Creates a new context information without an image. * ! * @param contextDisplayString the string to be used when presenting the context ! * @param informationDisplayString the string to be displayed when presenting the context information */ ! public PyCalltipsContextInformation(String contextDisplayString, String informationDisplayString) { ! this(null, contextDisplayString, informationDisplayString); } /** * Creates a new context information with an image. * * @param image the image to display when presenting the context information ! * @param contextDisplayString the string to be used when presenting the context ! * @param informationDisplayString the string to be displayed when presenting the context information, ! * may not be <code>null</code> */ ! public PyCalltipsContextInformation(Image image, String contextDisplayString, String informationDisplayString) { ! ! Assert.isNotNull(informationDisplayString); fImage= image; ! fContextDisplayString= contextDisplayString; ! fInformationDisplayString= informationDisplayString; } --- 12,60 ---- ! /** ! * The arguments to be displayed. ! */ ! private final String argumentsWithParens; ! ! /** ! * The information to be displayed (calculated when requested) ! */ ! private String argumentsWithoutParens; ! ! /** ! * The image to be displayed. ! */ private final Image fImage; ! ! /** ! * The place where the replacement started. ! */ ! private int fReplacementOffset; ! /** * Creates a new context information without an image. * ! * @param argumentsWithParens the arguments available. ! * @param replacementOffset the offset where the replacement for the arguments started (the place right after the ! * parenthesis start) */ ! public PyCalltipsContextInformation(String arguments, int replacementOffset) { ! this(null, arguments, replacementOffset); } + /** * Creates a new context information with an image. * * @param image the image to display when presenting the context information ! * @param argumentsWithParens the arguments available. ! * @param replacementOffset the offset where the replacement started */ ! public PyCalltipsContextInformation(Image image, String argumentsWithParens, int replacementOffset) { ! Assert.isNotNull(argumentsWithParens); fImage= image; ! this.argumentsWithParens = argumentsWithParens; ! fReplacementOffset = replacementOffset; } *************** *** 50,59 **** */ public boolean equals(Object object) { ! if (object instanceof IContextInformation) { ! IContextInformation contextInformation= (IContextInformation) object; ! boolean equals= fInformationDisplayString.equalsIgnoreCase(contextInformation.getInformationDisplayString()); ! if (fContextDisplayString != null) ! equals= equals && fContextDisplayString.equalsIgnoreCase(contextInformation.getContextDisplayString()); ! return equals; } return false; --- 63,69 ---- */ public boolean equals(Object object) { ! if (object instanceof PyCalltipsContextInformation) { ! PyCalltipsContextInformation contextInformation= (PyCalltipsContextInformation) object; ! return argumentsWithParens.equalsIgnoreCase(contextInformation.argumentsWithParens); } return false; *************** *** 65,70 **** */ public int hashCode() { ! int low= fContextDisplayString != null ? fContextDisplayString.hashCode() : 0; ! return (fInformationDisplayString.hashCode() << 16) | low; } --- 75,79 ---- */ public int hashCode() { ! return argumentsWithParens.hashCode(); } *************** *** 73,77 **** */ public String getInformationDisplayString() { ! return fInformationDisplayString; } --- 82,89 ---- */ public String getInformationDisplayString() { ! if(argumentsWithoutParens == null){ ! argumentsWithoutParens = argumentsWithParens.substring(1, argumentsWithParens.length()-1); //remove the parenthesis ! } ! return argumentsWithoutParens; } *************** *** 87,93 **** */ public String getContextDisplayString() { ! if (fContextDisplayString != null) ! return fContextDisplayString; ! return fInformationDisplayString; } --- 99,108 ---- */ public String getContextDisplayString() { ! return getInformationDisplayString(); ! } ! ! ! public int getReplacementOffset() { ! return this.fReplacementOffset; } Index: PyContextInformationValidator.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/PyContextInformationValidator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyContextInformationValidator.java 13 Jun 2007 01:32:05 -0000 1.2 --- PyContextInformationValidator.java 12 Apr 2008 15:40:09 -0000 1.3 *************** *** 27,217 **** * @author Fabio */ ! public class PyContextInformationValidator implements IContextInformationValidator, IContextInformationPresenter{ public PyCalltipsContextInformation fInformation; ! public int fPosition; public IDocument doc; public int fCurrentParameter; public boolean returnedFalseOnce; ! public PyContextInformationValidator() { ! } ! //--- interface from IContextInformationValidator public void install(IContextInformation info, IDocument doc, int offset) { ! this.returnedFalseOnce = false; this.fInformation = (PyCalltipsContextInformation) info; this.doc = doc; ! ! this.fPosition =offset; ! fCurrentParameter= -1; ! //update the offset to the first parentesis ! while(offset > 0){ ! try { ! char c = doc.getChar(offset); ! if(c == '('){ ! offset++; ! break; ! } ! ! if(c == '\r' || c == '\n'){ ! return; ! } ! } catch (BadLocationException e) { ! //just ignore it -- and go with offset-1, as we did get a char > than the doc len ! } ! offset--; ! } ! if(offset != 0){ ! this.fPosition =offset; ! } } ! public void install(IContextInformation info, ITextViewer viewer, int offset) { install(info, viewer.getDocument(), offset); } - public int getCharCount(IDocument document, final int start, final int end, String increments, String decrements, boolean considerNesting) throws BadLocationException { - - Assert.isTrue((increments.length() != 0 || decrements.length() != 0) && !increments.equals(decrements)); - - final int NONE= 0; - final int BRACKET= 1; - final int BRACE= 2; - final int PAREN= 3; - final int ANGLE= 4; - - int nestingMode= NONE; - int nestingLevel= 0; - - int charCount= 0; - int offset= start; - while (offset < end) { - char curr= document.getChar(offset++); - switch (curr) { - case '#': - if (offset < end) { - // '#' comment: nothing to do anymore on this line - offset= end; - } - break; - case '"': - case '\'': - int eaten = ParsingUtils.eatLiterals(document, new StringBuffer(), offset-1)+1; - if (eaten > offset){ - offset= eaten; - } - break; - case '[': - if (considerNesting) { - if (nestingMode == BRACKET || nestingMode == NONE) { - nestingMode= BRACKET; - nestingLevel++; - } - break; - } - case ']': - if (considerNesting) { - if (nestingMode == BRACKET) - if (--nestingLevel == 0) - nestingMode= NONE; - break; - } - case '(': - if (considerNesting) { - if (nestingMode == ANGLE) { - // generics heuristic failed - nestingMode=PAREN; - nestingLevel= 1; - } - if (nestingMode == PAREN || nestingMode == NONE) { - nestingMode= PAREN; - nestingLevel++; - } - break; - } - case ')': - if (considerNesting) { - if (nestingMode == PAREN) - if (--nestingLevel == 0) - nestingMode= NONE; - break; - } - case '{': - if (considerNesting) { - if (nestingMode == ANGLE) { - // generics heuristic failed - nestingMode=BRACE; - nestingLevel= 1; - } - if (nestingMode == BRACE || nestingMode == NONE) { - nestingMode= BRACE; - nestingLevel++; - } - break; - } - case '}': - if (considerNesting) { - if (nestingMode == BRACE) - if (--nestingLevel == 0) - nestingMode= NONE; - break; - } - - default: - if (nestingLevel != 0) - continue; - - if (increments.indexOf(curr) >= 0) { - ++ charCount; - } - - if (decrements.indexOf(curr) >= 0) { - -- charCount; - } - } - } - - return charCount; - } - - /** * @see IContextInformationValidator#isContextInformationValid(int) */ public boolean isContextInformationValid(int position) { ! //System.out.println("isContextInformationValid:"+position); ! if(doc == null){ ! this.returnedFalseOnce = true; ! return false; ! } try { ! if (position < fPosition){ ! this.returnedFalseOnce = true; return false; } ! IDocument document= doc; ! IRegion line= document.getLineInformationOfOffset(fPosition); ! if (position < line.getOffset() || position >= document.getLength()){ ! this.returnedFalseOnce = true; return false; } ! boolean ret = getCharCount(document, fPosition, position, "(", ")", false) >= 0; //$NON-NLS-1$ //$NON-NLS-2$ ! if(ret == false){ ! returnedFalseOnce = true; } return ret; } catch (BadLocationException x) { ! this.returnedFalseOnce = true; return false; } catch (Exception x) { ! this.returnedFalseOnce = true; ! PydevPlugin.log(x); ! return false; } } --- 27,104 ---- * @author Fabio */ ! public class PyContextInformationValidator implements IContextInformationValidator, IContextInformationPresenter { public PyCalltipsContextInformation fInformation; ! public IDocument doc; + public int fCurrentParameter; + public boolean returnedFalseOnce; ! private int fPosition; ! /** ! * Holds the comma positions for the context information to display ! */ ! int[] commaPositions; ! ! /** ! * IContextInformationValidator ! */ public void install(IContextInformation info, IDocument doc, int offset) { ! System.out.println("Install"); ! this.returnedFalseOnce = false; this.fInformation = (PyCalltipsContextInformation) info; this.doc = doc; ! this.fPosition = fInformation.getReplacementOffset(); ! this.fCurrentParameter = -1; ! this.commaPositions = null; } ! ! /** ! * IContextInformationPresenter ! */ public void install(IContextInformation info, ITextViewer viewer, int offset) { install(info, viewer.getDocument(), offset); } /** * @see IContextInformationValidator#isContextInformationValid(int) */ public boolean isContextInformationValid(int position) { ! System.out.println("isContextInformationValid:" + position); ! if (doc == null) { ! this.returnedFalseOnce = true; ! return false; ! } try { ! if (position < fPosition) { ! this.returnedFalseOnce = true; return false; } ! IDocument document = doc; ! IRegion line = document.getLineInformationOfOffset(fPosition); ! if (position < line.getOffset() || position >= document.getLength()) { ! this.returnedFalseOnce = true; return false; } ! boolean ret = getCurrentParameter(document, fPosition, position, "(", ")", false) >= 0; //$NON-NLS-1$ //$NON-NLS-2$ ! if (ret == false) { ! returnedFalseOnce = true; } return ret; } catch (BadLocationException x) { ! this.returnedFalseOnce = true; return false; } catch (Exception x) { ! this.returnedFalseOnce = true; ! PydevPlugin.log(x); ! return false; } } *************** *** 223,245 **** */ public boolean updatePresentation(int position, TextPresentation presentation) { ! ! int currentParameter= -1; try { ! currentParameter= getCharCount(doc, fPosition, position, ",", "", true); } catch (BadLocationException x) { return false; } if (fCurrentParameter != -1) { ! if (currentParameter == fCurrentParameter) return false; } presentation.clear(); ! fCurrentParameter= currentParameter; ! String s= fInformation.getInformationDisplayString(); ! int[] commas= computeCommaPositions(s); if (commas.length - 2 < fCurrentParameter) { --- 110,134 ---- */ public boolean updatePresentation(int position, TextPresentation presentation) { ! System.out.println("updatePresentation: " + position); ! int currentParameter = -1; try { ! currentParameter = getCurrentParameter(doc, fPosition, position, ",", "", true); } catch (BadLocationException x) { return false; } + System.out.println("updatePresentation: current param: " + currentParameter); if (fCurrentParameter != -1) { ! if (currentParameter == fCurrentParameter) { return false; + } } presentation.clear(); ! fCurrentParameter = currentParameter; ! String s = fInformation.getInformationDisplayString(); ! int[] commas = computeCommaPositions(); if (commas.length - 2 < fCurrentParameter) { *************** *** 247,262 **** return true; } ! ! int start= commas[fCurrentParameter] + 1; ! int end= commas[fCurrentParameter + 1]; ! if (start > 0){ presentation.addStyleRange(new StyleRange(0, start, null, null, SWT.NORMAL)); } ! if (end > start){ presentation.addStyleRange(new StyleRange(start, end - start, null, null, SWT.BOLD)); } ! if (end < s.length()){ presentation.addStyleRange(new StyleRange(end, s.length() - end, null, null, SWT.NORMAL)); } --- 136,151 ---- return true; } ! ! int start = commas[fCurrentParameter] + 1; ! int end = commas[fCurrentParameter + 1]; ! if (start > 0) { presentation.addStyleRange(new StyleRange(0, start, null, null, SWT.NORMAL)); } ! if (end > start) { presentation.addStyleRange(new StyleRange(start, end - start, null, null, SWT.BOLD)); } ! if (end < s.length()) { presentation.addStyleRange(new StyleRange(end, s.length() - end, null, null, SWT.NORMAL)); } *************** *** 264,276 **** return true; } ! ! private int[] computeCommaPositions(String code) { ! final int length= code.length(); ! int pos= 0; ! List<Integer> positions= new ArrayList<Integer>(); ! positions.add(new Integer(-1)); ! while (pos < length && pos != -1) { ! char ch= code.charAt(pos); ! switch (ch) { case ',': positions.add(new Integer(pos)); --- 153,167 ---- return true; } ! ! private int[] computeCommaPositions() { ! if (commaPositions == null) { ! final String code = fInformation.getInformationDisplayString(); ! final int length = code.length(); ! int pos = 0; ! List<Integer> positions = new ArrayList<Integer>(); ! positions.add(new Integer(-1)); ! while (pos < length && pos != -1) { ! char ch = code.charAt(pos); ! switch (ch) { case ',': positions.add(new Integer(pos)); *************** *** 278,294 **** default: break; } ! if (pos != -1) ! pos++; } ! positions.add(new Integer(length)); ! ! int[] fields= new int[positions.size()]; ! for (int i= 0; i < fields.length; i++){ ! fields[i]= ((Integer) positions.get(i)).intValue(); } ! return fields; } } - --- 169,302 ---- default: break; + } + if (pos != -1) + pos++; } ! positions.add(new Integer(length)); ! ! int[] fields = new int[positions.size()]; ! for (int i = 0; i < fields.length; i++) { ! fields[i] = ((Integer) positions.get(i)).intValue(); ! } ! commaPositions = fields; } ! return commaPositions; ! } ! ! /** ! * ! * @param document the document from where the contents should be gotten. ! * @param start ! * @param end ! * @param increments this is the string that when found will increment the current parameter ! * @param decrements this is the string that when found will decrement the current parameter ! * @param considerNesting ! * @return ! * @throws BadLocationException ! */ ! public int getCurrentParameter(IDocument document, final int start, final int end, String increments, ! String decrements, boolean considerNesting) throws BadLocationException { ! ! Assert.isTrue((increments.length() != 0 || decrements.length() != 0) && !increments.equals(decrements)); ! ! final int NONE = 0; ! final int BRACKET = 1; ! final int BRACE = 2; ! final int PAREN = 3; ! final int ANGLE = 4; ! ! int nestingMode = NONE; ! int nestingLevel = 0; ! ! int charCount = 0; ! int offset = start; ! while (offset < end) { ! char curr = document.getChar(offset++); ! switch (curr) { ! case '#': ! if (offset < end) { ! // '#' comment: nothing to do anymore on this line ! offset = end; ! } ! break; ! case '"': ! case '\'': ! int eaten = ParsingUtils.eatLiterals(document, new StringBuffer(), offset - 1) + 1; ! if (eaten > offset) { ! offset = eaten; ! } ! break; ! case '[': ! if (considerNesting) { ! if (nestingMode == BRACKET || nestingMode == NONE) { ! nestingMode = BRACKET; ! nestingLevel++; ! } ! break; ! } ! case ']': ! if (considerNesting) { ! if (nestingMode == BRACKET) ! if (--nestingLevel == 0) ! nestingMode = NONE; ! break; ! } ! case '(': ! if (considerNesting) { ! if (nestingMode == ANGLE) { ! // generics heuristic failed ! nestingMode = PAREN; ! nestingLevel = 1; ! } ! if (nestingMode == PAREN || nestingMode == NONE) { ! nestingMode = PAREN; ! nestingLevel++; ! } ! break; ! } ! case ')': ! if (considerNesting) { ! if (nestingMode == PAREN) ! if (--nestingLevel == 0) ! nestingMode = NONE; ! break; ! } ! case '{': ! if (considerNesting) { ! if (nestingMode == ANGLE) { ! // generics heuristic failed ! nestingMode = BRACE; ! nestingLevel = 1; ! } ! if (nestingMode == BRACE || nestingMode == NONE) { ! nestingMode = BRACE; ! nestingLevel++; ! } ! break; ! } ! case '}': ! if (considerNesting) { ! if (nestingMode == BRACE) ! if (--nestingLevel == 0) ! nestingMode = NONE; ! break; ! } ! ! default: ! if (nestingLevel != 0) ! continue; ! ! if (increments.indexOf(curr) >= 0) { ! ++charCount; ! } ! ! if (decrements.indexOf(curr) >= 0) { ! --charCount; ! } ! } } ! ! return charCount; } } Index: AbstractPyCodeCompletion.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/AbstractPyCodeCompletion.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AbstractPyCodeCompletion.java 12 Apr 2008 13:04:08 -0000 1.8 --- AbstractPyCodeCompletion.java 12 Apr 2008 15:40:09 -0000 1.9 *************** *** 78,83 **** --- 78,86 ---- } + //that's negated so that we can use it as an integer later on (to sum it) + int notInCalltip = 1; int onApplyAction = PyCompletionProposal.ON_APPLY_DEFAULT; if(request.isInCalltip){ + notInCalltip = 0; //when we're in the calltip, we don't have to add a char '(' to the start of the context information. if(request.alreadyHasParams){ onApplyAction = PyCompletionProposal.ON_APPLY_JUST_SHOW_CTX_INFO; *************** *** 87,97 **** } } PyCalltipsContextInformation pyContextInformation = null; if(args.length() > 2){ ! String contextArgs = args.substring(1, args.length()-1); //remove the parentesis ! pyContextInformation = new PyCalltipsContextInformation(contextArgs, contextArgs); } PyCompletionProposal proposal = new PyLinkedModeCompletionProposal(name+args, ! request.documentOffset - request.qlen, request.qlen, l, element, null, pyContextInformation, priority, onApplyAction, args); --- 90,100 ---- } } + int replacementOffset = request.documentOffset - request.qlen; PyCalltipsContextInformation pyContextInformation = null; if(args.length() > 2){ ! pyContextInformation = new PyCalltipsContextInformation(args, replacementOffset+name.length()+notInCalltip); //just after the parenthesis } PyCompletionProposal proposal = new PyLinkedModeCompletionProposal(name+args, ! replacementOffset, request.qlen, l, element, null, pyContextInformation, priority, onApplyAction, args); |
From: Fabio Z. <fa...@us...> - 2008-04-12 15:40:05
|
Update of /cvsroot/pydev/org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25756/tests_completions/org/python/pydev/editor/codecompletion Modified Files: PyContextInformationValidatorTest.java Added Files: PyCalltipsContextInformationTest.java Log Message: - Interactive console: backspace will also delete the selected text - Code completion: calltips context info correctly made 'bold' --- NEW FILE: PyCalltipsContextInformationTest.java --- package org.python.pydev.editor.codecompletion; import org.eclipse.jface.text.Document; import junit.framework.TestCase; public class PyCalltipsContextInformationTest extends TestCase { protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } public void testCalltips() throws Exception { PyCalltipsContextInformation info = new PyCalltipsContextInformation("(a, b)", 7); PyContextInformationValidator validator = new PyContextInformationValidator(); Document doc = new Document("callIt(a, b)"); validator.install(info, doc, -1); assertTrue(!validator.isContextInformationValid(0)); assertTrue(!validator.isContextInformationValid(6)); assertTrue(validator.isContextInformationValid(7)); assertTrue(validator.isContextInformationValid(11)); assertTrue(!validator.isContextInformationValid(12)); doc = new Document("callIt(param1, param2"); validator.install(info, doc, -1); assertTrue(validator.isContextInformationValid(12)); } } Index: PyContextInformationValidatorTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion/PyContextInformationValidatorTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyContextInformationValidatorTest.java 25 Mar 2007 16:08:59 -0000 1.1 --- PyContextInformationValidatorTest.java 12 Apr 2008 15:40:09 -0000 1.2 *************** *** 17,23 **** public void testIt() throws Exception { PyContextInformationValidator validator = new PyContextInformationValidator(); ! assertEquals(1, validator.getCharCount(new Document("m1(a,b)\n"), 3, 5, ",", "", true)); ! assertEquals(1, validator.getCharCount(new Document("m1('',b)\n"), 3, 6, ",", "", true)); ! assertEquals(1, validator.getCharCount(new Document("m1('''(''',b)\n"), 3, 11, ",", "", true)); } --- 17,23 ---- public void testIt() throws Exception { PyContextInformationValidator validator = new PyContextInformationValidator(); ! assertEquals(1, validator.getCurrentParameter(new Document("m1(a,b)\n"), 3, 5, ",", "", true)); ! assertEquals(1, validator.getCurrentParameter(new Document("m1('',b)\n"), 3, 6, ",", "", true)); ! assertEquals(1, validator.getCurrentParameter(new Document("m1('''(''',b)\n"), 3, 11, ",", "", true)); } |
From: Fabio Z. <fa...@us...> - 2008-04-12 15:39:53
|
Update of /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25721/src_console/org/python/pydev/debug/newconsole Modified Files: PydevConsoleCompletionProcessor.java PydevConsoleCommunication.java Log Message: - Interactive console: backspace will also delete the selected text - Code completion: calltips context info correctly made 'bold' Index: PydevConsoleCompletionProcessor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/PydevConsoleCompletionProcessor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PydevConsoleCompletionProcessor.java 4 Apr 2008 02:54:42 -0000 1.4 --- PydevConsoleCompletionProcessor.java 12 Apr 2008 15:39:58 -0000 1.5 *************** *** 2,11 **** import org.eclipse.jface.text.ITextViewer; - import org.eclipse.jface.text.TextPresentation; import org.eclipse.jface.text.contentassist.ContentAssistEvent; import org.eclipse.jface.text.contentassist.ICompletionListener; import org.eclipse.jface.text.contentassist.ICompletionProposal; import org.eclipse.jface.text.contentassist.IContextInformation; - import org.eclipse.jface.text.contentassist.IContextInformationPresenter; import org.eclipse.jface.text.contentassist.IContextInformationValidator; import org.python.pydev.dltk.console.IScriptConsoleShell; --- 2,9 ---- *************** *** 13,16 **** --- 11,15 ---- import org.python.pydev.editor.codecompletion.AbstractCompletionProcessorWithCycling; import org.python.pydev.editor.codecompletion.PyContentAssistant; + import org.python.pydev.editor.codecompletion.PyContextInformationValidator; import org.python.pydev.editor.codecompletion.PythonCompletionProcessor; import org.python.pydev.editor.simpleassist.SimpleAssistProcessor; *************** *** 24,48 **** public class PydevConsoleCompletionProcessor extends AbstractCompletionProcessorWithCycling implements ICompletionListener { - /** - * Checks to see if the context information is valid. - */ - protected static class Validator implements IContextInformationValidator, IContextInformationPresenter { - - protected int installOffset; - - public boolean isContextInformationValid(int offset) { - return Math.abs(installOffset - offset) < 5; - } ! public void install(IContextInformation info, ITextViewer viewer, int offset) { ! installOffset = offset; ! } ! ! public boolean updatePresentation(int documentPosition, TextPresentation presentation) { ! return false; ! } ! } ! ! private IContextInformationValidator validator; private IScriptConsoleShell interpreterShell; private String errorMessage = null; --- 23,33 ---- public class PydevConsoleCompletionProcessor extends AbstractCompletionProcessorWithCycling implements ICompletionListener { ! /** ! * This is the class that manages the context information (validates it and ! * changes its presentation). ! */ ! private PyContextInformationValidator contextInformationValidator; ! private IScriptConsoleShell interpreterShell; private String errorMessage = null; *************** *** 111,119 **** public IContextInformationValidator getContextInformationValidator() { ! if (validator == null) { ! validator = new Validator(); } ! return validator; } --- 96,104 ---- public IContextInformationValidator getContextInformationValidator() { ! if (contextInformationValidator == null) { ! contextInformationValidator = new PyContextInformationValidator(); } ! return contextInformationValidator; } Index: PydevConsoleCommunication.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/PydevConsoleCommunication.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PydevConsoleCommunication.java 12 Apr 2008 13:04:01 -0000 1.8 --- PydevConsoleCommunication.java 12 Apr 2008 15:39:58 -0000 1.9 *************** *** 330,341 **** } PyCalltipsContextInformation pyContextInformation = null; if(args.length() > 2){ ! String contextArgs = args.substring(1, args.length()-1); //remove the parentesis ! pyContextInformation = new PyCalltipsContextInformation(contextArgs, contextArgs); } ! ret.add(new PyLinkedModeCompletionProposal(nameAndArgs, ! offset-length, length, cursorPos, PyCodeCompletionImages.getImageForType(type), nameAndArgs, pyContextInformation, docStr, priority, PyCompletionProposal.ON_APPLY_DEFAULT, args, false)); --- 330,341 ---- } + int replacementOffset = offset-length; PyCalltipsContextInformation pyContextInformation = null; if(args.length() > 2){ ! pyContextInformation = new PyCalltipsContextInformation(args, replacementOffset+name.length()+1); //just after the parenthesis } ! ret.add(new PyLinkedModeCompletionProposal(nameAndArgs, ! replacementOffset, length, cursorPos, PyCodeCompletionImages.getImageForType(type), nameAndArgs, pyContextInformation, docStr, priority, PyCompletionProposal.ON_APPLY_DEFAULT, args, false)); |
From: Fabio Z. <fa...@us...> - 2008-04-12 13:04:10
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31230 Modified Files: Changes.txt Log Message: Context information being shown for completions bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1939296&group_id=85796&atid=577329 Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.367 retrieving revision 1.368 diff -C2 -d -r1.367 -r1.368 *** Changes.txt 12 Apr 2008 12:08:00 -0000 1.367 --- Changes.txt 12 Apr 2008 13:04:09 -0000 1.368 *************** *** 4,7 **** --- 4,8 ---- <li>Bug fix for pydev package explorer when refreshed element parent was null</li> <li>Interactive console: help() works</li> + <li>Interactive console: context information showing in completions</li> after 1.3.14 |
From: Fabio Z. <fa...@us...> - 2008-04-12 13:04:10
|
Update of /cvsroot/pydev/org.python.pydev/src_dltk_console/org/python/pydev/dltk/console/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31230/src_dltk_console/org/python/pydev/dltk/console/ui Modified Files: ScriptConsoleSourceViewerConfiguration.java Log Message: Context information being shown for completions bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1939296&group_id=85796&atid=577329 Index: ScriptConsoleSourceViewerConfiguration.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_dltk_console/org/python/pydev/dltk/console/ui/ScriptConsoleSourceViewerConfiguration.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ScriptConsoleSourceViewerConfiguration.java 6 Apr 2008 19:51:33 -0000 1.4 --- ScriptConsoleSourceViewerConfiguration.java 12 Apr 2008 13:04:08 -0000 1.5 *************** *** 11,14 **** --- 11,15 ---- import org.eclipse.jface.text.IDocument; + import org.eclipse.jface.text.IInformationControlCreator; import org.eclipse.jface.text.ITextHover; import org.eclipse.jface.text.contentassist.IContentAssistant; *************** *** 17,20 **** --- 18,22 ---- import org.eclipse.jface.text.source.SourceViewerConfiguration; import org.python.pydev.editor.autoedit.DefaultIndentPrefs; + import org.python.pydev.editor.codecompletion.PyContentAssistant; /** *************** *** 27,35 **** private ITextHover hover; ! private IContentAssistant contentAssist; private IQuickAssistAssistant quickAssist; ! public ScriptConsoleSourceViewerConfiguration(ITextHover hover, IContentAssistant contentAssist, IQuickAssistAssistant quickAssist) { this.hover = hover; this.contentAssist = contentAssist; --- 29,37 ---- private ITextHover hover; ! private PyContentAssistant contentAssist; private IQuickAssistAssistant quickAssist; ! public ScriptConsoleSourceViewerConfiguration(ITextHover hover, PyContentAssistant contentAssist, IQuickAssistAssistant quickAssist) { this.hover = hover; this.contentAssist = contentAssist; *************** *** 51,54 **** --- 53,57 ---- @Override public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { + contentAssist.setInformationControlCreator(this.getInformationControlCreator(sourceViewer)); return contentAssist; } *************** *** 56,60 **** --- 59,74 ---- @Override public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) { + quickAssist.setInformationControlCreator(this.getInformationControlCreator(sourceViewer)); return quickAssist; } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getInformationControlCreator(org.eclipse.jface.text.source.ISourceViewer) + */ + public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) { + return PyContentAssistant.createInformationControlCreator(sourceViewer); + } + } |
From: Fabio Z. <fa...@us...> - 2008-04-12 13:04:05
|
Update of /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31230/src_completions/org/python/pydev/editor/codecompletion Modified Files: PyCalltipsContextInformation.java PyContentAssistant.java AbstractPyCodeCompletion.java Log Message: Context information being shown for completions bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1939296&group_id=85796&atid=577329 Index: AbstractPyCodeCompletion.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/AbstractPyCodeCompletion.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AbstractPyCodeCompletion.java 18 Mar 2008 02:55:16 -0000 1.7 --- AbstractPyCodeCompletion.java 12 Apr 2008 13:04:08 -0000 1.8 *************** *** 90,94 **** if(args.length() > 2){ String contextArgs = args.substring(1, args.length()-1); //remove the parentesis ! pyContextInformation = new PyCalltipsContextInformation(contextArgs, contextArgs, request); } PyCompletionProposal proposal = new PyLinkedModeCompletionProposal(name+args, --- 90,94 ---- if(args.length() > 2){ String contextArgs = args.substring(1, args.length()-1); //remove the parentesis ! pyContextInformation = new PyCalltipsContextInformation(contextArgs, contextArgs); } PyCompletionProposal proposal = new PyLinkedModeCompletionProposal(name+args, Index: PyContentAssistant.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/PyContentAssistant.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyContentAssistant.java 6 Apr 2008 19:51:34 -0000 1.5 --- PyContentAssistant.java 12 Apr 2008 13:04:08 -0000 1.6 *************** *** 7,13 **** --- 7,19 ---- import org.eclipse.jface.bindings.TriggerSequence; + import org.eclipse.jface.text.DefaultInformationControl; + import org.eclipse.jface.text.IInformationControl; + import org.eclipse.jface.text.IInformationControlCreator; import org.eclipse.jface.text.contentassist.ContentAssistant; + import org.eclipse.jface.text.source.ISourceViewer; + import org.eclipse.swt.widgets.Shell; import org.python.copiedfromeclipsesrc.JDTNotAvailableException; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.editor.PyInformationPresenter; import org.python.pydev.plugin.KeyBindingHelper; import org.python.pydev.plugin.PydevPlugin; *************** *** 96,98 **** --- 102,112 ---- } + public static IInformationControlCreator createInformationControlCreator(ISourceViewer sourceViewer) { + return new IInformationControlCreator() { + public IInformationControl createInformationControl(Shell parent) { + return new DefaultInformationControl(parent, new PyInformationPresenter()); + } + }; + } + } Index: PyCalltipsContextInformation.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/PyCalltipsContextInformation.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyCalltipsContextInformation.java 30 Aug 2007 00:23:31 -0000 1.2 --- PyCalltipsContextInformation.java 12 Apr 2008 13:04:08 -0000 1.3 *************** *** 25,29 **** * @param informationDisplayString the string to be displayed when presenting the context information */ ! public PyCalltipsContextInformation(String contextDisplayString, String informationDisplayString, CompletionRequest request) { this(null, contextDisplayString, informationDisplayString); } --- 25,29 ---- * @param informationDisplayString the string to be displayed when presenting the context information */ ! public PyCalltipsContextInformation(String contextDisplayString, String informationDisplayString) { this(null, contextDisplayString, informationDisplayString); } |
From: Fabio Z. <fa...@us...> - 2008-04-12 13:04:05
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31230/src/org/python/pydev/editor Modified Files: PyEditConfiguration.java Log Message: Context information being shown for completions bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1939296&group_id=85796&atid=577329 Index: PyEditConfiguration.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyEditConfiguration.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** PyEditConfiguration.java 4 Apr 2008 02:54:50 -0000 1.56 --- PyEditConfiguration.java 12 Apr 2008 13:04:08 -0000 1.57 *************** *** 329,335 **** - // The presenter instance for the information window - private static final DefaultInformationControl.IInformationPresenter presenter = new PyInformationPresenter(); - /* * (non-Javadoc) --- 329,332 ---- *************** *** 338,346 **** */ public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) { ! return new IInformationControlCreator() { ! public IInformationControl createInformationControl(Shell parent) { ! return new DefaultInformationControl(parent, presenter); ! } ! }; } --- 335,339 ---- */ public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) { ! return PyContentAssistant.createInformationControlCreator(sourceViewer); } |
From: Fabio Z. <fa...@us...> - 2008-04-12 13:03:56
|
Update of /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30985/src_console/org/python/pydev/debug/newconsole Modified Files: PydevConsoleCommunication.java Log Message: Context information being shown for completions bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1939296&group_id=85796&atid=577329 Index: PydevConsoleCommunication.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/PydevConsoleCommunication.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PydevConsoleCommunication.java 7 Apr 2008 01:57:14 -0000 1.7 --- PydevConsoleCommunication.java 12 Apr 2008 13:04:01 -0000 1.8 *************** *** 20,23 **** --- 20,24 ---- import org.python.pydev.editor.codecompletion.AbstractPyCodeCompletion; import org.python.pydev.editor.codecompletion.IPyCompletionProposal; + import org.python.pydev.editor.codecompletion.PyCalltipsContextInformation; import org.python.pydev.editor.codecompletion.PyCodeCompletionImages; import org.python.pydev.editor.codecompletion.PyCompletionProposal; *************** *** 328,334 **** cursorPos += 1; } ret.add(new PyLinkedModeCompletionProposal(nameAndArgs, offset-length, length, cursorPos, ! PyCodeCompletionImages.getImageForType(type), nameAndArgs, null, docStr, priority, PyCompletionProposal.ON_APPLY_DEFAULT, args, false)); --- 329,342 ---- cursorPos += 1; } + + PyCalltipsContextInformation pyContextInformation = null; + if(args.length() > 2){ + String contextArgs = args.substring(1, args.length()-1); //remove the parentesis + pyContextInformation = new PyCalltipsContextInformation(contextArgs, contextArgs); + } + ret.add(new PyLinkedModeCompletionProposal(nameAndArgs, offset-length, length, cursorPos, ! PyCodeCompletionImages.getImageForType(type), nameAndArgs, pyContextInformation, docStr, priority, PyCompletionProposal.ON_APPLY_DEFAULT, args, false)); |