pydev-cvs Mailing List for PyDev for Eclipse (Page 13)
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-06-28 12:35:31
|
Update of /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/javaintegration In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12157/src_completions/org/python/pydev/editor/codecompletion/revisited/javaintegration Modified Files: JavaElementToken.java JavaZipModule.java Log Message: Backwards support for Eclipse 3.2. Index: JavaElementToken.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/javaintegration/JavaElementToken.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JavaElementToken.java 14 Jun 2008 22:14:55 -0000 1.3 --- JavaElementToken.java 28 Jun 2008 12:35:38 -0000 1.4 *************** *** 4,7 **** --- 4,8 ---- import java.io.Reader; import java.io.StringReader; + import java.lang.reflect.Method; import org.eclipse.core.runtime.IProgressMonitor; *************** *** 15,18 **** --- 16,20 ---- import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.swt.graphics.Image; + import org.python.pydev.core.REF; import org.python.pydev.core.docutils.StringUtils; import org.python.pydev.core.structure.FastStringBuffer; *************** *** 37,40 **** --- 39,57 ---- private char[] completionPropsoalSignature; + /** + * Used for backward compatibility to eclipse 3.2 + */ + static boolean HAS_ADDITIONAL_FLAGS = true; + static{ + try{ + Method m = REF.findMethod(CompletionProposal.class, "getAdditionalFlags"); + if(m == null){ + HAS_ADDITIONAL_FLAGS = false; + } + }catch(Throwable e){ + HAS_ADDITIONAL_FLAGS = false; + } + } + protected JavaElementToken(String rep, String doc, String args, String parentPackage, int type, IJavaElement javaElement, int completionProposalKind, int completionProposalFlags, int completionProposalAdditionalFlags, *************** *** 50,55 **** public JavaElementToken(String rep, String doc, String args, String parentPackage, int type, IJavaElement javaElement, CompletionProposal completionProposal) { ! this(rep, doc, args, parentPackage, type, javaElement, completionProposal.getKind(), completionProposal.getFlags(), ! completionProposal.getAdditionalFlags(), completionProposal.getSignature()); } --- 67,78 ---- public JavaElementToken(String rep, String doc, String args, String parentPackage, int type, IJavaElement javaElement, CompletionProposal completionProposal) { ! super(rep, doc, args, parentPackage, type); ! this.javaElement = javaElement; ! this.completionProposalKind = completionProposal.getKind(); ! this.completionProposalFlags = completionProposal.getFlags(); ! if(HAS_ADDITIONAL_FLAGS){ ! this.completionProposalAdditionalFlags = completionProposal.getAdditionalFlags(); ! } ! this.completionPropsoalSignature = completionProposal.getSignature(); } *************** *** 61,65 **** CompletionProposal generatedProposal = CompletionProposal.create(completionProposalKind, 0); generatedProposal.setFlags(completionProposalFlags); ! generatedProposal.setAdditionalFlags(completionProposalAdditionalFlags); generatedProposal.setDeclarationSignature(completionPropsoalSignature); generatedProposal.setSignature(completionPropsoalSignature); --- 84,90 ---- CompletionProposal generatedProposal = CompletionProposal.create(completionProposalKind, 0); generatedProposal.setFlags(completionProposalFlags); ! if(HAS_ADDITIONAL_FLAGS){ ! generatedProposal.setAdditionalFlags(completionProposalAdditionalFlags); ! } generatedProposal.setDeclarationSignature(completionPropsoalSignature); generatedProposal.setSignature(completionPropsoalSignature); Index: JavaZipModule.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/javaintegration/JavaZipModule.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JavaZipModule.java 11 Jan 2008 01:01:18 -0000 1.2 --- JavaZipModule.java 28 Jun 2008 12:35:38 -0000 1.3 *************** *** 149,153 **** IClasspathEntry entries[] = getClasspathEntries(); ! ICompilationUnit unit = new WorkingCopyOwner(){}.newWorkingCopy(name, entries, new NullProgressMonitor()); unit.getBuffer().setContents(contents); CompletionProposalCollector collector = createCollector(filterCompletionName, ret, unit); --- 149,154 ---- IClasspathEntry entries[] = getClasspathEntries(); ! //Using old version for compatibility with eclipse 3.2 ! ICompilationUnit unit = new WorkingCopyOwner(){}.newWorkingCopy(name, entries, null, new NullProgressMonitor()); unit.getBuffer().setContents(contents); CompletionProposalCollector collector = createCollector(filterCompletionName, ret, unit); |
From: Fabio Z. <fa...@us...> - 2008-06-28 12:35:31
|
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-serv12157/src_dltk_console/org/python/pydev/dltk/console/ui/internal Modified Files: ScriptConsoleViewer.java Log Message: Backwards support for Eclipse 3.2. 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.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ScriptConsoleViewer.java 3 May 2008 13:20:11 -0000 1.20 --- ScriptConsoleViewer.java 28 Jun 2008 12:35:38 -0000 1.21 *************** *** 488,492 **** this.console = console; ! this.getTextWidget().setBackground(console.getBackground()); --- 488,492 ---- this.console = console; ! this.getTextWidget().setBackground(console.getPydevConsoleBackground()); |
From: Fabio Z. <fa...@us...> - 2008-06-28 12:35:31
|
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-serv12157/src_dltk_console/org/python/pydev/dltk/console/ui Modified Files: ScriptConsole.java Log Message: Backwards support for Eclipse 3.2. Index: ScriptConsole.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_dltk_console/org/python/pydev/dltk/console/ui/ScriptConsole.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ScriptConsole.java 6 Apr 2008 19:51:33 -0000 1.7 --- ScriptConsole.java 28 Jun 2008 12:35:38 -0000 1.8 *************** *** 19,26 **** --- 19,28 ---- import org.eclipse.jface.text.quickassist.IQuickAssistProcessor; import org.eclipse.jface.text.source.SourceViewerConfiguration; + import org.eclipse.swt.graphics.Color; import org.eclipse.ui.console.IConsoleDocumentPartitioner; import org.eclipse.ui.console.IConsoleView; import org.eclipse.ui.console.TextConsole; import org.eclipse.ui.part.IPageBookViewPage; + import org.python.pydev.core.REF; import org.python.pydev.dltk.console.IScriptConsoleInterpreter; import org.python.pydev.dltk.console.InterpreterResponse; *************** *** 223,225 **** --- 225,258 ---- */ public abstract String getInitialCommands(); + + + /** + * Used for backward compatibility because the setBackground/getBackground is not available for eclipse 3.2 + */ + private Color fPydevConsoleBackground; + + /** + * Used for backward compatibility because the setBackground/getBackground is not available for eclipse 3.2 + */ + public Color getPydevConsoleBackground() { + try{ + Color ret = (Color) REF.invoke(this, "getBackground"); + return ret; + }catch(Throwable e){ + //not available in eclipse 3.2 + return fPydevConsoleBackground; + } + } + + /** + * Used for backward compatibility because the setBackground/getBackground is not available for eclipse 3.2 + */ + public void setPydevConsoleBackground(Color color) { + try{ + REF.invoke(this, "setBackground", color); + }catch(Throwable e){ + //not available in eclipse 3.2 + fPydevConsoleBackground = color; + } + } } |
From: Fabio Z. <fa...@us...> - 2008-06-23 20:52:15
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24765 Modified Files: TODO.txt Log Message: Index: TODO.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/TODO.txt,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** TODO.txt 1 Jun 2008 20:44:41 -0000 1.70 --- TODO.txt 23 Jun 2008 20:52:23 -0000 1.71 *************** *** 1,2 **** --- 1,4 ---- + - Check: Context insensitive info being created twice??? (create a test case for that) + - Context insensitive completions: - Organize imports should pass all the not defined vars and show the imports available for them |
From: Fabio Z. <fa...@us...> - 2008-06-23 19:18:21
|
Update of /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator/elements In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21796/src_navigator/org/python/pydev/navigator/elements Modified Files: PythonSourceFolder.java Log Message: Fixes in the package explorer: there was a case where the item was being re-created even if it was already created in the python model. Index: PythonSourceFolder.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator/elements/PythonSourceFolder.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PythonSourceFolder.java 19 Jun 2008 15:29:46 -0000 1.4 --- PythonSourceFolder.java 23 Jun 2008 19:18:29 -0000 1.5 *************** *** 104,107 **** --- 104,113 ---- public Object getChild(IResource actualObject){ + if(actualObject == null){ + return null; + } + if(this.getActualObject().equals(actualObject)){ + return this; + } IWrappedResource ret = children.get(actualObject); //System.out.println("Gotten child:"+ret+" for resource:"+actualObject); |
From: Fabio Z. <fa...@us...> - 2008-06-23 01:20:45
|
Update of /cvsroot/pydev/org.python.pydev.parser/src/org/python/pydev/parser/fastparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27412/src/org/python/pydev/parser/fastparser Added Files: FastDefinitionsParser.java Log Message: Starting the creation of a fast way to get tokens that represent definitions -- to make the process of creating context insensitive info faster -- it's currently too slow because it relies on having the full parse to get only a part of the actually needed info. --- NEW FILE: FastDefinitionsParser.java --- package org.python.pydev.parser.fastparser; import org.python.pydev.core.docutils.ParsingUtils; /** * @note: Unfinished * * This class should be able to gather the definitions found in a module in a very fast way. * * The target is having a performance around 10x faster than doing a regular parse, focusing on getting * the name tokens for: * * classes, functions, class attributes, instance attributes -- basically the tokens that provide a * definition that can be 'globally' accessed. * * @author Fabio */ public class FastDefinitionsParser { public static void parse(String cs) { char lastChar = '\0'; int length = cs.length(); for (int i = 0; i < length; i++) { char c = cs.charAt(i); if (c == '\'' || c == '"') { //go to the end of the literal i = ParsingUtils.getLiteralEnd(cs, i, c); } else if (c == '#') { //go to the end of the comment while(i < length && (c = cs.charAt(i)) != '\n' && c != '\r'){ i++; } } else { //skip the line if (c == '\r' || c == '\n') { while(i < length && (c = cs.charAt(i)) == '\n' || c == '\r'){ i++; } } } lastChar = c; } } } |
From: Fabio Z. <fa...@us...> - 2008-06-23 01:20:45
|
Update of /cvsroot/pydev/org.python.pydev.parser/src/org/python/pydev/parser/visitors/scope In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27412/src/org/python/pydev/parser/visitors/scope Modified Files: DefinitionsASTIteratorVisitor.java Log Message: Starting the creation of a fast way to get tokens that represent definitions -- to make the process of creating context insensitive info faster -- it's currently too slow because it relies on having the full parse to get only a part of the actually needed info. Index: DefinitionsASTIteratorVisitor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.parser/src/org/python/pydev/parser/visitors/scope/DefinitionsASTIteratorVisitor.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DefinitionsASTIteratorVisitor.java 3 May 2008 16:20:07 -0000 1.8 --- DefinitionsASTIteratorVisitor.java 23 Jun 2008 01:20:53 -0000 1.9 *************** *** 12,16 **** /** ! * This class is used so that after transversing the AST, we have a simple structure for navigating * upon its nodes; * --- 12,16 ---- /** ! * This class is used so that after traversing the AST, we have a simple structure for navigating * upon its nodes; * |
From: Fabio Z. <fa...@us...> - 2008-06-23 01:20:45
|
Update of /cvsroot/pydev/org.python.pydev.parser/tests/org/python/pydev/parser/fastparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27412/tests/org/python/pydev/parser/fastparser Added Files: FastDefinitionsParserTest.java Log Message: Starting the creation of a fast way to get tokens that represent definitions -- to make the process of creating context insensitive info faster -- it's currently too slow because it relies on having the full parse to get only a part of the actually needed info. --- NEW FILE: FastDefinitionsParserTest.java --- package org.python.pydev.parser.fastparser; import junit.framework.TestCase; public class FastDefinitionsParserTest extends TestCase { protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } public static void main(String[] args) { try { FastDefinitionsParserTest test = new FastDefinitionsParserTest(); test.setUp(); test.testDefinitionsParser(); test.tearDown(); junit.textui.TestRunner.run(FastDefinitionsParserTest.class); } catch (Throwable e) { e.printStackTrace(); } } public void testDefinitionsParser() { FastDefinitionsParser.parse("class Bar:pass"); } } |
From: Fabio Z. <fa...@us...> - 2008-06-23 01:18:18
|
Update of /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/docutils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26156/src/org/python/pydev/core/docutils Modified Files: ParsingUtils.java StringUtils.java Log Message: Minors Index: ParsingUtils.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/docutils/ParsingUtils.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ParsingUtils.java 15 Jun 2008 16:45:20 -0000 1.20 --- ParsingUtils.java 23 Jun 2008 01:18:25 -0000 1.21 *************** *** 48,55 **** i++; } ! if(i < len(cs)) if(buf != null){ buf.append(charAt(cs,i)); } return i; --- 48,57 ---- i++; } ! ! if(i < len(cs)){ if(buf != null){ buf.append(charAt(cs,i)); } + } return i; Index: StringUtils.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/docutils/StringUtils.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** StringUtils.java 18 May 2008 20:02:26 -0000 1.14 --- StringUtils.java 23 Jun 2008 01:18:25 -0000 1.15 *************** *** 13,16 **** --- 13,18 ---- import javax.swing.text.html.HTMLEditorKit; + import org.python.pydev.core.structure.FastStringBuffer; + public class StringUtils { *************** *** 23,27 **** */ public static String format(String str, Object... args) { ! StringBuffer buffer = new StringBuffer(); int j = 0; --- 25,29 ---- */ public static String format(String str, Object... args) { ! FastStringBuffer buffer = new FastStringBuffer(str.length()+(16*args.length)); int j = 0; *************** *** 31,35 **** char nextC = str.charAt(i + 1); if (nextC == 's') { ! buffer.append(args[j]); j++; i++; --- 33,37 ---- char nextC = str.charAt(i + 1); if (nextC == 's') { ! buffer.append(args[j].toString()); j++; i++; *************** *** 196,200 **** char c; ! StringBuffer buf = new StringBuffer(); for (int i = 0; i < len; i++) { --- 198,202 ---- char c; ! FastStringBuffer buf = new FastStringBuffer(); for (int i = 0; i < len; i++) { *************** *** 209,217 **** } ret.add(buf.toString()); ! buf = new StringBuffer(); } if (c == '\n') { ret.add(buf.toString()); ! buf = new StringBuffer(); } --- 211,219 ---- } ret.add(buf.toString()); ! buf.clear(); } if (c == '\n') { ret.add(buf.toString()); ! buf.clear(); } *************** *** 234,238 **** public static String replaceAll(String string, String replace, String with) { ! StringBuffer ret = new StringBuffer(); int len = string.length(); int replaceLen = replace.length(); --- 236,240 ---- public static String replaceAll(String string, String replace, String with) { ! FastStringBuffer ret = new FastStringBuffer(); int len = string.length(); int replaceLen = replace.length(); *************** *** 256,260 **** public static String removeWhitespaceColumnsToLeft(String hoverInfo) { ! StringBuffer buf = new StringBuffer(); int firstCharPosition = Integer.MAX_VALUE; --- 258,262 ---- public static String removeWhitespaceColumnsToLeft(String hoverInfo) { ! FastStringBuffer buf = new FastStringBuffer(); int firstCharPosition = Integer.MAX_VALUE; |
From: Fabio Z. <fa...@us...> - 2008-06-22 09:28:59
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9722 Modified Files: Changes.txt plugin.xml Log Message: PyToggleComment: Created from patch: https://sourceforge.net/tracker/?func=detail&atid=577329&aid=1999389&group_id=85796 Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.397 retrieving revision 1.398 diff -C2 -d -r1.397 -r1.398 *** Changes.txt 19 Jun 2008 15:29:46 -0000 1.397 --- Changes.txt 21 Jun 2008 14:31:22 -0000 1.398 *************** *** 1,2 **** --- 1,9 ---- + after 1.3.18 + + Pydev + <ul> + <li><strong>Ctr+/</strong>: Changed to toggle comment (instead of only comment) -- patch from Christoph Pickl</li> + </ul> + after 1.3.17 Index: plugin.xml =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/plugin.xml,v retrieving revision 1.206 retrieving revision 1.207 diff -C2 -d -r1.206 -r1.207 *** plugin.xml 15 Jun 2008 00:45:56 -0000 1.206 --- plugin.xml 21 Jun 2008 14:31:22 -0000 1.207 *************** *** 332,335 **** --- 332,342 ---- </action> <action + definitionId="org.python.pydev.editor.actions.togglecomment" + label="Toggle Comment" + class="org.python.pydev.editor.actions.PyToggleComment" + menubarPath="org.python.pydev.editor.actions.sourceMenu/editGroup" + id="org.python.pydev.editor.actions.togglecomment"> + </action> + <action definitionId="org.python.pydev.editor.actions.removeBlockComment" label="Remove comment block" *************** *** 619,622 **** --- 626,636 ---- id="org.python.pydev.editor.actions.comment"> </command> + <!-- command: toggle comment--> + <command + name="Python Toggle Comment" + description="Toggles comments of python line/s (Adds/Removes # at beggining of the line)" + categoryId="org.python.pydev.ui.category.source" + id="org.python.pydev.editor.actions.togglecomment"> + </command> <!-- command: Go To Defition--> <command *************** *** 783,787 **** sequence="Ctrl+/" contextId="org.python.pydev.ui.editor.scope" ! commandId="org.python.pydev.editor.actions.comment" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"> </key> --- 797,801 ---- sequence="Ctrl+/" contextId="org.python.pydev.ui.editor.scope" ! commandId="org.python.pydev.editor.actions.togglecomment" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"> </key> |
From: Fabio Z. <fa...@us...> - 2008-06-22 08:34:59
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9722/src/org/python/pydev/editor/actions Modified Files: PyComment.java PyUncomment.java Added Files: PyToggleComment.java Log Message: PyToggleComment: Created from patch: https://sourceforge.net/tracker/?func=detail&atid=577329&aid=1999389&group_id=85796 --- NEW FILE: PyToggleComment.java --- package org.python.pydev.editor.actions; import org.eclipse.jface.text.BadLocationException; import org.python.pydev.core.Tuple; import org.python.pydev.core.docutils.PySelection; import org.python.pydev.core.structure.FastStringBuffer; /** * Same toggle comment action as we are used to it in the java perspective * * @author e0525580 at student.tuwien.ac.at * Created from patch: https://sourceforge.net/tracker/?func=detail&atid=577329&aid=1999389&group_id=85796 */ public class PyToggleComment extends PyComment { @Override public Tuple<Integer, Integer> perform(final PySelection ps) throws BadLocationException { ps.selectCompleteLine(); final boolean shouldAddCommentSign = PyToggleComment.allLinesStartWithCommentSign(ps) == false; String endLineDelim = ps.getEndLineDelim(); int endLineIndex = ps.getEndLineIndex(); int startLineIndex = ps.getStartLineIndex(); final FastStringBuffer sb = new FastStringBuffer(ps.getSelLength()+(endLineIndex-startLineIndex)+10); for (int i = startLineIndex, n = endLineIndex; i <= n; i++) { final String line = ps.getLine(i); if(shouldAddCommentSign) { sb.append("#"); sb.append(line); } else { // remove comment sign sb.append(line.replaceFirst("#", "")); } //add a new line if we're not in the last line. sb.append((i < endLineIndex ? endLineDelim : "")); } final int start = ps.getStartLine().getOffset(); final String replacement = sb.toString(); ps.getDoc().replace(start, ps.getSelLength(), replacement); return new Tuple<Integer, Integer>(start, replacement.length()); } /** * Checks if all lines start with '#' */ private static boolean allLinesStartWithCommentSign(final PySelection ps) { int endLineIndex = ps.getEndLineIndex(); for (int i = ps.getStartLineIndex(), n = endLineIndex; i <= n; i++) { final String line = ps.getLine(i); if(line.trim().startsWith("#") == false) { return false; } } return true; } } Index: PyComment.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyComment.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PyComment.java 14 Jun 2008 22:14:55 -0000 1.10 --- PyComment.java 21 Jun 2008 14:31:22 -0000 1.11 *************** *** 24,27 **** --- 24,28 ---- */ public class PyComment extends PyAction { + /** * Grabs the selection information and performs the action. *************** *** 59,64 **** FastStringBuffer strbuf = new FastStringBuffer(selectedText.length()+ret.size()+2); for(String line: ret){ ! strbuf.append('#'); ! strbuf.append(line); } --- 60,64 ---- FastStringBuffer strbuf = new FastStringBuffer(selectedText.length()+ret.size()+2); for(String line: ret){ ! strbuf.append('#').append(line); } Index: PyUncomment.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyUncomment.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PyUncomment.java 14 Jun 2008 22:14:55 -0000 1.9 --- PyUncomment.java 21 Jun 2008 14:31:22 -0000 1.10 *************** *** 18,23 **** /* Selection element */ - - /** * Performs the action with a given PySelection --- 18,21 ---- *************** *** 28,46 **** */ public Tuple<Integer, Integer> perform(PySelection ps) throws BadLocationException { - // What we'll be replacing the selected text with - FastStringBuffer strbuf = new FastStringBuffer(); // If they selected a partial line, count it as a full one ps.selectCompleteLine(); ! int i; ! // For each line, comment them out ! for (i = ps.getStartLineIndex(); i <= ps.getEndLineIndex(); i++) { String l = ps.getLine(i); if (l.trim().startsWith("#")) { // we may want to remove comment that are not really in the beggining... ! strbuf.append(l.replaceFirst("#", "") + (i < ps.getEndLineIndex() ? ps.getEndLineDelim() : "")); } else { ! strbuf.append(l + (i < ps.getEndLineIndex() ? ps.getEndLineDelim() : "")); } } --- 26,49 ---- */ public Tuple<Integer, Integer> perform(PySelection ps) throws BadLocationException { // If they selected a partial line, count it as a full one ps.selectCompleteLine(); + + // What we'll be replacing the selected text with + FastStringBuffer strbuf = new FastStringBuffer(ps.getSelLength()+1); //no, it won't be more that the current sel ! // For each line, uncomment it ! int endLineIndex = ps.getEndLineIndex(); ! String endLineDelim = ps.getEndLineDelim(); ! ! for (int i = ps.getStartLineIndex(); i <= endLineIndex; i++) { String l = ps.getLine(i); if (l.trim().startsWith("#")) { // we may want to remove comment that are not really in the beggining... ! strbuf.append(l.replaceFirst("#", "")); } else { ! strbuf.append(l); } + //add a new line if we're not in the last line. + strbuf.append(i < endLineIndex ? endLineDelim : ""); } *************** *** 52,65 **** } - /** - * Same as comment, but remove the first char. - */ - protected String replaceStr(String str, String endLineDelim) { - str = str.replaceAll(endLineDelim + "#", endLineDelim); - if (str.startsWith("#")) { - str = str.substring(1); - } - return str; - } - } \ No newline at end of file --- 55,57 ---- |
From: Fabio Z. <fa...@us...> - 2008-06-19 16:00:36
|
Update of /cvsroot/pydev/org.python.pydev.site In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3732 Modified Files: site.xml Log Message: Index: site.xml =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.site/site.xml,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** site.xml 12 May 2008 15:36:31 -0000 1.73 --- site.xml 19 Jun 2008 16:00:37 -0000 1.74 *************** *** 21,24 **** --- 21,30 ---- + <feature url="features/org.python.pydev.feature_1.3.18.jar" id="org.python.pydev.feature" version="1.3.18"> + <category name="Pydev"/> + </feature> + + + <feature url="features/org.python.pydev.feature_1.3.17.jar" id="org.python.pydev.feature" version="1.3.17"> <category name="Pydev"/> |
From: Fabio Z. <fa...@us...> - 2008-06-19 15:30:02
|
Update of /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24486/src_navigator/org/python/pydev/navigator Modified Files: PythonModelProvider.java Log Message: Fixes in the package explorer: there was a case where the item was being re-created even if it was already created in the python model. Index: PythonModelProvider.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator/PythonModelProvider.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PythonModelProvider.java 10 May 2008 16:29:24 -0000 1.14 --- PythonModelProvider.java 19 Jun 2008 15:29:46 -0000 1.15 *************** *** 247,250 **** --- 247,258 ---- while(found.size() > 0){ Object f = found.pop(); + if(f instanceof IResource){ + //no need to create it if it's already in the model! + Object child = sourceFolderInWrap.getChild((IResource)f); + if(child != null && child instanceof IWrappedResource){ + wrappedResource = (IWrappedResource) child; + continue; + } + } //creating is enough to add it to the model if(f instanceof IFile){ |
From: Fabio Z. <fa...@us...> - 2008-06-19 15:30:02
|
Update of /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator/elements In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24486/src_navigator/org/python/pydev/navigator/elements Modified Files: PythonSourceFolder.java Log Message: Fixes in the package explorer: there was a case where the item was being re-created even if it was already created in the python model. Index: PythonSourceFolder.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator/elements/PythonSourceFolder.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PythonSourceFolder.java 8 Sep 2007 16:36:13 -0000 1.3 --- PythonSourceFolder.java 19 Jun 2008 15:29:46 -0000 1.4 *************** *** 16,19 **** --- 16,20 ---- import org.eclipse.core.runtime.IAdaptable; import org.eclipse.ui.IContributorResourceAdapter; + import org.python.pydev.plugin.PydevPlugin; /** *************** *** 61,64 **** --- 62,80 ---- public void addChild(IWrappedResource child){ IResource actualObject = (IResource) child.getActualObject(); + + Object p = child.getParentElement(); + if(p != null && p instanceof IWrappedResource){ + IWrappedResource pWrapped = (IWrappedResource) p; + if(pWrapped.getActualObject().equals(actualObject)){ + PydevPlugin.log("Trying to add an element that has itself as parent: "+actualObject); + } + } + + //if there was already a child to the given object, remove it before adding this one. + IWrappedResource existing = children.get(actualObject); + if(existing != null){ + removeChild(actualObject); + } + children.put(actualObject, child); |
From: Fabio Z. <fa...@us...> - 2008-06-19 15:29:45
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24486 Modified Files: Changes.txt Log Message: Fixes in the package explorer: there was a case where the item was being re-created even if it was already created in the python model. Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.396 retrieving revision 1.397 diff -C2 -d -r1.396 -r1.397 *** Changes.txt 15 Jun 2008 21:05:01 -0000 1.396 --- Changes.txt 19 Jun 2008 15:29:46 -0000 1.397 *************** *** 14,20 **** <li><strong>Executing external programs</strong>: Using Runtime.exec(String[] cmdargs) instead of the version accepting only a string.</li> <li><strong>Organize Imports (ctrl+shift+O)</strong>: Imports can be grouped.</li> ! <li><strong>Cygwin</strong>: sys.executable in cygwin was not returning '.exe' in the end as it should.</li> <li><strong>Additional paths for PYTHONPATH</strong>: extension point allows plugins to contribute paths to the PYTHONPATH.</li> <li><strong>Code-completion</strong>: typing '.' won't apply the selected completion, but will still request a new one with the current contents.</li> </ul> --- 14,21 ---- <li><strong>Executing external programs</strong>: Using Runtime.exec(String[] cmdargs) instead of the version accepting only a string.</li> <li><strong>Organize Imports (ctrl+shift+O)</strong>: Imports can be grouped.</li> ! <li><strong>Cygwin</strong>: sys.executable in cygwin was not returning '.exe' in the end of the executable as it should.</li> <li><strong>Additional paths for PYTHONPATH</strong>: extension point allows plugins to contribute paths to the PYTHONPATH.</li> <li><strong>Code-completion</strong>: typing '.' won't apply the selected completion, but will still request a new one with the current contents.</li> + <li><strong>Pydev Package Explorer</strong>: Problem while trying to show active editor on the pydev package explorer.</li> </ul> |
From: Fabio Z. <fa...@us...> - 2008-06-16 00:55:32
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/codecoverage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3418/src/org/python/pydev/debug/codecoverage Modified Files: CoverageCache.java FileNode.java Log Message: Wild imports considered when organizing imports. Index: FileNode.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/codecoverage/FileNode.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FileNode.java 17 Jun 2007 13:31:30 -0000 1.5 --- FileNode.java 16 Jun 2008 00:55:38 -0000 1.6 *************** *** 11,14 **** --- 11,16 ---- import java.util.List; + import org.python.pydev.core.structure.FastStringBuffer; + /** * @author Fabio Zadrozny *************** *** 41,45 **** public static String toString(String str, int stmts, int exec, String notExecuted) { ! return getName(str) + " " +getStmts(stmts)+" "+exec+" "+calcCover(stmts, exec) +" "+notExecuted; } --- 43,56 ---- public static String toString(String str, int stmts, int exec, String notExecuted) { ! return new FastStringBuffer(). ! append(getName(str)). ! append(" "). ! append(getStmts(stmts)). ! append(" "). ! append(exec). ! append(" "). ! append(calcCover(stmts, exec)). ! append(" "). ! append(notExecuted).toString(); } *************** *** 56,75 **** public static String getStmts(int stmts){ ! String str = stmts+""; while (str.length() < 4){ ! str = " "+str; } ! return str; } public static String getExec(int exec){ ! String str = exec+""; ! while (str.length() < 4){ ! str = " "+str; ! } ! return str; } ! public static String calcCover( int stmts, int exec){ double v = 0; if(stmts != 0){ --- 67,83 ---- public static String getStmts(int stmts){ ! FastStringBuffer str = new FastStringBuffer(); ! str.append(stmts); while (str.length() < 4){ ! str.insert(0, " "); } ! return str.toString(); } public static String getExec(int exec){ ! return getStmts(exec); } ! public static String calcCover(int stmts, int exec){ double v = 0; if(stmts != 0){ Index: CoverageCache.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/codecoverage/CoverageCache.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CoverageCache.java 17 Jun 2007 13:31:30 -0000 1.5 --- CoverageCache.java 16 Jun 2008 00:55:38 -0000 1.6 *************** *** 12,15 **** --- 12,17 ---- import java.util.Map; + import org.python.pydev.core.structure.FastStringBuffer; + /** *************** *** 183,187 **** ! StringBuffer buffer = new StringBuffer(); try { List<Object> list = getFiles(node); //array of FileNode --- 185,189 ---- ! FastStringBuffer buffer = new FastStringBuffer(); try { List<Object> list = getFiles(node); //array of FileNode *************** *** 196,200 **** for (Iterator<Object> it = list.iterator(); it.hasNext();) { Object element = it.next(); ! buffer.append(element.toString()+"\n"); if(element instanceof FileNode){ //it may have been an error node... totalExecuted += ((FileNode)element).exec; --- 198,202 ---- for (Iterator<Object> it = list.iterator(); it.hasNext();) { Object element = it.next(); ! buffer.append(element.toString()).append("\n"); if(element instanceof FileNode){ //it may have been an error node... totalExecuted += ((FileNode)element).exec; *************** *** 204,208 **** buffer.append("-----------------------------------------------------------------------------\n"); ! buffer.append(FileNode.toString("TOTAL",totalStmts, totalExecuted, "")+"\n"); } catch (NodeNotFoudException e) { --- 206,210 ---- buffer.append("-----------------------------------------------------------------------------\n"); ! buffer.append(FileNode.toString("TOTAL",totalStmts, totalExecuted, "")).append("\n"); } catch (NodeNotFoudException e) { |
From: Fabio Z. <fa...@us...> - 2008-06-16 00:55:28
|
Update of /cvsroot/pydev/org.python.pydev/tests/org/python/pydev/editor/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3384/tests/org/python/pydev/editor/actions Modified Files: PyOrganizeImportsTest.java Log Message: Wild imports considered when organizing imports. Index: PyOrganizeImportsTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests/org/python/pydev/editor/actions/PyOrganizeImportsTest.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PyOrganizeImportsTest.java 14 Jun 2008 22:14:56 -0000 1.8 --- PyOrganizeImportsTest.java 16 Jun 2008 00:55:34 -0000 1.9 *************** *** 20,24 **** PyOrganizeImportsTest test = new PyOrganizeImportsTest(); test.setUp(); ! test.testPerformGroupingWithWrapsLong(); test.tearDown(); junit.textui.TestRunner.run(PyOrganizeImportsTest.class); --- 20,24 ---- PyOrganizeImportsTest test = new PyOrganizeImportsTest(); test.setUp(); ! test.testPerformWithGroupingAndWild(); test.tearDown(); junit.textui.TestRunner.run(PyOrganizeImportsTest.class); *************** *** 92,95 **** --- 92,120 ---- } + + public void testPerformWithGroupingAndWild() { + ImportsPreferencesPage.groupImportsForTests = true; + String d = ""+ + "import b\n"+ + "import a\n"+ + "\n"+ + "from a import *\n"+ + "from b import d\n"+ + "from a import b"; + + Document doc = new Document(d); + PyOrganizeImports.performArrangeImports(doc, "\n", " "); + + String result = ""+ + "from a import *\n"+ + "from b import d\n"+ + "import a\n"+ + "import b\n"+ + "\n"; + + // System.out.println(doc.get()); + assertEquals(result, doc.get()); + + } |
From: Fabio Z. <fa...@us...> - 2008-06-16 00:55:28
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3384/src/org/python/pydev/editor/actions Modified Files: PyOrganizeImports.java Log Message: Wild imports considered when organizing imports. Index: PyOrganizeImports.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyOrganizeImports.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** PyOrganizeImports.java 15 Jun 2008 13:15:10 -0000 1.18 --- PyOrganizeImports.java 16 Jun 2008 00:55:34 -0000 1.19 *************** *** 321,326 **** List<String> commentsForImports = v.getCommentsForImports(); for(int i=0;i<importedStr.size();i++){ ! String importedString = importedStr.get(i); ! String comment = commentsForImports.get(i); if(comment.length() > 0){ importsAndComments.add(new Tuple<String, String>(importedString, comment)); --- 321,331 ---- List<String> commentsForImports = v.getCommentsForImports(); for(int i=0;i<importedStr.size();i++){ ! String importedString = importedStr.get(i).trim(); ! String comment = commentsForImports.get(i).trim(); ! boolean isWildImport = importedString.equals("*"); ! if(isWildImport){ ! importsAndComments.clear(); ! importsAndNoComments.clear(); ! } if(comment.length() > 0){ importsAndComments.add(new Tuple<String, String>(importedString, comment)); *************** *** 328,331 **** --- 333,339 ---- importsAndNoComments.add(new Tuple<String, String>(importedString, comment)); } + if(isWildImport){ + return; + } } } |
From: Fabio Z. <fa...@us...> - 2008-06-15 22:59:15
|
Update of /cvsroot/pydev/org.python.pydev.parser/tests/org/python/pydev/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5921/tests/org/python/pydev/parser Modified Files: PyParserTest.java Log Message: Minor Index: PyParserTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.parser/tests/org/python/pydev/parser/PyParserTest.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** PyParserTest.java 17 Jul 2007 23:44:59 -0000 1.37 --- PyParserTest.java 15 Jun 2008 22:59:22 -0000 1.38 *************** *** 15,18 **** --- 15,19 ---- import org.python.pydev.core.Tuple3; import org.python.pydev.core.docutils.PySelection; + import org.python.pydev.core.performanceeval.Timer; import org.python.pydev.parser.jython.SimpleNode; import org.python.pydev.parser.jython.ast.ClassDef; *************** *** 31,36 **** PyParserTest test = new PyParserTest(); test.setUp(); ! test.testTryReparse(); test.tearDown(); System.out.println("Finished"); junit.textui.TestRunner.run(PyParserTest.class); --- 32,43 ---- PyParserTest test = new PyParserTest(); test.setUp(); ! ! //Timer timer = new Timer(); ! //test.parseFilesInDir(new File("D:/bin/Python251/Lib/site-packages/wx-2.8-msw-unicode"), true); ! //test.parseFilesInDir(new File("D:/bin/Python251/Lib/"), false); ! //timer.printDiff(); test.tearDown(); + + System.out.println("Finished"); junit.textui.TestRunner.run(PyParserTest.class); *************** *** 305,314 **** } /** * @param file */ ! private void parseFilesInDir(File file) { assertTrue("Directory "+file+" does not exist", file.exists()); assertTrue(file.isDirectory()); File[] files = file.listFiles(); for (int i = 0; i < files.length; i++) { --- 312,326 ---- } + private void parseFilesInDir(File file) { + parseFilesInDir(file, false); + } + /** * @param file */ ! private void parseFilesInDir(File file, boolean recursive) { assertTrue("Directory "+file+" does not exist", file.exists()); assertTrue(file.isDirectory()); + File[] files = file.listFiles(); for (int i = 0; i < files.length; i++) { *************** *** 316,319 **** --- 328,334 ---- if(f.getAbsolutePath().toLowerCase().endsWith(".py")){ parseLegalDocStr(REF.getFileContents(f), f); + + }else if(recursive && f.isDirectory()){ + parseFilesInDir(f, recursive); } } |
From: Fabio Z. <fa...@us...> - 2008-06-15 21:04:54
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9203 Modified Files: Changes.txt Log Message: Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.395 retrieving revision 1.396 diff -C2 -d -r1.395 -r1.396 *** Changes.txt 15 Jun 2008 01:13:03 -0000 1.395 --- Changes.txt 15 Jun 2008 21:05:01 -0000 1.396 *************** *** 16,19 **** --- 16,20 ---- <li><strong>Cygwin</strong>: sys.executable in cygwin was not returning '.exe' in the end as it should.</li> <li><strong>Additional paths for PYTHONPATH</strong>: extension point allows plugins to contribute paths to the PYTHONPATH.</li> + <li><strong>Code-completion</strong>: typing '.' won't apply the selected completion, but will still request a new one with the current contents.</li> </ul> |
From: Fabio Z. <fa...@us...> - 2008-06-15 21:03:24
|
Update of /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8386/src_completions/org/python/pydev/editor/codecompletion Modified Files: PyLinkedModeCompletionProposal.java PyCodeCompletionPreferencesPage.java Added Files: AbstractPyCompletionProposalExtension2.java Removed Files: PyCompletionProposalExtension2.java Log Message: When '.' is auto-triggered, don't really apply the current completion. Only put a '.' (but this needs to be done in auto-trigger to request a new completion after that). --- PyCompletionProposalExtension2.java DELETED --- Index: PyLinkedModeCompletionProposal.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/PyLinkedModeCompletionProposal.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyLinkedModeCompletionProposal.java 14 Jun 2008 22:14:55 -0000 1.6 --- PyLinkedModeCompletionProposal.java 15 Jun 2008 21:03:31 -0000 1.7 *************** *** 27,31 **** import org.python.pydev.plugin.PydevPlugin; ! public class PyLinkedModeCompletionProposal extends PyCompletionProposalExtension2 implements ICompletionProposalExtension{ --- 27,31 ---- import org.python.pydev.plugin.PydevPlugin; ! public class PyLinkedModeCompletionProposal extends AbstractPyCompletionProposalExtension2 implements ICompletionProposalExtension{ *************** *** 52,55 **** --- 52,60 ---- /** + * Offset forced to be returned (only valid if >= 0) + */ + private int newForcedOffset = -1; + + /** * Constructor where the image and the docstring are lazily computed (initially added for the java integration). */ *************** *** 109,112 **** --- 114,121 ---- */ public Point getSelection(IDocument document) { + if(newForcedOffset >= 0){ + return new Point(newForcedOffset, 0); + } + if(onApplyAction == ON_APPLY_JUST_SHOW_CTX_INFO){ return null; *************** *** 126,132 **** --- 135,156 ---- public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) { + boolean eat = (stateMask & SWT.MOD1) != 0; IDocument doc = viewer.getDocument(); + if(trigger == '.'){ + //do not apply completion when it's triggered by '.', because that's usually not what's wanted + //e.g.: if the user writes sys and the current completion is SystemError, pressing '.' will apply + //the completion, but what the user usually wants is just having sys.xxx and not SystemError.xxx + try { + doc.replace(offset, 0, "."); + newForcedOffset = offset+1; + } catch (BadLocationException e) { + PydevPlugin.log(e); + } + return; + } + + if(onApplyAction == ON_APPLY_JUST_SHOW_CTX_INFO){ return; *************** *** 305,309 **** ! //ICompletionProposalExtension protected final static char[] VAR_TRIGGER= new char[] { '.' }; --- 329,333 ---- ! //-------------------------------------------- ICompletionProposalExtension protected final static char[] VAR_TRIGGER= new char[] { '.' }; *************** *** 314,317 **** --- 338,343 ---- * When . is entered, the user will finish (and apply) the current completion * and request a new one with '.' + * + * If not added, it won't request the new one (and will just stop the current) */ public char[] getTriggerCharacters(){ --- NEW FILE: AbstractPyCompletionProposalExtension2.java --- /* * Created on Jul 15, 2006 * @author Fabio */ package org.python.pydev.editor.codecompletion; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.DocumentEvent; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2; import org.eclipse.jface.text.contentassist.IContextInformation; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.graphics.Image; import org.python.pydev.core.docutils.PySelection; import org.python.pydev.plugin.PydevPlugin; public abstract class AbstractPyCompletionProposalExtension2 extends PyCompletionProposal implements ICompletionProposalExtension2 { protected PyCompletionPresentationUpdater presentationUpdater; public int fLen; public boolean fLastIsPar; public AbstractPyCompletionProposalExtension2(String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, String displayString, IContextInformation contextInformation, String additionalProposalInfo, int priority, int onApplyAction, String args) { super(replacementString, replacementOffset, replacementLength, cursorPosition, image, displayString, contextInformation, additionalProposalInfo, priority, onApplyAction, args); presentationUpdater = new PyCompletionPresentationUpdater(); } /** * Called when Ctrl is selected during the completions * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension2#selected(org.eclipse.jface.text.ITextViewer, boolean) */ public void selected(ITextViewer viewer, boolean smartToggle) { if(smartToggle){ StyledText text= viewer.getTextWidget(); if (text == null || text.isDisposed()) return; int widgetCaret= text.getCaretOffset(); IDocument document = viewer.getDocument(); int finalOffset = widgetCaret; try { if(finalOffset >= document.getLength()){ unselected(viewer); return; } char c; do{ c = document.getChar(finalOffset); finalOffset++; }while(isValidChar(c) && finalOffset < document.getLength()); if(c == '('){ fLastIsPar = true; }else{ fLastIsPar = false; } if(!isValidChar(c)){ finalOffset--; } this.fLen = finalOffset-widgetCaret; this.presentationUpdater.updateStyle(viewer, widgetCaret, this.fLen); } catch (BadLocationException e) { PydevPlugin.log(e); } }else{ unselected(viewer); } } /** * @param c * @return */ private boolean isValidChar(char c) { return Character.isJavaIdentifierPart(c); } public void unselected(ITextViewer viewer) { this.presentationUpdater.repairPresentation(viewer); } public boolean validate(IDocument document, int offset, DocumentEvent event) { String[] strs = PySelection.getActivationTokenAndQual(document, offset, false); //System.out.println("validating:"+strs[0]+" - "+strs[1]); String qualifier = strs[1].toLowerCase(); //when we end with a '.', we should start a new completion (and not stay in the old one). if(strs[1].length() == 0 && (strs[0].length() == 0 || strs[0].endsWith("."))){ //System.out.println(false); return false; } String displayString = getDisplayString().toLowerCase(); if(displayString.startsWith(qualifier)){ //System.out.println(true); return true; } //System.out.println(false); return false; } } Index: PyCodeCompletionPreferencesPage.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/PyCodeCompletionPreferencesPage.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyCodeCompletionPreferencesPage.java 25 Mar 2007 16:08:59 -0000 1.1 --- PyCodeCompletionPreferencesPage.java 15 Jun 2008 21:03:31 -0000 1.2 *************** *** 78,82 **** "analyzed to get its actual token and if it maps to a method, its paramaters will be added in the completion.", 80); IntegerFieldEditor deepAnalysisFieldEditor = new IntegerFieldEditor( ! ARGUMENTS_DEEP_ANALYSIS_N_CHARS, "Minimun number of chars in qualifier for\ndeep analysis for parameters in 'from' imports:", p); addField(deepAnalysisFieldEditor); deepAnalysisFieldEditor.getLabelControl(p).setToolTipText(tooltip); --- 78,82 ---- "analyzed to get its actual token and if it maps to a method, its paramaters will be added in the completion.", 80); IntegerFieldEditor deepAnalysisFieldEditor = new IntegerFieldEditor( ! ARGUMENTS_DEEP_ANALYSIS_N_CHARS, "Minimum number of chars in qualifier for\ndeep analysis for parameters in 'from' imports:", p); addField(deepAnalysisFieldEditor); deepAnalysisFieldEditor.getLabelControl(p).setToolTipText(tooltip); *************** *** 102,106 **** addField(new BooleanFieldEditor( ! DEBUG_CODE_COMPLETION, "Debug code completion?.", p)); } --- 102,106 ---- addField(new BooleanFieldEditor( ! DEBUG_CODE_COMPLETION, "Debug code completion?", p)); } |
From: Fabio Z. <fa...@us...> - 2008-06-15 19:12:46
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13996 Modified Files: build.properties Log Message: build.properties no longer added in binary build. Index: build.properties =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/build.properties,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** build.properties 7 Apr 2008 19:54:57 -0000 1.15 --- build.properties 15 Jun 2008 19:12:52 -0000 1.16 *************** *** 12,16 **** retroweaver-rt.jar,\ shiftone-cache.jar,\ - build.properties,\ plugin.properties jars.compile.order = pydev.jar --- 12,15 ---- |
From: Fabio Z. <fa...@us...> - 2008-06-15 19:12:42
|
Update of /cvsroot/pydev/org.python.pydev.refactoring In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13975 Modified Files: build.properties Log Message: build.properties no longer added in binary build. Index: build.properties =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.refactoring/build.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** build.properties 22 Oct 2007 17:25:54 -0000 1.4 --- build.properties 15 Jun 2008 19:12:48 -0000 1.5 *************** *** 6,10 **** plugin.properties,\ refactoring.jar,\ - build.properties,\ icons/,\ bin/org/python/pydev/refactoring/,\ --- 6,9 ---- |
Update of /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8125/src_console/org/python/pydev/debug/newconsole Modified Files: PydevXmlRpcClient.java PydevConsoleCommunication.java PydevConsoleConstants.java PydevConsolePreferencesInitializer.java Log Message: Maximum number of attempts to connect to the shell initially raised (and can now be configured). Index: PydevConsoleConstants.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/PydevConsoleConstants.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PydevConsoleConstants.java 7 Apr 2008 01:57:14 -0000 1.6 --- PydevConsoleConstants.java 15 Jun 2008 19:01:31 -0000 1.7 *************** *** 42,45 **** --- 42,48 ---- public static final String INITIAL_INTERPRETER_CMDS = "INITIAL_INTERPRETER_CMDS"; public static final String DEFAULT_INITIAL_INTERPRETER_CMDS = "import sys; print '%s %s' % (sys.executable or sys.platform, sys.version)\n"; + + public static final String INTERACTIVE_CONSOLE_MAXIMUM_CONNECTION_ATTEMPTS = "INTERACTIVE_CONSOLE_MAXIMUM_CONNECTION_ATTEMPTS"; + public static final int DEFAULT_INTERACTIVE_CONSOLE_MAXIMUM_CONNECTION_ATTEMPTS = 20; } Index: PydevXmlRpcClient.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/PydevXmlRpcClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PydevXmlRpcClient.java 7 Apr 2008 01:57:14 -0000 1.2 --- PydevXmlRpcClient.java 15 Jun 2008 19:01:31 -0000 1.3 *************** *** 69,73 **** final Object[] result = new Object[]{null}; ! //make ana async call so that we can keep track of not actually having an answer. this.impl.executeAsync(command, args, new AsyncCallback(){ --- 69,73 ---- final Object[] result = new Object[]{null}; ! //make an async call so that we can keep track of not actually having an answer. this.impl.executeAsync(command, args, new AsyncCallback(){ Index: PydevConsolePreferencesInitializer.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/PydevConsolePreferencesInitializer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PydevConsolePreferencesInitializer.java 4 Apr 2008 02:54:42 -0000 1.3 --- PydevConsolePreferencesInitializer.java 15 Jun 2008 19:01:31 -0000 1.4 *************** *** 37,40 **** --- 37,43 ---- node.put(PydevConsoleConstants.INTERACTIVE_CONSOLE_VM_ARGS, PydevConsoleConstants.DEFAULT_INTERACTIVE_CONSOLE_VM_ARGS); node.put(PydevConsoleConstants.INITIAL_INTERPRETER_CMDS, PydevConsoleConstants.DEFAULT_INITIAL_INTERPRETER_CMDS); + + node.putInt(PydevConsoleConstants.INTERACTIVE_CONSOLE_MAXIMUM_CONNECTION_ATTEMPTS, + PydevConsoleConstants.DEFAULT_INTERACTIVE_CONSOLE_MAXIMUM_CONNECTION_ATTEMPTS); } Index: PydevConsoleCommunication.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/PydevConsoleCommunication.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PydevConsoleCommunication.java 12 Apr 2008 15:39:58 -0000 1.9 --- PydevConsoleCommunication.java 15 Jun 2008 19:01:31 -0000 1.10 *************** *** 12,19 **** --- 12,24 ---- import org.apache.xmlrpc.server.XmlRpcServer; import org.apache.xmlrpc.webserver.WebServer; + import org.eclipse.core.runtime.IProgressMonitor; + import org.eclipse.core.runtime.IStatus; + import org.eclipse.core.runtime.Status; + import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.text.contentassist.ICompletionProposal; import org.python.pydev.core.ICompletionState; import org.python.pydev.core.IToken; import org.python.pydev.core.Tuple; + import org.python.pydev.debug.newconsole.prefs.InteractiveConsolePrefs; import org.python.pydev.dltk.console.IScriptConsoleCommunication; import org.python.pydev.dltk.console.InterpreterResponse; *************** *** 91,96 **** public void close() throws Exception { if(this.client != null){ ! this.client.execute("close", new Object[0]); ! this.client = null; } --- 96,112 ---- public void close() throws Exception { if(this.client != null){ ! new Job("Close console communication"){ ! ! @Override ! protected IStatus run(IProgressMonitor monitor) { ! try { ! PydevConsoleCommunication.this.client.execute("close", new Object[0]); ! } catch (Exception e) { ! //Ok, we can ignore this one on close. ! } ! PydevConsoleCommunication.this.client = null; ! return Status.OK_STATUS; ! } ! }.schedule(); //finish it } *************** *** 178,183 **** }else{ //create a thread that'll keep locked until an answer is received from the server. ! Thread thread = new Thread(){ ! /** * Executes the needed command --- 194,199 ---- }else{ //create a thread that'll keep locked until an answer is received from the server. ! Job job = new Job("Pydev Console Communication"){ ! /** * Executes the needed command *************** *** 215,219 **** @Override ! public void run() { boolean needInput = false; try{ --- 231,235 ---- @Override ! protected IStatus run(IProgressMonitor monitor) { boolean needInput = false; try{ *************** *** 222,230 **** ! //the 1st time we'll do a connection attempt, we can try up to 5 times (until the 1st time the connection ! //is accepted) int commAttempts = 0; while(true){ executed = exec(); --- 238,251 ---- ! //the 1st time we'll do a connection attempt, we can try to connect n times (until the 1st time the connection ! //is accepted) -- that's mostly because the server may take a while to get started. int commAttempts = 0; + int maximumAttempts = InteractiveConsolePrefs.getMaximumAttempts(); + //System.out.println(maximumAttempts); while(true){ + if(monitor.isCanceled()){ + return Status.CANCEL_STATUS; + } executed = exec(); *************** *** 234,238 **** break; }else{ ! if(commAttempts < 5){ commAttempts += 1; continue; --- 255,259 ---- break; }else{ ! if(commAttempts < maximumAttempts){ commAttempts += 1; continue; *************** *** 246,250 **** } ! //unreachable code!! //throw new RuntimeException("Can never get here!"); } --- 267,271 ---- } ! //unreachable code!! -- commented because eclipse will complain about it //throw new RuntimeException("Can never get here!"); } *************** *** 265,271 **** false, needInput); } } }; ! thread.start(); } --- 286,295 ---- false, needInput); } + return Status.OK_STATUS; } }; ! ! job.schedule(); ! } *************** *** 274,278 **** synchronized(lock2){ try { ! lock2.wait(10); } catch (InterruptedException e) { PydevPlugin.log(e); --- 298,302 ---- synchronized(lock2){ try { ! lock2.wait(20); } catch (InterruptedException e) { PydevPlugin.log(e); |
From: Fabio Z. <fa...@us...> - 2008-06-15 19:01:24
|
Update of /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/prefs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8125/src_console/org/python/pydev/debug/newconsole/prefs Modified Files: InteractiveConsolePrefs.java Log Message: Maximum number of attempts to connect to the shell initially raised (and can now be configured). Index: InteractiveConsolePrefs.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/prefs/InteractiveConsolePrefs.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** InteractiveConsolePrefs.java 15 Jun 2008 01:25:35 -0000 1.3 --- InteractiveConsolePrefs.java 15 Jun 2008 19:01:32 -0000 1.4 *************** *** 3,6 **** --- 3,7 ---- import org.eclipse.jface.preference.ColorFieldEditor; import org.eclipse.jface.preference.FieldEditorPreferencePage; + import org.eclipse.jface.preference.IntegerFieldEditor; import org.eclipse.jface.preference.StringFieldEditor; import org.eclipse.swt.widgets.Composite; *************** *** 39,42 **** --- 40,46 ---- addField(new StringFieldEditor(PydevConsoleConstants.INTERACTIVE_CONSOLE_VM_ARGS, "Vm Args for jython\n(used only on external\nprocess option):", p)); + + addField(new IntegerFieldEditor(PydevConsoleConstants.INTERACTIVE_CONSOLE_MAXIMUM_CONNECTION_ATTEMPTS, + "Maximum connection attempts\nfor initial communication:", p)); } *************** *** 46,48 **** --- 50,61 ---- } + public static int getMaximumAttempts() { + PydevDebugPlugin plugin = PydevDebugPlugin.getDefault(); + if(plugin != null){ + return plugin.getPreferenceStore().getInt(PydevConsoleConstants.INTERACTIVE_CONSOLE_MAXIMUM_CONNECTION_ATTEMPTS); + }else{ + return PydevConsoleConstants.DEFAULT_INTERACTIVE_CONSOLE_MAXIMUM_CONNECTION_ATTEMPTS; + } + } + } |