[Pydev-cvs] org.python.pydev/src/org/python/pydev/editor/correctionassist/heuristics AssistDocString
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2005-09-25 13:07:12
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist/heuristics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10252/src/org/python/pydev/editor/correctionassist/heuristics Modified Files: AssistDocString.java Removed Files: AssistCreations.java AssistCreateMethodInClass.java AssistCreateMethodInModule.java AbstractAssistCreate.java AssistCreateClassInModule.java Log Message: --- AssistCreateClassInModule.java DELETED --- --- AssistCreateMethodInModule.java DELETED --- --- AssistCreateMethodInClass.java DELETED --- Index: AssistDocString.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist/heuristics/AssistDocString.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AssistDocString.java 20 Sep 2005 01:16:21 -0000 1.8 --- AssistDocString.java 25 Sep 2005 13:07:04 -0000 1.9 *************** *** 13,16 **** --- 13,17 ---- import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.contentassist.ICompletionProposal; + import org.python.pydev.core.Tuple; import org.python.pydev.editor.PyEdit; import org.python.pydev.editor.actions.PyAction; *************** *** 32,38 **** public List<ICompletionProposal> getProps(PySelection ps, ImageCache imageCache, File f, PythonNature nature, PyEdit edit, int offset) throws BadLocationException { ArrayList<ICompletionProposal> l = new ArrayList<ICompletionProposal>(); ! List params = PyAction.getInsideParentesisToks(ps.getCursorLineContents(), false); - StringBuffer buf = new StringBuffer(); String initial = PyAction.getIndentationFromLine(ps.getCursorLineContents()); String delimiter = PyAction.getDelimiter(ps.getDoc()); --- 33,39 ---- public List<ICompletionProposal> getProps(PySelection ps, ImageCache imageCache, File f, PythonNature nature, PyEdit edit, int offset) throws BadLocationException { ArrayList<ICompletionProposal> l = new ArrayList<ICompletionProposal>(); ! Tuple<List<String>, Integer> tuple = ps.getInsideParentesisToks(false); ! List params = tuple.o1; String initial = PyAction.getIndentationFromLine(ps.getCursorLineContents()); String delimiter = PyAction.getDelimiter(ps.getDoc()); *************** *** 40,43 **** --- 41,45 ---- String inAndIndent = delimiter+initial+indentation; + StringBuffer buf = new StringBuffer(); buf.append(inAndIndent+"'''"); int newOffset = buf.length(); *************** *** 55,60 **** buf.append(inAndIndent); String comp = buf.toString(); ! l.add(new PyCompletionProposal(comp, ps.getStartLine().getOffset()+ps.getStartLine().getLength(), 0, newOffset , imageCache.get(UIConstants.ASSIST_DOCSTRING), "Make docstring", null, null, IPyCompletionProposal.PRIORITY_DEFAULT)); return l; --- 57,65 ---- buf.append(inAndIndent); + int lineOfOffset = ps.getLineOfOffset(tuple.o2); String comp = buf.toString(); ! int offsetPosToAdd = ps.getEndLineOffset(lineOfOffset); ! ! l.add(new PyCompletionProposal(comp, offsetPosToAdd, 0, newOffset , imageCache.get(UIConstants.ASSIST_DOCSTRING), "Make docstring", null, null, IPyCompletionProposal.PRIORITY_DEFAULT)); return l; *************** *** 66,70 **** public boolean isValid(PySelection ps, String sel, PyEdit edit, int offset) { return (sel.indexOf("class ") != -1 || sel.indexOf("def ") != -1) && ! (sel.indexOf("(") != -1 && sel.indexOf("(") != -1); } --- 71,75 ---- public boolean isValid(PySelection ps, String sel, PyEdit edit, int offset) { return (sel.indexOf("class ") != -1 || sel.indexOf("def ") != -1) && ! ((sel.indexOf("(") != -1 && sel.indexOf("(") != -1) || sel.indexOf(':') != -1); } --- AssistCreations.java DELETED --- --- AbstractAssistCreate.java DELETED --- |