[Pydev-cvs] org.python.pydev/src/org/python/pydev/editor PyContentAssistProcessor.java,NONE,1.1 PyCo
Brought to you by:
fabioz
From: Aleksandar T. <at...@us...> - 2004-03-30 01:15:10
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3679/src/org/python/pydev/editor Modified Files: PyEditConfiguration.java PyEdit.java package.html Added Files: PyContentAssistProcessor.java PyContentAssistant.java Log Message: Started imoplementation of the PyDictionary Index: package.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/package.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** package.html 10 Dec 2003 10:14:27 -0000 1.1 --- package.html 30 Mar 2004 01:03:37 -0000 1.2 *************** *** 4,6 **** --- 4,44 ---- <p>The main widget is {@link org.python.pydev.editor.PyEdit PyEdit}. It ties other utility classes together, sets error markers. + <p>PyContentAssistant & PyContentAssisProcessors are dummy classes, + avaiting implementation. + <h3>Design notes</h3> + <p>I really want to implement ctrl-click navigation. It is not as easy + as pluging in a new class to PyEditConfiguration. This one + See JavaEditor::MouseClickListener (set breakpoint at highlightRegion if debugging to see it in action) + <p> + <pre> + To implement navigation/completion. + - Each editor needs a vocabulary. The vocabulary is hierarchical in structure, and + has items: + Top-level (file vocabulary) has: + classes + functions + globals? + Class vocabulary has: + documentation string + classes + methods (functions) + instance variables (inferred from self.) + Method/function vocabulary has: + documentation string + locals + classes + functions + + Each definition in the vocabulary describes: + - where is it defined (file, char span) + - character range where it is applicable + + Vocabulary usage: + Find an innermost vocabulary containing current selection. + Then quiz it for whatever is needed + + Questions: + can vocabularies be overlapping? That would make things hard. + + </pre> </body> \ No newline at end of file Index: PyEdit.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyEdit.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PyEdit.java 12 Mar 2004 00:18:40 -0000 1.8 --- PyEdit.java 30 Mar 2004 01:03:37 -0000 1.9 *************** *** 32,35 **** --- 32,36 ---- import org.python.pydev.plugin.PydevPlugin; import org.python.pydev.plugin.PydevPrefs; + import org.python.pydev.editor.dictionary.PyDEditorItem; import org.python.pydev.outline.PyOutlinePage; import org.python.pydev.outline.SelectionPosition; *************** *** 47,51 **** * <li>The {@link org.python.pydev.outline.PyOutlinePage PyOutlinePage} shows the outline * ! * <p>Listens to the parser's events, and displays error markers from the parser * * <p>General notes: --- 48,52 ---- * <li>The {@link org.python.pydev.outline.PyOutlinePage PyOutlinePage} shows the outline * ! * <p>Listens to the parser's events, and displays error markers from the parser. * * <p>General notes: *************** *** 66,69 **** --- 67,72 ---- /** need to hold onto it to support indentPrefix change through preferences */ PyEditConfiguration editConfiguration; + /** top-level dictionary */ + PyDEditorItem dictionaryRoot; public PyEdit() { *************** *** 140,143 **** --- 143,148 ---- parser.setDocument(getDocumentProvider().getDocument(input)); + dictionaryRoot = new PyDEditorItem(parser); + // listen to changes in TAB_WIDTH preference prefListener = new Preferences.IPropertyChangeListener() { --- NEW FILE: PyContentAssistant.java --- /* * Author: atotic * Created on Mar 25, 2004 * License: Common Public License v1.0 */ package org.python.pydev.editor; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.contentassist.IContentAssistProcessor; import org.eclipse.jface.text.contentassist.IContentAssistant; /** * * TODO Implement this class * It should implement navigation/ */ public class PyContentAssistant implements IContentAssistant { /** */ public void install(ITextViewer textViewer) { // TODO Auto-generated method stub } public void uninstall() { // TODO Auto-generated method stub } public String showPossibleCompletions() { // TODO Auto-generated method stub return null; } public String showContextInformation() { // TODO Auto-generated method stub return null; } /** * override * TODO comment this method */ public IContentAssistProcessor getContentAssistProcessor(String contentType) { // TODO Auto-generated method stub return null; } } --- NEW FILE: PyContentAssistProcessor.java --- /* * Author: atotic * Created on Mar 25, 2004 * License: Common Public License v1.0 */ package org.python.pydev.editor; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.contentassist.ICompletionProposal; import org.eclipse.jface.text.contentassist.IContentAssistProcessor; import org.eclipse.jface.text.contentassist.IContextInformation; import org.eclipse.jface.text.contentassist.IContextInformationValidator; /** * * TODO Implement this class */ public class PyContentAssistProcessor implements IContentAssistProcessor { static char[] completionProposalActivators = new char['.']; /** * override * TODO comment this method */ public ICompletionProposal[] computeCompletionProposals( ITextViewer viewer, int documentOffset) { // TODO Auto-generated method stub return null; } /** * override * TODO comment this method */ public IContextInformation[] computeContextInformation( ITextViewer viewer, int documentOffset) { // TODO Auto-generated method stub return null; } public char[] getCompletionProposalAutoActivationCharacters() { return completionProposalActivators; } /** * override * TODO comment this method */ public char[] getContextInformationAutoActivationCharacters() { // TODO Auto-generated method stub return null; } /** * override * TODO comment this method */ public String getErrorMessage() { // TODO Auto-generated method stub return null; } /** * override * TODO comment this method */ public IContextInformationValidator getContextInformationValidator() { // TODO Auto-generated method stub return null; } } Index: PyEditConfiguration.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyEditConfiguration.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyEditConfiguration.java 12 Mar 2004 00:18:40 -0000 1.5 --- PyEditConfiguration.java 30 Mar 2004 01:03:37 -0000 1.6 *************** *** 15,18 **** --- 15,19 ---- import org.eclipse.jface.text.ITextDoubleClickStrategy; import org.eclipse.jface.text.TextAttribute; + import org.eclipse.jface.text.contentassist.IContentAssistant; import org.eclipse.jface.text.presentation.IPresentationReconciler; import org.eclipse.jface.text.presentation.PresentationReconciler; *************** *** 254,257 **** --- 255,261 ---- } + public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { + return new PyContentAssistant(); + } } \ No newline at end of file |