--- /dev/null
+/*
+ * Created on 20.09.2003
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package net.sourceforge.phpdt.internal.corext.phpdoc;
+
+import java.io.FileReader;
+import java.io.IOException;
+
+import net.sourceforge.phpeclipse.builder.PHPIdentifierLocation;
+
+/**
+ * @author khartlage
+ *
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public class PHPDocUtil {
+
+ /**
+ * Generate a PHPDoc hover text if possible
+ *
+ * @param hoverInfoBuffer
+ * @param filename
+ * @param location
+ */
+ public static void appendPHPDoc(StringBuffer hoverInfoBuffer, String filename, PHPIdentifierLocation location) {
+ hoverInfoBuffer.append(location.toString());
+ hoverInfoBuffer.append('\n');
+ if (location.getPHPDocOffset() >= 0) {
+ FileReader phpdocFileReader;
+ try {
+ phpdocFileReader = new FileReader(filename);
+
+ char[] charArray = new char[location.getPHPDocLength()];
+ phpdocFileReader.skip(location.getPHPDocOffset());
+ phpdocFileReader.read(charArray, 0, location.getPHPDocLength());
+ PHPDocCharArrayCommentReader phpdocConverter = new PHPDocCharArrayCommentReader(charArray);
+ hoverInfoBuffer.append(phpdocConverter.getString());
+ hoverInfoBuffer.append('\n');
+ } catch (IOException e) {
+ }
+ }
+ }
+}
protected static final String CTOOL_PREFIX = "ctool16";
public static final String IMG_CLASS = NAME_PREFIX + "class_obj.gif";
+ public static final String IMG_DEFINE = NAME_PREFIX + "define_obj.gif";
public static final String IMG_BUILTIN = NAME_PREFIX + "builtin_obj.gif";
public static final String IMG_FUN = NAME_PREFIX + "fun_obj.gif";
public static final String IMG_INC = NAME_PREFIX + "impc_obj.gif";
public static final ImageDescriptor DESC_CLASS =
createManaged(OBJ_PREFIX, IMG_CLASS);
+ public static final ImageDescriptor DESC_DEFINE =
+ createManaged(OBJ_PREFIX, IMG_DEFINE);
public static final ImageDescriptor DESC_BUILTIN =
createManaged(OBJ_PREFIX, IMG_BUILTIN);
public static final ImageDescriptor DESC_FUN =
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.ui.IEditorPart;
/**
* Simple PHPDoc completion processor.
import net.sourceforge.phpdt.internal.corext.template.php.PHPUnitContext;
import net.sourceforge.phpdt.internal.ui.PHPUiImages;
import net.sourceforge.phpdt.internal.ui.text.java.IPHPCompletionProposal;
+import net.sourceforge.phpeclipse.PHPeclipsePlugin;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
public class BuiltInEngine {
- /** The context type. */
- private ContextType fContextType;
- /** The result proposals. */
- private ArrayList fProposals= new ArrayList();
+ /** The context type. */
+ private ContextType fContextType;
+ /** The result proposals. */
+ private ArrayList fProposals = new ArrayList();
- /**
- * Creates the template engine for a particular context type.
- * See <code>TemplateContext</code> for supported context types.
- */
- public BuiltInEngine(ContextType contextType) {
- // Assert.isNotNull(contextType);
- fContextType= contextType;
- }
+ /**
+ * Creates the template engine for a particular context type.
+ * See <code>TemplateContext</code> for supported context types.
+ */
+ public BuiltInEngine(ContextType contextType) {
+ // Assert.isNotNull(contextType);
+ fContextType = contextType;
+ }
- /**
- * Empties the collector.
- *
- * @param viewer the text viewer
- * @param unit the compilation unit (may be <code>null</code>)
- */
- public void reset() {
- fProposals.clear();
- }
+ /**
+ * Empties the collector.
+ *
+ * @param viewer the text viewer
+ * @param unit the compilation unit (may be <code>null</code>)
+ */
+ public void reset() {
+ fProposals.clear();
+ }
- /**
- * Returns the array of matching templates.
- */
- public IPHPCompletionProposal[] getResults() {
- return (IPHPCompletionProposal[]) fProposals.toArray(new IPHPCompletionProposal[fProposals.size()]);
- }
+ /**
+ * Returns the array of matching templates.
+ */
+ public IPHPCompletionProposal[] getResults() {
+ return (IPHPCompletionProposal[]) fProposals.toArray(new IPHPCompletionProposal[fProposals.size()]);
+ }
- /**
- * Inspects the context of the compilation unit around <code>completionPosition</code>
- * and feeds the collector with proposals.
- * @param viewer the text viewer
- * @param completionPosition the context position in the document of the text viewer
- * @param compilationUnit the compilation unit (may be <code>null</code>)
- */
- public void complete(ITextViewer viewer, int completionPosition, Object[] identifiers)
+ /**
+ * Inspects the context of the compilation unit around <code>completionPosition</code>
+ * and feeds the collector with proposals.
+ * @param viewer the text viewer
+ * @param completionPosition the context position in the document of the text viewer
+ * @param compilationUnit the compilation unit (may be <code>null</code>)
+ */
+ public void complete(ITextViewer viewer, int completionPosition, Object[] identifiers)
//,ICompilationUnit compilationUnit)
- //hrows JavaModelException
- {
- IDocument document= viewer.getDocument();
-
- // prohibit recursion
-// if (LinkedPositionManager.hasActiveManager(document))
-// return;
+ //hrows JavaModelException
+ {
+ IDocument document = viewer.getDocument();
- if (!(fContextType instanceof CompilationUnitContextType))
- return;
- Point selection= viewer.getSelectedRange();
+ // prohibit recursion
+ // if (LinkedPositionManager.hasActiveManager(document))
+ // return;
+
+ if (!(fContextType instanceof CompilationUnitContextType))
+ return;
+ Point selection = viewer.getSelectedRange();
// remember selected text
- String selectedText= null;
+ String selectedText = null;
if (selection.y != 0) {
try {
- selectedText= document.get(selection.x, selection.y);
- } catch (BadLocationException e) {}
+ selectedText = document.get(selection.x, selection.y);
+ } catch (BadLocationException e) {
+ }
}
-
- ((CompilationUnitContextType) fContextType).setContextParameters(document, completionPosition, selection.y);//mpilationUnit);
- PHPUnitContext context= (PHPUnitContext) fContextType.createContext();
- int start= context.getStart();
- int end= context.getEnd();
- IRegion region= new Region(start, end - start);
+ ((CompilationUnitContextType) fContextType).setContextParameters(document, completionPosition, selection.y); //mpilationUnit);
-// Template[] templates= Templates.getInstance().getTemplates();
+ PHPUnitContext context = (PHPUnitContext) fContextType.createContext();
+ int start = context.getStart();
+ int end = context.getEnd();
+ IRegion region = new Region(start, end - start);
+
+ // Template[] templates= Templates.getInstance().getTemplates();
String identifier = null;
- for (int i= 0; i != identifiers.length; i++) {
+ int maxProposals = PHPeclipsePlugin.MAX_PROPOSALS;
+ for (int i = 0; i != identifiers.length; i++) {
identifier = (String) identifiers[i];
- if (context.canEvaluate(identifier)) {
- fProposals.add(new BuiltInProposal(identifier, context, region, viewer, PHPUiImages.get(PHPUiImages.IMG_BUILTIN)));
+ if (context.canEvaluate(identifier)) {
+ if (maxProposals-- < 0) {
+ return;
+ }
+ fProposals.add(new BuiltInProposal(identifier, context, region, viewer, PHPUiImages.get(PHPUiImages.IMG_BUILTIN)));
}
}
- }
+ }
}
-
import net.sourceforge.phpdt.internal.corext.template.ContextType;
import net.sourceforge.phpdt.internal.corext.template.php.CompilationUnitContextType;
import net.sourceforge.phpdt.internal.corext.template.php.PHPUnitContext;
-import net.sourceforge.phpdt.internal.ui.PHPUiImages;
import net.sourceforge.phpdt.internal.ui.text.java.IPHPCompletionProposal;
+import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+import net.sourceforge.phpeclipse.builder.PHPIdentifierLocation;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
PHPUnitContext context = (PHPUnitContext) fContextType.createContext();
int start = context.getStart();
int end = context.getEnd();
- String prefix = context.getKey();
+ String prefix = context.getKey();
IRegion region = new Region(start, end - start);
String identifier = null;
-
- SortedMap subMap = map.subMap(prefix,prefix+'\255');
- Iterator iter = subMap.keySet().iterator();
+ SortedMap subMap = map.subMap(prefix, prefix + '\255');
+ Iterator iter = subMap.keySet().iterator();
+ PHPIdentifierLocation location;
+ ArrayList list;
+ int maxProposals = PHPeclipsePlugin.MAX_PROPOSALS;
while (iter.hasNext()) {
identifier = (String) iter.next();
if (context.canEvaluate(identifier)) {
- fProposals.add(
- new DeclarationProposal(
- identifier,
- context,
- region,
- viewer,
- PHPUiImages.get(PHPUiImages.IMG_FUN),
- PHPUiImages.get(PHPUiImages.IMG_VAR)));
+ list = (ArrayList) subMap.get(identifier);
+ for (int i = 0; i < list.size(); i++) {
+ if (maxProposals-- < 0) {
+ return;
+ }
+ fProposals.add(new DeclarationProposal(identifier, (PHPIdentifierLocation) list.get(i), context, region, viewer));
+ }
}
}
*/
package net.sourceforge.phpdt.internal.ui.text.template;
+import net.sourceforge.phpdt.internal.corext.phpdoc.PHPDocUtil;
import net.sourceforge.phpdt.internal.corext.template.TemplateContext;
import net.sourceforge.phpdt.internal.corext.template.TemplateMessages;
import net.sourceforge.phpdt.internal.corext.template.php.PHPUnitContext;
+import net.sourceforge.phpdt.internal.ui.PHPUiImages;
import net.sourceforge.phpdt.internal.ui.text.java.IPHPCompletionProposal;
import net.sourceforge.phpdt.internal.ui.text.link.LinkedPositionManager;
import net.sourceforge.phpdt.internal.ui.text.link.LinkedPositionUI;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+import net.sourceforge.phpeclipse.builder.PHPIdentifierLocation;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.MessageDialog;
public class DeclarationProposal implements IPHPCompletionProposal {
private final String fTemplate;
+ private final PHPIdentifierLocation fLocation;
private final TemplateContext fContext;
private final ITextViewer fViewer;
- private final Image fImage_fun;
- private final Image fImage_var;
+ // private final Image fImage_fun;
+ // private final Image fImage_var;
private final IRegion fRegion;
//private TemplateBuffer fTemplateBuffer;
* @param context the context in which the template was requested.
* @param image the icon of the proposal.
*/
- public DeclarationProposal(String template, TemplateContext context, IRegion region, ITextViewer viewer, Image image_fun, Image image_var) {
- // Assert.isNotNull(template);
- // Assert.isNotNull(context);
- // Assert.isNotNull(region);
- // Assert.isNotNull(viewer);
-
+ public DeclarationProposal(
+ String template,
+ PHPIdentifierLocation location,
+ TemplateContext context,
+ IRegion region,
+ ITextViewer viewer) {
+ // Image image_fun,
+ // Image image_var) {
fTemplate = template;
+ fLocation = location;
fContext = context;
fViewer = viewer;
- fImage_fun= image_fun;
- fImage_var= image_var;
+ // fImage_fun = image_fun;
+ // fImage_var = image_var;
fRegion = region;
}
int end = fRegion.getOffset() + fRegion.getLength();
// insert template string
- // String templateString = fTemplate; // fTemplateBuffer.getString();
+ // String templateString = fTemplate; // fTemplateBuffer.getString();
document.replace(start, end - start, fTemplate);
// translate positions
// }
LinkedPositionUI editor = new LinkedPositionUI(fViewer, manager);
- editor.setFinalCaretOffset(fTemplate.length()+start);
- // editor.setFinalCaretOffset(getCaretOffset(fTemplateBuffer) + start);
+ editor.setFinalCaretOffset(fTemplate.length() + start);
+ // editor.setFinalCaretOffset(getCaretOffset(fTemplateBuffer) + start);
editor.enter();
fSelectedRegion = editor.getSelectedRegion();
// }
}
-// private static int getCaretOffset(TemplateBuffer buffer) {
-// TemplatePosition[] variables = buffer.getVariables();
-// for (int i = 0; i != variables.length; i++) {
-// TemplatePosition variable = variables[i];
-//
-// if (variable.getName().equals(JavaTemplateMessages.getString("GlobalVariables.variable.name.cursor"))) //$NON-NLS-1$
-// return variable.getOffsets()[0];
-// }
-//
-// return buffer.getString().length();
-// }
+ // private static int getCaretOffset(TemplateBuffer buffer) {
+ // TemplatePosition[] variables = buffer.getVariables();
+ // for (int i = 0; i != variables.length; i++) {
+ // TemplatePosition variable = variables[i];
+ //
+ // if (variable.getName().equals(JavaTemplateMessages.getString("GlobalVariables.variable.name.cursor"))) //$NON-NLS-1$
+ // return variable.getOffsets()[0];
+ // }
+ //
+ // return buffer.getString().length();
+ // }
/*
* @see ICompletionProposal#getSelection(IDocument)
* @see ICompletionProposal#getAdditionalProposalInfo()
*/
public String getAdditionalProposalInfo() {
- // try {
- // if (fTemplateBuffer == null)
- // fTemplateBuffer= fContext.evaluate(fTemplate);
-
- return textToHTML(fTemplate); // fTemplateBuffer.getString());
-
- // } catch (CoreException e) {
- // handleException(e);
- // return null;
- // }
+ StringBuffer hoverInfoBuffer = new StringBuffer();
+ String workspaceLocation = PHPeclipsePlugin.getWorkspace().getRoot().getLocation().toString();
+ String filename = workspaceLocation + fLocation.getFilename();
+ PHPDocUtil.appendPHPDoc(hoverInfoBuffer, filename, fLocation);
+ return textToHTML(hoverInfoBuffer.toString());
}
/*
* @see ICompletionProposal#getImage()
*/
public Image getImage() {
- if (fTemplate.charAt(0)=='$') {
- return fImage_var;
+ switch (fLocation.getType()) {
+ case PHPIdentifierLocation.FUNCTION :
+ return PHPUiImages.get(PHPUiImages.IMG_FUN);
+ case PHPIdentifierLocation.CLASS :
+ return PHPUiImages.get(PHPUiImages.IMG_CLASS);
+ case PHPIdentifierLocation.METHOD :
+ return PHPUiImages.get(PHPUiImages.IMG_FUN);
+ case PHPIdentifierLocation.DEFINE :
+ return PHPUiImages.get(PHPUiImages.IMG_DEFINE);
+ case PHPIdentifierLocation.VARIABLE :
+ return PHPUiImages.get(PHPUiImages.IMG_VAR);
}
- return fImage_fun;
+ return PHPUiImages.get(PHPUiImages.IMG_FUN);
}
/*
import net.sourceforge.phpdt.internal.corext.template.php.PHPUnitContext;
import net.sourceforge.phpdt.internal.ui.PHPUiImages;
import net.sourceforge.phpdt.internal.ui.text.java.IPHPCompletionProposal;
+import net.sourceforge.phpeclipse.PHPeclipsePlugin;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
// Template[] templates= Templates.getInstance().getTemplates();
String identifier = null;
+ int maxProposals = PHPeclipsePlugin.MAX_PROPOSALS;
+
for (int i = 0; i != identifiers.length; i++) {
identifier = (String) identifiers[i];
if (context.canEvaluate(identifier)) {
+ if (maxProposals-- < 0) {
+ return;
+ }
fProposals.add(
new IdentifierProposal(
identifier,
import net.sourceforge.phpdt.internal.corext.template.php.CompilationUnitContextType;
import net.sourceforge.phpdt.internal.ui.PHPUiImages;
import net.sourceforge.phpdt.internal.ui.text.java.IPHPCompletionProposal;
+import net.sourceforge.phpeclipse.PHPeclipsePlugin;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
public class TemplateEngine {
- /** The context type. */
- private ContextType fContextType;
- /** The result proposals. */
- private ArrayList fProposals= new ArrayList();
+ /** The context type. */
+ private ContextType fContextType;
+ /** The result proposals. */
+ private ArrayList fProposals = new ArrayList();
- /**
- * Creates the template engine for a particular context type.
- * See <code>TemplateContext</code> for supported context types.
- */
- public TemplateEngine(ContextType contextType) {
- // Assert.isNotNull(contextType);
- fContextType= contextType;
- }
+ /**
+ * Creates the template engine for a particular context type.
+ * See <code>TemplateContext</code> for supported context types.
+ */
+ public TemplateEngine(ContextType contextType) {
+ // Assert.isNotNull(contextType);
+ fContextType = contextType;
+ }
- /**
- * Empties the collector.
- *
- * @param viewer the text viewer
- * @param unit the compilation unit (may be <code>null</code>)
- */
- public void reset() {
- fProposals.clear();
- }
+ /**
+ * Empties the collector.
+ *
+ * @param viewer the text viewer
+ * @param unit the compilation unit (may be <code>null</code>)
+ */
+ public void reset() {
+ fProposals.clear();
+ }
- /**
- * Returns the array of matching templates.
- */
- public IPHPCompletionProposal[] getResults() {
- return (IPHPCompletionProposal[]) fProposals.toArray(new IPHPCompletionProposal[fProposals.size()]);
- }
+ /**
+ * Returns the array of matching templates.
+ */
+ public IPHPCompletionProposal[] getResults() {
+ return (IPHPCompletionProposal[]) fProposals.toArray(new IPHPCompletionProposal[fProposals.size()]);
+ }
- /**
- * Inspects the context of the compilation unit around <code>completionPosition</code>
- * and feeds the collector with proposals.
- * @param viewer the text viewer
- * @param completionPosition the context position in the document of the text viewer
- * @param compilationUnit the compilation unit (may be <code>null</code>)
- */
- public void complete(ITextViewer viewer, int completionPosition)
+ /**
+ * Inspects the context of the compilation unit around <code>completionPosition</code>
+ * and feeds the collector with proposals.
+ * @param viewer the text viewer
+ * @param completionPosition the context position in the document of the text viewer
+ * @param compilationUnit the compilation unit (may be <code>null</code>)
+ */
+ public void complete(ITextViewer viewer, int completionPosition)
//,ICompilationUnit compilationUnit)
- //hrows JavaModelException
- {
- IDocument document= viewer.getDocument();
-
- // prohibit recursion
-// if (LinkedPositionManager.hasActiveManager(document))
-// return;
+ //hrows JavaModelException
+ {
+ IDocument document = viewer.getDocument();
- if (!(fContextType instanceof CompilationUnitContextType))
- return;
-
- Point selection= viewer.getSelectedRange();
+ if (!(fContextType instanceof CompilationUnitContextType))
+ return;
+
+ Point selection = viewer.getSelectedRange();
// remember selected text
- String selectedText= null;
+ String selectedText = null;
if (selection.y != 0) {
try {
- selectedText= document.get(selection.x, selection.y);
- } catch (BadLocationException e) {}
+ selectedText = document.get(selection.x, selection.y);
+ } catch (BadLocationException e) {
+ }
}
-
- ((CompilationUnitContextType) fContextType).setContextParameters(document, completionPosition, selection.y);//mpilationUnit);
- DocumentTemplateContext context= (DocumentTemplateContext) fContextType.createContext();
- int start= context.getStart();
- int end= context.getEnd();
- IRegion region= new Region(start, end - start);
- Template[] templates= Templates.getInstance().getTemplates();
- for (int i= 0; i != templates.length; i++)
- if (context.canEvaluate(templates[i]))
- fProposals.add(new TemplateProposal(templates[i], context, region, viewer, PHPUiImages.get(PHPUiImages.IMG_OBJS_TEMPLATE)));
- }
+ ((CompilationUnitContextType) fContextType).setContextParameters(document, completionPosition, selection.y); //mpilationUnit);
+ DocumentTemplateContext context = (DocumentTemplateContext) fContextType.createContext();
+ int start = context.getStart();
+ int end = context.getEnd();
+ IRegion region = new Region(start, end - start);
-}
+ Template[] templates = Templates.getInstance().getTemplates();
+ int maxProposals = PHPeclipsePlugin.MAX_PROPOSALS;
+ for (int i = 0; i != templates.length; i++)
+ if (context.canEvaluate(templates[i])) {
+ if (maxProposals-- < 0) {
+ return;
+ }
+ fProposals.add(new TemplateProposal(templates[i], context, region, viewer, PHPUiImages.get(PHPUiImages.IMG_OBJS_TEMPLATE)));
+ }
+ }
+
+}
/** General debug flag*/
public static final boolean DEBUG = false;
+ /**
+ * The maximum number of allowed proposals by category
+ */
+ public final static int MAX_PROPOSALS = 200;
+
private static ExternalToolsPlugin externalTools;
/**
/** Windows NT */
private static final int WINDOWS_NT = 5;
private PHPDocumentProvider fCompilationUnitDocumentProvider;
- //Resource bundle.
- //private ResourceBundle resourceBundle;
-
+
private ImageDescriptorRegistry fImageDescriptorRegistry;
private HashMap fIndexManagerMap = new HashMap();
private JavaTextTools fJavaTextTools;
private IFile fLastEditorFile = null;
+
/**
* The constructor.
*/
* @see java.lang.Object#toString()
*/
public String toString() {
- return super.toString()+fFilename;
+ return super.toString()+"\n"+fFilename;
}
}
import net.sourceforge.phpdt.internal.compiler.parser.Outlineable;
import net.sourceforge.phpdt.internal.compiler.parser.OutlineableWithChildren;
import net.sourceforge.phpdt.internal.compiler.parser.PHPOutlineInfo;
-import net.sourceforge.phpdt.internal.compiler.parser.PHPSegment;
-import net.sourceforge.phpdt.internal.compiler.parser.PHPSegmentWithChildren;
import net.sourceforge.phpdt.internal.ui.viewsupport.ImageDescriptorRegistry;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.*;
+import org.eclipse.jface.text.BadPositionCategoryException;
+import org.eclipse.jface.text.DefaultPositionUpdater;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IPositionUpdater;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.preference.IPreferenceStore;
import java.util.List;
import java.util.Vector;
-import net.sourceforge.phpdt.internal.corext.phpdoc.PHPDocCharArrayCommentReader;
+import net.sourceforge.phpdt.internal.corext.phpdoc.PHPDocUtil;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
import net.sourceforge.phpeclipse.builder.IdentifierIndexManager;
import net.sourceforge.phpeclipse.builder.PHPIdentifierLocation;
PHPIdentifierLocation location;
String filename;
FileReader phpdocFileReader;
- PHPDocCharArrayCommentReader phpdocConverter;
+ // PHPDocCharArrayCommentReader phpdocConverter;
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(i);
filename = workspaceLocation + location.getFilename();
- hoverInfoBuffer.append(location.toString());
- hoverInfoBuffer.append('\n');
- if (location.getPHPDocOffset() >= 0) {
- // foundPHPdoc = true;
- phpdocFileReader = new FileReader(filename);
- char[] charArray = new char[location.getPHPDocLength()];
- phpdocFileReader.skip(location.getPHPDocOffset());
- phpdocFileReader.read(charArray, 0, location.getPHPDocLength());
- phpdocConverter = new PHPDocCharArrayCommentReader(charArray);
- hoverInfoBuffer.append(phpdocConverter.getString());
- hoverInfoBuffer.append('\n');
- }
+ PHPDocUtil.appendPHPDoc(hoverInfoBuffer, filename, location);
+//
+// hoverInfoBuffer.append(location.toString());
+// hoverInfoBuffer.append('\n');
+// if (location.getPHPDocOffset() >= 0) {
+// // foundPHPdoc = true;
+// phpdocFileReader = new FileReader(filename);
+// char[] charArray = new char[location.getPHPDocLength()];
+// phpdocFileReader.skip(location.getPHPDocOffset());
+// phpdocFileReader.read(charArray, 0, location.getPHPDocLength());
+// phpdocConverter = new PHPDocCharArrayCommentReader(charArray);
+// hoverInfoBuffer.append(phpdocConverter.getString());
+// hoverInfoBuffer.append('\n');
+// }
}
// if (foundPHPdoc) {
hoverInfo = hoverInfoBuffer.toString();