From: khartlage Date: Thu, 11 Sep 2003 15:25:26 +0000 (+0000) Subject: Improved "project.index" file for PHPdoc TextHover information X-Git-Url: http://git.phpeclipse.com?hp=de9c71967558c2f8d3adf9c237a8fafe3788c84f Improved "project.index" file for PHPdoc TextHover information - added phpdoc information - added offset information for the identifier PHPTextHover returns the PHPdoc of an identifier if it's available You should do a "Project->Rebuild All" for your php projects to see the effect. --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java index ba2252a..70785ae 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java @@ -466,19 +466,17 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon fImageDescriptorRegistry = new ImageDescriptorRegistry(); return fImageDescriptorRegistry; } - /** * Open a file in the Workbench that may or may not exist in the workspace. * Must be run on the UI thread. * @param filename - * @param line * @throws CoreException */ - public void openFileInTextEditor(String filename, int line, String findString) throws CoreException { + public ITextEditor openFileInTextEditor(String filename) throws CoreException { - // reject directories + // reject directories if (new File(filename).isDirectory()) - return; + return null; IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow window = workbench.getWorkbenchWindows()[0]; @@ -495,7 +493,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon } else { // Otherwise open the stream directly if (page == null) - return; + return null; FileStorage storage = new FileStorage(path); IEditorRegistry registry = getWorkbench().getEditorRegistry(); IEditorDescriptor desc = registry.getDefaultEditor(filename); @@ -514,6 +512,18 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon } } } + return textEditor; + } + /** + * Open a file in the Workbench that may or may not exist in the workspace. + * Must be run on the UI thread. + * @param filename + * @param line + * @throws CoreException + */ + public void openFileAndGotoLine(String filename, int line) throws CoreException { + + ITextEditor textEditor = openFileInTextEditor(filename); if (textEditor != null) { // If a line number was given, go to it if (line > 0) { @@ -526,6 +536,32 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon // invalid text position -> do nothing } } + } + } + + /** + * Open a file in the Workbench that may or may not exist in the workspace. + * Must be run on the UI thread. + * @param filename + * @param offset + * @throws CoreException + */ + public void openFileAndGotoOffset(String filename, int offset, int length) throws CoreException { + + ITextEditor textEditor = openFileInTextEditor(filename); + if (textEditor != null) { + // If a line number was given, go to it + if (offset >= 0) { + IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput()); + textEditor.selectAndReveal(offset, length); + } + } + } + + public void openFileAndFindString(String filename, String findString) throws CoreException { + + ITextEditor textEditor = openFileInTextEditor(filename); + if (textEditor != null) { // If a string was given, go to it if (findString != null) { try { @@ -540,7 +576,6 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon } } } - public void setLastEditorFile(IFile textEditor) { this.fLastEditorFile = textEditor; } @@ -549,8 +584,8 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon * @see org.eclipse.ui.plugin.AbstractUIPlugin#shutdown() */ public void shutdown() throws CoreException { - super.shutdown(); - + super.shutdown(); + // externalTools.shutDown(); ColorManager.getDefault().dispose(); @@ -562,7 +597,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon indexManager = (IdentifierIndexManager) iterator.next(); indexManager.writeFile(); } - + } public void startup() throws CoreException { diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenDeclarationEditorActon.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenDeclarationEditorActon.java index a84c8bf..3322c86 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenDeclarationEditorActon.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/actions/PHPOpenDeclarationEditorActon.java @@ -94,7 +94,7 @@ public class PHPOpenDeclarationEditorActon extends ActionDelegate implements IEd new ListContentProvider(), new LabelProvider(), "Select the resources to open."); - listSelectionDialog.setTitle("Multiple declarations found"); + listSelectionDialog.setTitle("Multiple declarations found"); if (listSelectionDialog.open() == Window.OK) { Object[] locations = listSelectionDialog.getResult(); if (locations != null) { @@ -103,7 +103,11 @@ public class PHPOpenDeclarationEditorActon extends ActionDelegate implements IEd PHPIdentifierLocation location = (PHPIdentifierLocation) locations[i]; String filename = workspaceLocation + location.getFilename(); // System.out.println(filename); - PHPeclipsePlugin.getDefault().openFileInTextEditor(filename, 0, word); + if (location.getOffset() >= 0) { + PHPeclipsePlugin.getDefault().openFileAndGotoOffset(filename, location.getOffset(), word.length()); + } else { + PHPeclipsePlugin.getDefault().openFileAndFindString(filename, word); + } } } catch (CoreException e) { // TODO Auto-generated catch block @@ -116,8 +120,11 @@ public class PHPOpenDeclarationEditorActon extends ActionDelegate implements IEd PHPIdentifierLocation location = (PHPIdentifierLocation) list.get(0); String filename = workspaceLocation + location.getFilename(); // System.out.println(filename); - PHPeclipsePlugin.getDefault().openFileInTextEditor(filename, 0, word); - + if (location.getOffset() >= 0) { + PHPeclipsePlugin.getDefault().openFileAndGotoOffset(filename, location.getOffset(), word.length()); + } else { + PHPeclipsePlugin.getDefault().openFileAndFindString(filename, word); + } } catch (CoreException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -134,29 +141,6 @@ public class PHPOpenDeclarationEditorActon extends ActionDelegate implements IEd } } - // public static void openContextHelp(String word) { - // IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); - // if (store.getBoolean(PHPHelpPlugin.PHP_CHM_ENABLED)) { - // String[] arguments = { store.getString(PHPHelpPlugin.PHP_CHM_FILE), word }; - // MessageFormat form = new MessageFormat(store.getString(PHPHelpPlugin.PHP_CHM_COMMAND)); - // try { - // Runtime runtime = Runtime.getRuntime(); - // String command = form.format(arguments); - // - // runtime.exec(command); - // } catch (IOException e) { - // } - // } else { - // IHelp help = WorkbenchHelp.getHelpSupport(); - // if (help != null) { - // PHPFunctionHelpResource helpResource = new PHPFunctionHelpResource(word); - // WorkbenchHelp.getHelpSupport().displayHelpResource(helpResource); - // } else { - // // showMessage(shell, dialogTitle, ActionMessages.getString("Open help not available"), false); //$NON-NLS-1$ - // } - // } - // } - private String getPHPIdentifier(IDocument doc, int pos) { Point word = PHPWordExtractor.findWord(doc, pos); if (word != null) { diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/IdentifierIndexManager.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/IdentifierIndexManager.java index 365620c..b72d55d 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/IdentifierIndexManager.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/IdentifierIndexManager.java @@ -34,13 +34,42 @@ public class IdentifierIndexManager { private int fToken; public LineCreator() { - fScanner = new Scanner(false, false); + fScanner = new Scanner(true, false); } + /** - * gets the next token from input + * Add the information of the current identifier to the line + * + * @param typeOfIdentifier the type of the identifier ('c'lass, 'd'efine, 'f'unction, 'm'ethod, 'v'ariable) + * @param identifier current identifier + * @param line Buffer for the current index line + * @param phpdocOffset the offset of the PHPdoc comment if available + * @param phpdocLength the length of the PHPdoc comment if available */ - private void getNextToken() { + private void addIdentifierInformation( + char typeOfIdentifier, + char[] identifier, + StringBuffer line, + int phpdocOffset, + int phpdocLength) { + + line.append('\t'); + line.append(typeOfIdentifier); + line.append(identifier); + line.append("\to"); // Offset + line.append(fScanner.getCurrentTokenStartPosition()); + if (phpdocOffset >= 0) { + line.append("\tp"); // phpdoc offset + line.append(phpdocOffset); + line.append("\tl"); // phpdoc length + line.append(phpdocLength); + } + } + /** + * Get the next token from input + */ + private void getNextToken() { try { fToken = fScanner.getNextToken(); if (Scanner.DEBUG) { @@ -60,16 +89,25 @@ public class IdentifierIndexManager { private void parseDeclarations(StringBuffer buf, boolean goBack) { char[] ident; int counter = 0; + int phpdocOffset = -1; + int phpdocLength = -1; try { while (fToken != TokenNameEOF && fToken != TokenNameERROR) { + phpdocOffset = -1; + if (fToken == TokenNameCOMMENT_PHPDOC) { + phpdocOffset = fScanner.getCurrentTokenStartPosition(); + phpdocLength = fScanner.getCurrentTokenEndPosition() - fScanner.getCurrentTokenStartPosition() + 1; + getNextToken(); + if (fToken == TokenNameEOF || fToken == TokenNameERROR) { + break; + } + } if (fToken == TokenNamevar) { getNextToken(); if (fToken == TokenNameVariable) { ident = fScanner.getCurrentIdentifierSource(); - buf.append("\tv"); - buf.append(ident); - + addIdentifierInformation('v', ident, buf, phpdocOffset, phpdocLength); getNextToken(); } } else if (fToken == TokenNamefunction) { @@ -79,8 +117,7 @@ public class IdentifierIndexManager { } if (fToken == TokenNameIdentifier) { ident = fScanner.getCurrentIdentifierSource(); - buf.append("\tm"); - buf.append(ident); + addIdentifierInformation('m', ident, buf, phpdocOffset, phpdocLength); getNextToken(); parseDeclarations(buf, true); } @@ -88,8 +125,7 @@ public class IdentifierIndexManager { getNextToken(); if (fToken == TokenNameIdentifier) { ident = fScanner.getCurrentIdentifierSource(); - buf.append("\tc"); - buf.append(ident); + addIdentifierInformation('c', ident, buf, phpdocOffset, phpdocLength); getNextToken(); //skip tokens for classname, extends and others until we have the opening '{' @@ -104,8 +140,7 @@ public class IdentifierIndexManager { getNextToken(); if (fToken == TokenNameStringLiteral) { ident = fScanner.getCurrentStringLiteralSource(); - buf.append("\td"); - buf.append(ident); + addIdentifierInformation('d', ident, buf, phpdocOffset, phpdocLength); getNextToken(); } } @@ -132,6 +167,8 @@ public class IdentifierIndexManager { char[] ident; String identifier; int counter = 0; + int phpdocOffset = -1; + int phpdocLength = -1; fScanner.setSource(charArray); fScanner.setPHPMode(false); @@ -140,6 +177,15 @@ public class IdentifierIndexManager { try { while (fToken != TokenNameEOF && fToken != TokenNameERROR) { + phpdocOffset = -1; + if (fToken == TokenNameCOMMENT_PHPDOC) { + phpdocOffset = fScanner.getCurrentTokenStartPosition(); + phpdocLength = fScanner.getCurrentTokenEndPosition() - fScanner.getCurrentTokenStartPosition() + 1; + getNextToken(); + if (fToken == TokenNameEOF || fToken == TokenNameERROR) { + break; + } + } if (fToken == TokenNamefunction) { getNextToken(); if (fToken == TokenNameAND) { @@ -147,8 +193,7 @@ public class IdentifierIndexManager { } if (fToken == TokenNameIdentifier) { ident = fScanner.getCurrentIdentifierSource(); - buf.append("\tf"); - buf.append(ident); + addIdentifierInformation('f', ident, buf, phpdocOffset, phpdocLength); getNextToken(); parseDeclarations(buf, true); } @@ -156,8 +201,7 @@ public class IdentifierIndexManager { getNextToken(); if (fToken == TokenNameIdentifier) { ident = fScanner.getCurrentIdentifierSource(); - buf.append("\tc"); - buf.append(ident); + addIdentifierInformation('c', ident, buf, phpdocOffset, phpdocLength); getNextToken(); //skip fTokens for classname, extends and others until we have the opening '{' @@ -174,8 +218,7 @@ public class IdentifierIndexManager { getNextToken(); if (fToken == TokenNameStringLiteral) { ident = fScanner.getCurrentStringLiteralSource(); - buf.append("\td"); - buf.append(ident); + addIdentifierInformation('d', ident, buf, phpdocOffset, phpdocLength); getNextToken(); } } @@ -245,7 +288,8 @@ public class IdentifierIndexManager { String token; String identifier = null; String classname = null; - PHPIdentifier phpIdentifier = null; + String offset = null; + PHPIdentifierLocation phpIdentifier = null; boolean tokenExists = false; tokenizer = new StringTokenizer(line, "\t"); @@ -282,6 +326,27 @@ public class IdentifierIndexManager { identifier = token.substring(1); phpIdentifier = new PHPIdentifierLocation(identifier, PHPIdentifier.VARIABLE, phpFileName, classname); break; + case 'o' : // offset information + identifier = null; + if (phpIdentifier != null) { + offset = token.substring(1); + phpIdentifier.setOffset(Integer.parseInt(offset)); + } + break; + case 'p' : // PHPdoc offset information + identifier = null; + if (phpIdentifier != null) { + offset = token.substring(1); + phpIdentifier.setPHPDocOffset(Integer.parseInt(offset)); + } + break; + case 'l' : // PHPdoc length information + identifier = null; + if (phpIdentifier != null) { + offset = token.substring(1); + phpIdentifier.setPHPDocLength(Integer.parseInt(offset)); + } + break; default : identifier = null; phpIdentifier = null; diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/PHPIdentifierLocation.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/PHPIdentifierLocation.java index 0b3f252..e3ea468 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/PHPIdentifierLocation.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/builder/PHPIdentifierLocation.java @@ -9,6 +9,9 @@ import net.sourceforge.phpeclipse.mover.obfuscator.PHPIdentifier; public class PHPIdentifierLocation extends PHPIdentifier { private String fClassname; private String fFilename; + private int fOffset; + private int fPHPDocLength; + private int fPHPDocOffset; public PHPIdentifierLocation(String identifier, int type, String filename) { this(identifier, type, filename, null); @@ -18,6 +21,9 @@ public class PHPIdentifierLocation extends PHPIdentifier { super(identifier, type); fFilename = filename; fClassname = classname; + fOffset = -1; + fPHPDocLength = -1; + fPHPDocOffset = -1; } /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) @@ -44,6 +50,27 @@ public class PHPIdentifierLocation extends PHPIdentifier { } /** + * @return + */ + public int getOffset() { + return fOffset; + } + + /** + * @return + */ + public int getPHPDocLength() { + return fPHPDocLength; + } + + /** + * @return + */ + public int getPHPDocOffset() { + return fPHPDocOffset; + } + + /** * @param string */ public void setClassname(String string) { @@ -57,6 +84,27 @@ public class PHPIdentifierLocation extends PHPIdentifier { fFilename = string; } + /** + * @param i + */ + public void setOffset(int i) { + fOffset = i; + } + + /** + * @param i + */ + public void setPHPDocLength(int i) { + fPHPDocLength = i; + } + + /** + * @param i + */ + public void setPHPDocOffset(int i) { + fPHPDocOffset = i; + } + /* (non-Javadoc) * @see java.lang.Object#toString() */ diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPSourceViewerConfiguration.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPSourceViewerConfiguration.java index a39d5bb..7da54c2 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPSourceViewerConfiguration.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPSourceViewerConfiguration.java @@ -14,7 +14,6 @@ package net.sourceforge.phpeclipse.phpeditor; import java.util.Vector; import net.sourceforge.phpdt.internal.ui.text.ContentAssistPreference; -import net.sourceforge.phpdt.internal.ui.text.JavaColorManager; import net.sourceforge.phpdt.internal.ui.text.java.JavaFormattingStrategy; import net.sourceforge.phpdt.internal.ui.text.phpdoc.PHPDocCompletionProcessor; import net.sourceforge.phpdt.ui.PreferenceConstants; @@ -29,6 +28,7 @@ import net.sourceforge.phpeclipse.phpeditor.php.PHPCompletionProcessor; import net.sourceforge.phpeclipse.phpeditor.php.PHPDoubleClickSelector; import net.sourceforge.phpeclipse.phpeditor.util.PHPColorProvider; +import org.eclipse.core.resources.IFile; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.text.DefaultAutoIndentStrategy; import org.eclipse.jface.text.IAutoIndentStrategy; @@ -52,411 +52,326 @@ import org.eclipse.jface.text.rules.Token; import org.eclipse.jface.text.source.IAnnotationHover; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.text.source.SourceViewerConfiguration; +import org.eclipse.ui.IFileEditorInput; /** * Configuration for an SourceViewer which shows PHP code. */ -public class PHPSourceViewerConfiguration extends SourceViewerConfiguration -{ - - /** - * Preference key used to look up display tab width. - * - * @since 2.0 - */ - public final static String PREFERENCE_TAB_WIDTH = - PreferenceConstants.EDITOR_TAB_WIDTH; - /** - * Preference key for inserting spaces rather than tabs. - * - * @since 2.0 - */ - public final static String SPACES_FOR_TABS = - PreferenceConstants.EDITOR_SPACES_FOR_TABS; - - // public static final String HTML_DEFAULT = IPHPPartitionScannerConstants.HTML; - //IDocument.DEFAULT_CONTENT_TYPE; - - private JavaTextTools fJavaTextTools; - private PHPEditor fEditor; - - private ContentFormatter fFormatter; - private HTMLFormattingStrategy fFormattingStrategy; - /** - * Single token scanner. - */ - static class SingleTokenScanner extends BufferedRuleBasedScanner - { - public SingleTokenScanner(TextAttribute attribute) - { - setDefaultReturnToken(new Token(attribute)); - } - }; - - /** - * Default constructor. - */ - public PHPSourceViewerConfiguration( - JavaTextTools textTools, - PHPEditor editor) - { - fJavaTextTools = textTools; - fEditor = editor; +public class PHPSourceViewerConfiguration extends SourceViewerConfiguration { + + /** + * Preference key used to look up display tab width. + * + * @since 2.0 + */ + public final static String PREFERENCE_TAB_WIDTH = PreferenceConstants.EDITOR_TAB_WIDTH; + /** + * Preference key for inserting spaces rather than tabs. + * + * @since 2.0 + */ + public final static String SPACES_FOR_TABS = PreferenceConstants.EDITOR_SPACES_FOR_TABS; + + // public static final String HTML_DEFAULT = IPHPPartitionScannerConstants.HTML; + //IDocument.DEFAULT_CONTENT_TYPE; + + private JavaTextTools fJavaTextTools; + private PHPEditor fEditor; + + private ContentFormatter fFormatter; + private HTMLFormattingStrategy fFormattingStrategy; + /** + * Single token scanner. + */ + static class SingleTokenScanner extends BufferedRuleBasedScanner { + public SingleTokenScanner(TextAttribute attribute) { + setDefaultReturnToken(new Token(attribute)); } - - /* - * @see SourceViewerConfiguration#getContentFormatter(ISourceViewer) - */ - public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) - { - // if (fFormatter == null) { - // fFormatter = new ContentFormatter(); - // fFormattingStrategy = new HTMLFormattingStrategy(this, sourceViewer); - // fFormatter.setFormattingStrategy(fFormattingStrategy, HTML_DEFAULT); - // fFormatter.enablePartitionAwareFormatting(false); - // fFormatter.setPartitionManagingPositionCategories(getConfiguredContentTypes(null)); - // } - // return fFormatter; - - if (fFormatter == null) - { - //ContentFormatter - fFormatter = new ContentFormatter(); - IFormattingStrategy strategy = - new JavaFormattingStrategy(sourceViewer); - - fFormatter.setFormattingStrategy( - strategy, - IDocument.DEFAULT_CONTENT_TYPE); - fFormatter.enablePartitionAwareFormatting(false); - fFormatter.setPartitionManagingPositionCategories( - getPartitionManagingPositionCategories()); - } - return fFormatter; - } - - /** - * Returns the names of the document position categories used by the document - * partitioners created by this object to manage their partition information. - * If the partitioners don't use document position categories, the returned - * result is null. - * - * @return the partition managing position categories or null - * if there is none - */ - public String[] getPartitionManagingPositionCategories() - { - return new String[] { DefaultPartitioner.CONTENT_TYPES_CATEGORY }; - } - // /** - // * Returns the names of the document position categories used by the document - // * partitioners created by this object to manage their partition information. - // * If the partitioners don't use document position categories, the returned - // * result is null. - // * - // * @return the partition managing position categories or null - // * if there is none - // */ - // private String[] getPartitionManagingPositionCategories() { - // return new String[] { DefaultPartitioner.CONTENT_TYPES_CATEGORY }; - // } - - public PHPEditor getEditor() - { - return fEditor; - } - - /** - * Returns the preference store used by this configuration to initialize - * the individual bits and pieces. - * - * @return the preference store used to initialize this configuration - * - * @since 2.0 - */ - protected IPreferenceStore getPreferenceStore() - { - return PHPeclipsePlugin.getDefault().getPreferenceStore(); - } - - /* (non-Javadoc) - * Method declared on SourceViewerConfiguration - */ - public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) - { - return new PHPAnnotationHover(); - } - - /* (non-Javadoc) - * Method declared on SourceViewerConfiguration - */ - public IAutoIndentStrategy getAutoIndentStrategy( - ISourceViewer sourceViewer, - String contentType) - { - return ( - IPHPPartitionScannerConstants.PHP.equals(contentType) - ? new PHPAutoIndentStrategy() - : new DefaultAutoIndentStrategy()); - } - - /** - * Returns the PHP source code scanner for this configuration. - * - * @return the PHP source code scanner - */ - protected RuleBasedScanner getCodeScanner() - { - return fJavaTextTools.getCodeScanner(); - } - - /** - * Returns the HTML source code scanner for this configuration. - * - * @return the HTML source code scanner - */ - protected RuleBasedScanner getHTMLScanner() - { - return fJavaTextTools.getHTMLScanner(); - } - - /** - * Returns the PHPDoc source code scanner for this configuration. - * - * @return the PHPDoc source code scanner - */ - protected RuleBasedScanner getPHPDocScanner() - { - return fJavaTextTools.getJavaDocScanner(); - } - - /* (non-Javadoc) - * Method declared on SourceViewerConfiguration - */ - public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) - { - return new String[] { - IPHPPartitionScannerConstants.HTML, - IPHPPartitionScannerConstants.HTML_MULTILINE_COMMENT, - IPHPPartitionScannerConstants.PHP, - IPHPPartitionScannerConstants.PHP_MULTILINE_COMMENT, - IPHPPartitionScannerConstants.CSS, - IPHPPartitionScannerConstants.CSS_MULTILINE_COMMENT, - IPHPPartitionScannerConstants.JAVASCRIPT, - IPHPPartitionScannerConstants.JS_MULTILINE_COMMENT, - IDocument.DEFAULT_CONTENT_TYPE }; - } - - /* (non-Javadoc) - * Method declared on SourceViewerConfiguration - */ - public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) - { - - ContentAssistant assistant = new ContentAssistant(); - IContentAssistProcessor processor = new HTMLCompletionProcessor(); - assistant.setContentAssistProcessor( - processor, - IPHPPartitionScannerConstants.HTML); - assistant.setContentAssistProcessor( - processor, - IPHPPartitionScannerConstants.HTML_MULTILINE_COMMENT); - assistant.setContentAssistProcessor( - processor, - IDocument.DEFAULT_CONTENT_TYPE); - assistant.setContentAssistProcessor( - processor, - IPHPPartitionScannerConstants.CSS); - assistant.setContentAssistProcessor( - processor, - IPHPPartitionScannerConstants.CSS_MULTILINE_COMMENT); - assistant.setContentAssistProcessor( - processor, - IPHPPartitionScannerConstants.JAVASCRIPT); - assistant.setContentAssistProcessor( - processor, - IPHPPartitionScannerConstants.JS_MULTILINE_COMMENT); - - assistant.setContentAssistProcessor( - new PHPCompletionProcessor(), - IPHPPartitionScannerConstants.PHP); - - assistant.setContentAssistProcessor( - new PHPDocCompletionProcessor(), - IPHPPartitionScannerConstants.PHP_MULTILINE_COMMENT); - - // assistant.enableAutoActivation(true); - // assistant.setAutoActivationDelay(500); - // assistant.setProposalPopupOrientation(ContentAssistant.PROPOSAL_OVERLAY); - // ContentAssistPreference.configure(assistant, getPreferenceStore()); - // assistant.setContextInformationPopupOrientation( - // ContentAssistant.CONTEXT_INFO_ABOVE); - // assistant.setContextInformationPopupBackground( - // PHPEditorEnvironment.getPHPColorProvider().getColor( - // new RGB(150, 150, 0))); - ContentAssistPreference.configure(assistant, getPreferenceStore()); - - assistant.setContextInformationPopupOrientation( - ContentAssistant.CONTEXT_INFO_ABOVE); - assistant.setInformationControlCreator( - getInformationControlCreator(sourceViewer)); - - return assistant; + }; + + /** + * Default constructor. + */ + public PHPSourceViewerConfiguration(JavaTextTools textTools, PHPEditor editor) { + fJavaTextTools = textTools; + fEditor = editor; + } + + /* + * @see SourceViewerConfiguration#getContentFormatter(ISourceViewer) + */ + public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) { + // if (fFormatter == null) { + // fFormatter = new ContentFormatter(); + // fFormattingStrategy = new HTMLFormattingStrategy(this, sourceViewer); + // fFormatter.setFormattingStrategy(fFormattingStrategy, HTML_DEFAULT); + // fFormatter.enablePartitionAwareFormatting(false); + // fFormatter.setPartitionManagingPositionCategories(getConfiguredContentTypes(null)); + // } + // return fFormatter; + + if (fFormatter == null) { + //ContentFormatter + fFormatter = new ContentFormatter(); + IFormattingStrategy strategy = new JavaFormattingStrategy(sourceViewer); + + fFormatter.setFormattingStrategy(strategy, IDocument.DEFAULT_CONTENT_TYPE); + fFormatter.enablePartitionAwareFormatting(false); + fFormatter.setPartitionManagingPositionCategories(getPartitionManagingPositionCategories()); } - - /* (non-Javadoc) - * Method declared on SourceViewerConfiguration - */ - // public String getDefaultPrefix(ISourceViewer sourceViewer, String contentType) { - // return (PHPPartitionScanner.PHP.equals(contentType) ? "//" : null); //$NON-NLS-1$ - // // return (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? "//" : null); //$NON-NLS-1$ - // } - - /* - * @see SourceViewerConfiguration#getDefaultPrefix(ISourceViewer, String) - * @since 2.0 - */ - public String[] getDefaultPrefixes( - ISourceViewer sourceViewer, - String contentType) - { - return new String[] { "//", "" }; //$NON-NLS-1$ //$NON-NLS-2$ + return fFormatter; + } + + /** + * Returns the names of the document position categories used by the document + * partitioners created by this object to manage their partition information. + * If the partitioners don't use document position categories, the returned + * result is null. + * + * @return the partition managing position categories or null + * if there is none + */ + public String[] getPartitionManagingPositionCategories() { + return new String[] { DefaultPartitioner.CONTENT_TYPES_CATEGORY }; + } + // /** + // * Returns the names of the document position categories used by the document + // * partitioners created by this object to manage their partition information. + // * If the partitioners don't use document position categories, the returned + // * result is null. + // * + // * @return the partition managing position categories or null + // * if there is none + // */ + // private String[] getPartitionManagingPositionCategories() { + // return new String[] { DefaultPartitioner.CONTENT_TYPES_CATEGORY }; + // } + + public PHPEditor getEditor() { + return fEditor; + } + + /** + * Returns the preference store used by this configuration to initialize + * the individual bits and pieces. + * + * @return the preference store used to initialize this configuration + * + * @since 2.0 + */ + protected IPreferenceStore getPreferenceStore() { + return PHPeclipsePlugin.getDefault().getPreferenceStore(); + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) { + return new PHPAnnotationHover(); + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public IAutoIndentStrategy getAutoIndentStrategy(ISourceViewer sourceViewer, String contentType) { + return (IPHPPartitionScannerConstants.PHP.equals(contentType) ? new PHPAutoIndentStrategy() : new DefaultAutoIndentStrategy()); + } + + /** + * Returns the PHP source code scanner for this configuration. + * + * @return the PHP source code scanner + */ + protected RuleBasedScanner getCodeScanner() { + return fJavaTextTools.getCodeScanner(); + } + + /** + * Returns the HTML source code scanner for this configuration. + * + * @return the HTML source code scanner + */ + protected RuleBasedScanner getHTMLScanner() { + return fJavaTextTools.getHTMLScanner(); + } + + /** + * Returns the PHPDoc source code scanner for this configuration. + * + * @return the PHPDoc source code scanner + */ + protected RuleBasedScanner getPHPDocScanner() { + return fJavaTextTools.getJavaDocScanner(); + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { + return new String[] { + IPHPPartitionScannerConstants.HTML, + IPHPPartitionScannerConstants.HTML_MULTILINE_COMMENT, + IPHPPartitionScannerConstants.PHP, + IPHPPartitionScannerConstants.PHP_MULTILINE_COMMENT, + IPHPPartitionScannerConstants.CSS, + IPHPPartitionScannerConstants.CSS_MULTILINE_COMMENT, + IPHPPartitionScannerConstants.JAVASCRIPT, + IPHPPartitionScannerConstants.JS_MULTILINE_COMMENT, + IDocument.DEFAULT_CONTENT_TYPE }; + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { + + ContentAssistant assistant = new ContentAssistant(); + IContentAssistProcessor processor = new HTMLCompletionProcessor(); + assistant.setContentAssistProcessor(processor, IPHPPartitionScannerConstants.HTML); + assistant.setContentAssistProcessor(processor, IPHPPartitionScannerConstants.HTML_MULTILINE_COMMENT); + assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE); + assistant.setContentAssistProcessor(processor, IPHPPartitionScannerConstants.CSS); + assistant.setContentAssistProcessor(processor, IPHPPartitionScannerConstants.CSS_MULTILINE_COMMENT); + assistant.setContentAssistProcessor(processor, IPHPPartitionScannerConstants.JAVASCRIPT); + assistant.setContentAssistProcessor(processor, IPHPPartitionScannerConstants.JS_MULTILINE_COMMENT); + + assistant.setContentAssistProcessor(new PHPCompletionProcessor(), IPHPPartitionScannerConstants.PHP); + + assistant.setContentAssistProcessor(new PHPDocCompletionProcessor(), IPHPPartitionScannerConstants.PHP_MULTILINE_COMMENT); + + // assistant.enableAutoActivation(true); + // assistant.setAutoActivationDelay(500); + // assistant.setProposalPopupOrientation(ContentAssistant.PROPOSAL_OVERLAY); + // ContentAssistPreference.configure(assistant, getPreferenceStore()); + // assistant.setContextInformationPopupOrientation( + // ContentAssistant.CONTEXT_INFO_ABOVE); + // assistant.setContextInformationPopupBackground( + // PHPEditorEnvironment.getPHPColorProvider().getColor( + // new RGB(150, 150, 0))); + ContentAssistPreference.configure(assistant, getPreferenceStore()); + + assistant.setContextInformationPopupOrientation(ContentAssistant.CONTEXT_INFO_ABOVE); + assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer)); + + return assistant; + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + // public String getDefaultPrefix(ISourceViewer sourceViewer, String contentType) { + // return (PHPPartitionScanner.PHP.equals(contentType) ? "//" : null); //$NON-NLS-1$ + // // return (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? "//" : null); //$NON-NLS-1$ + // } + + /* + * @see SourceViewerConfiguration#getDefaultPrefix(ISourceViewer, String) + * @since 2.0 + */ + public String[] getDefaultPrefixes(ISourceViewer sourceViewer, String contentType) { + return new String[] { "//", "" }; //$NON-NLS-1$ //$NON-NLS-2$ + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) { + return new PHPDoubleClickSelector(); + } + + /* + * @see SourceViewerConfiguration#getIndentPrefixes(ISourceViewer, String) + */ + public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) { + + Vector vector = new Vector(); + + // prefix[0] is either '\t' or ' ' x tabWidth, depending on useSpaces + + final IPreferenceStore preferences = PHPeclipsePlugin.getDefault().getPreferenceStore(); + int tabWidth = preferences.getInt(PHPCore.FORMATTER_TAB_SIZE); + boolean useSpaces = getPreferenceStore().getBoolean(SPACES_FOR_TABS); + + for (int i = 0; i <= tabWidth; i++) { + StringBuffer prefix = new StringBuffer(); + + if (useSpaces) { + for (int j = 0; j + i < tabWidth; j++) + prefix.append(' '); + + if (i != 0) + prefix.append('\t'); + } else { + for (int j = 0; j < i; j++) + prefix.append(' '); + + if (i != tabWidth) + prefix.append('\t'); + } + + vector.add(prefix.toString()); } - /* (non-Javadoc) - * Method declared on SourceViewerConfiguration - */ - public ITextDoubleClickStrategy getDoubleClickStrategy( - ISourceViewer sourceViewer, - String contentType) - { - return new PHPDoubleClickSelector(); - } - - /* - * @see SourceViewerConfiguration#getIndentPrefixes(ISourceViewer, String) - */ - public String[] getIndentPrefixes( - ISourceViewer sourceViewer, - String contentType) - { - - Vector vector = new Vector(); - - // prefix[0] is either '\t' or ' ' x tabWidth, depending on useSpaces - - final IPreferenceStore preferences = - PHPeclipsePlugin.getDefault().getPreferenceStore(); - int tabWidth = preferences.getInt(PHPCore.FORMATTER_TAB_SIZE); - boolean useSpaces = getPreferenceStore().getBoolean(SPACES_FOR_TABS); - - for (int i = 0; i <= tabWidth; i++) - { - StringBuffer prefix = new StringBuffer(); - - if (useSpaces) - { - for (int j = 0; j + i < tabWidth; j++) - prefix.append(' '); - - if (i != 0) - prefix.append('\t'); - } - else - { - for (int j = 0; j < i; j++) - prefix.append(' '); + vector.add(""); //$NON-NLS-1$ - if (i != tabWidth) - prefix.append('\t'); - } - - vector.add(prefix.toString()); - } - - vector.add(""); //$NON-NLS-1$ - - return (String[]) vector.toArray(new String[vector.size()]); - } - /* (non-Javadoc) - * Method declared on SourceViewerConfiguration - */ - public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) - { - // PHPColorProvider provider = PHPEditorEnvironment.getPHPColorProvider(); + return (String[]) vector.toArray(new String[vector.size()]); + } + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { + // PHPColorProvider provider = PHPEditorEnvironment.getPHPColorProvider(); // JavaColorManager provider = PHPEditorEnvironment.getPHPColorProvider(); - PresentationReconciler reconciler = new PresentationReconciler(); - - DefaultDamagerRepairer dr = - new DefaultDamagerRepairer(getHTMLScanner()); - reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE); - reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE); - - dr = new DefaultDamagerRepairer(getHTMLScanner()); - reconciler.setDamager(dr, IPHPPartitionScannerConstants.HTML); - reconciler.setRepairer(dr, IPHPPartitionScannerConstants.HTML); - dr = new DefaultDamagerRepairer(getHTMLScanner()); - reconciler.setDamager(dr, IPHPPartitionScannerConstants.CSS); - reconciler.setRepairer(dr, IPHPPartitionScannerConstants.CSS); - dr = new DefaultDamagerRepairer(getHTMLScanner()); - reconciler.setDamager( - dr, - IPHPPartitionScannerConstants.CSS_MULTILINE_COMMENT); - reconciler.setRepairer( - dr, - IPHPPartitionScannerConstants.CSS_MULTILINE_COMMENT); - dr = new DefaultDamagerRepairer(getHTMLScanner()); - reconciler.setDamager(dr, IPHPPartitionScannerConstants.JAVASCRIPT); - reconciler.setRepairer(dr, IPHPPartitionScannerConstants.JAVASCRIPT); - dr = new DefaultDamagerRepairer(getHTMLScanner()); - reconciler.setDamager( - dr, - IPHPPartitionScannerConstants.JS_MULTILINE_COMMENT); - reconciler.setRepairer( - dr, - IPHPPartitionScannerConstants.JS_MULTILINE_COMMENT); - dr = new DefaultDamagerRepairer( - new SingleTokenScanner( - new TextAttribute( - fJavaTextTools.getColorManager().getColor( - PHPColorProvider.MULTI_LINE_COMMENT)))); - reconciler.setDamager( - dr, - IPHPPartitionScannerConstants.HTML_MULTILINE_COMMENT); - reconciler.setRepairer( - dr, - IPHPPartitionScannerConstants.HTML_MULTILINE_COMMENT); - - dr = new DefaultDamagerRepairer(getCodeScanner()); - reconciler.setDamager(dr, IPHPPartitionScannerConstants.PHP); - reconciler.setRepairer(dr, IPHPPartitionScannerConstants.PHP); - - dr = new DefaultDamagerRepairer(getPHPDocScanner()); - reconciler.setDamager( - dr, - IPHPPartitionScannerConstants.PHP_MULTILINE_COMMENT); - reconciler.setRepairer( - dr, - IPHPPartitionScannerConstants.PHP_MULTILINE_COMMENT); - - return reconciler; - } - - /* (non-Javadoc) - * Method declared on SourceViewerConfiguration - */ - public int getTabWidth(ISourceViewer sourceViewer) - { - return getPreferenceStore().getInt(PREFERENCE_TAB_WIDTH); - } - - /* (non-Javadoc) - * Method declared on SourceViewerConfiguration - */ - public ITextHover getTextHover( - ISourceViewer sourceViewer, - String contentType) - { - return new PHPTextHover(); - } + PresentationReconciler reconciler = new PresentationReconciler(); + + DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getHTMLScanner()); + reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE); + reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE); + + dr = new DefaultDamagerRepairer(getHTMLScanner()); + reconciler.setDamager(dr, IPHPPartitionScannerConstants.HTML); + reconciler.setRepairer(dr, IPHPPartitionScannerConstants.HTML); + dr = new DefaultDamagerRepairer(getHTMLScanner()); + reconciler.setDamager(dr, IPHPPartitionScannerConstants.CSS); + reconciler.setRepairer(dr, IPHPPartitionScannerConstants.CSS); + dr = new DefaultDamagerRepairer(getHTMLScanner()); + reconciler.setDamager(dr, IPHPPartitionScannerConstants.CSS_MULTILINE_COMMENT); + reconciler.setRepairer(dr, IPHPPartitionScannerConstants.CSS_MULTILINE_COMMENT); + dr = new DefaultDamagerRepairer(getHTMLScanner()); + reconciler.setDamager(dr, IPHPPartitionScannerConstants.JAVASCRIPT); + reconciler.setRepairer(dr, IPHPPartitionScannerConstants.JAVASCRIPT); + dr = new DefaultDamagerRepairer(getHTMLScanner()); + reconciler.setDamager(dr, IPHPPartitionScannerConstants.JS_MULTILINE_COMMENT); + reconciler.setRepairer(dr, IPHPPartitionScannerConstants.JS_MULTILINE_COMMENT); + dr = + new DefaultDamagerRepairer( + new SingleTokenScanner(new TextAttribute(fJavaTextTools.getColorManager().getColor(PHPColorProvider.MULTI_LINE_COMMENT)))); + reconciler.setDamager(dr, IPHPPartitionScannerConstants.HTML_MULTILINE_COMMENT); + reconciler.setRepairer(dr, IPHPPartitionScannerConstants.HTML_MULTILINE_COMMENT); + + dr = new DefaultDamagerRepairer(getCodeScanner()); + reconciler.setDamager(dr, IPHPPartitionScannerConstants.PHP); + reconciler.setRepairer(dr, IPHPPartitionScannerConstants.PHP); + + dr = new DefaultDamagerRepairer(getPHPDocScanner()); + reconciler.setDamager(dr, IPHPPartitionScannerConstants.PHP_MULTILINE_COMMENT); + reconciler.setRepairer(dr, IPHPPartitionScannerConstants.PHP_MULTILINE_COMMENT); + + return reconciler; + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public int getTabWidth(ISourceViewer sourceViewer) { + return getPreferenceStore().getInt(PREFERENCE_TAB_WIDTH); + } + + /* (non-Javadoc) + * Method declared on SourceViewerConfiguration + */ + public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { + IFile f = ((IFileEditorInput) fEditor.getEditorInput()).getFile(); + return new PHPTextHover(f.getProject()); + } } diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPTextHover.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPTextHover.java index cc93029..308f746 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPTextHover.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPTextHover.java @@ -11,12 +11,19 @@ Contributors: **********************************************************************/ package net.sourceforge.phpeclipse.phpeditor; +import java.io.FileReader; +import java.io.IOException; import java.util.HashMap; +import java.util.List; import java.util.Vector; +import net.sourceforge.phpeclipse.PHPeclipsePlugin; +import net.sourceforge.phpeclipse.builder.IdentifierIndexManager; +import net.sourceforge.phpeclipse.builder.PHPIdentifierLocation; import net.sourceforge.phpeclipse.phpeditor.php.PHPElement; import net.sourceforge.phpeclipse.phpeditor.php.PHPWordExtractor; +import org.eclipse.core.resources.IProject; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextHover; import org.eclipse.jface.text.ITextViewer; @@ -24,14 +31,18 @@ import org.eclipse.jface.text.Region; import org.eclipse.swt.graphics.Point; /** - * Example implementation for an ITextHover + * Implementation for an ITextHover * which hovers over PHP code. */ public class PHPTextHover implements ITextHover { public static HashMap functionDescriptions = null; private static PHPWordExtractor phpWordDetector = new PHPWordExtractor(); - + private IProject fProject; + + public PHPTextHover(IProject project) { + fProject = project; + } /* (non-Javadoc) * Method declared on ITextHover */ @@ -50,8 +61,7 @@ public class PHPTextHover implements ITextHover { String strbuffer = null; PHPElement elbuffer = null; while ((syntaxbuffer != null) - && (!syntaxbuffer.isEmpty() && - ((elbuffer = (PHPElement) syntaxbuffer.remove(0)) != null))) { + && (!syntaxbuffer.isEmpty() && ((elbuffer = (PHPElement) syntaxbuffer.remove(0)) != null))) { functionDescriptions.put(elbuffer.getName(), elbuffer.getHoverText()); } @@ -60,7 +70,45 @@ public class PHPTextHover implements ITextHover { // functionDescriptions.put(PHPFunctionNasmes.FUNCTION_NAMES[i],PHPFunctionDescription.FUNCTION_DESCRIPTION[i]); // } } - return (String) functionDescriptions.get(word); + String hoverInfo = (String) functionDescriptions.get(word); + if (hoverInfo == null && fProject != null) { + // get the possible PHPDoc information from the index file + IdentifierIndexManager indexManager = PHPeclipsePlugin.getDefault().getIndexManager(fProject); + List list = indexManager.getLocations(word); + if (list.size() > 0) { + try { + PHPIdentifierLocation location; + String filename; + FileReader phpdocFileReader; + StringBuffer hoverInfoBuffer = new StringBuffer(); + String workspaceLocation = PHPeclipsePlugin.getWorkspace().getRoot().getLocation().toString(); + boolean foundPHPdoc = false; + for (int i = 0; i < list.size(); i++) { + location = (PHPIdentifierLocation) list.get(0); + if (location.getPHPDocOffset() >= 0) { + foundPHPdoc = true; + filename = workspaceLocation + location.getFilename(); + phpdocFileReader = new FileReader(filename); + hoverInfoBuffer.append("PHPdoc found in file: "); + hoverInfoBuffer.append(filename); + hoverInfoBuffer.append('\n'); + char[] charArray = new char[location.getPHPDocLength()]; + phpdocFileReader.skip(location.getPHPDocOffset()); + phpdocFileReader.read(charArray, 0, location.getPHPDocLength()); + hoverInfoBuffer.append(charArray); + hoverInfoBuffer.append('\n'); + } + } + if (foundPHPdoc) { + hoverInfo = hoverInfoBuffer.toString(); + } + } catch (Throwable e) { + // ignore exceptions + // e.printStackTrace(); + } + } + } + return hoverInfo; } // } catch (BadLocationException x) { } catch (Exception x) { diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPUnitEditor.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPUnitEditor.java index af5cf00..37f9bbe 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPUnitEditor.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPUnitEditor.java @@ -7,7 +7,6 @@ import java.util.List; import java.util.Map; import net.sourceforge.phpdt.internal.compiler.parser.Scanner; -import net.sourceforge.phpdt.internal.ui.actions.CompositeActionGroup; import net.sourceforge.phpdt.internal.ui.text.ContentAssistPreference; import net.sourceforge.phpdt.internal.ui.text.PHPPairMatcher; import net.sourceforge.phpdt.internal.ui.text.link.LinkedPositionManager; @@ -77,6 +76,7 @@ Contributors: * PHP specific text editor. */ public class PHPUnitEditor extends PHPEditor { + interface ITextConverter { void customizeDocumentCommand(IDocument document, DocumentCommand command); };