[Pydev-cvs] org.python.pydev/src/org/python/pydev/editor/correctionassist PythonCorrectionProcessor.
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2005-09-20 01:16:30
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15813/src/org/python/pydev/editor/correctionassist Modified Files: PythonCorrectionProcessor.java Log Message: Index: PythonCorrectionProcessor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist/PythonCorrectionProcessor.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** PythonCorrectionProcessor.java 18 Jun 2005 21:27:36 -0000 1.24 --- PythonCorrectionProcessor.java 20 Sep 2005 01:16:21 -0000 1.25 *************** *** 15,28 **** import org.eclipse.jface.text.contentassist.IContextInformation; import org.eclipse.jface.text.contentassist.IContextInformationValidator; import org.python.pydev.editor.PyEdit; import org.python.pydev.editor.actions.PyAction; import org.python.pydev.editor.actions.PySelection; import org.python.pydev.editor.correctionassist.heuristics.AssistAssign; - import org.python.pydev.editor.correctionassist.heuristics.AssistCreateClassInModule; - import org.python.pydev.editor.correctionassist.heuristics.AssistCreateMethodInClass; - import org.python.pydev.editor.correctionassist.heuristics.AssistCreateMethodInModule; import org.python.pydev.editor.correctionassist.heuristics.AssistDocString; import org.python.pydev.editor.correctionassist.heuristics.AssistImport; - import org.python.pydev.editor.correctionassist.heuristics.AssistOverride; import org.python.pydev.editor.correctionassist.heuristics.AssistTry; import org.python.pydev.editor.correctionassist.heuristics.IAssistProps; --- 15,25 ---- import org.eclipse.jface.text.contentassist.IContextInformation; import org.eclipse.jface.text.contentassist.IContextInformationValidator; + import org.python.pydev.core.ExtensionHelper; import org.python.pydev.editor.PyEdit; import org.python.pydev.editor.actions.PyAction; import org.python.pydev.editor.actions.PySelection; import org.python.pydev.editor.correctionassist.heuristics.AssistAssign; import org.python.pydev.editor.correctionassist.heuristics.AssistDocString; import org.python.pydev.editor.correctionassist.heuristics.AssistImport; import org.python.pydev.editor.correctionassist.heuristics.AssistTry; import org.python.pydev.editor.correctionassist.heuristics.IAssistProps; *************** *** 92,117 **** PySelection ps = new PySelection(edit); ! List results = new ArrayList(); String sel = PyAction.getLineWithoutComments(ps); ! IAssistProps[] assists = new IAssistProps[]{ ! new AssistTry(), ! new AssistImport(), ! new AssistDocString(), ! new AssistOverride(), ! new AssistAssign(), ! // new AssistCreations(), ! new AssistCreateMethodInModule(), ! new AssistCreateClassInModule(), ! new AssistCreateMethodInClass(), ! }; ! for (int i = 0; i < assists.length; i++) { try { ! if (assists[i].isValid(ps, sel)) { try { ! results.addAll(assists[i].getProps(ps, imageCache, edit.getEditorFile(), (PythonNature)edit.getPythonNature(), edit ! .getPythonModel())); } catch (BadLocationException e) { PydevPlugin.log(e); --- 89,117 ---- PySelection ps = new PySelection(edit); ! List<ICompletionProposal> results = new ArrayList<ICompletionProposal>(); String sel = PyAction.getLineWithoutComments(ps); ! List<IAssistProps> assists = new ArrayList<IAssistProps>(); ! assists.add(new AssistTry()); ! assists.add(new AssistImport()); ! assists.add(new AssistDocString()); ! assists.add(new AssistAssign()); ! assists.addAll(ExtensionHelper.getParticipants(ExtensionHelper.PYDEV_CTRL_1)); ! ! for (IAssistProps assist : assists) { try { ! if (assist.isValid(ps, sel, edit, offset)) { try { ! results.addAll( ! assist.getProps( ! ps, ! imageCache, ! edit.getEditorFile(), ! (PythonNature)edit.getPythonNature(), ! edit, ! offset) ! ); } catch (BadLocationException e) { PydevPlugin.log(e); |