From 012a23cc5392e7aa8c12a61c68033994c37dcbc4 Mon Sep 17 00:00:00 2001 From: axelcl Date: Mon, 29 Aug 2005 16:34:33 +0000 Subject: [PATCH] Ignore case for functions in the PHP hover --- .../phpeclipse/phpeditor/PHPTextHover.java | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) 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 22e1470..ba13146 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPTextHover.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPTextHover.java @@ -21,6 +21,7 @@ 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.PHPFunction; import net.sourceforge.phpeclipse.phpeditor.php.PHPWordExtractor; import org.eclipse.core.resources.IProject; @@ -34,9 +35,9 @@ import org.eclipse.swt.graphics.Point; * Implementation for an ITextHover which hovers over PHP code. */ public class PHPTextHover implements ITextHover { - public static HashMap functionDescriptions = null; + private static HashMap functionDescriptions = null; - private static PHPWordExtractor phpWordDetector = new PHPWordExtractor(); + private static HashMap identDescriptions = null; /** * The current project; maybe null for preference pages @@ -57,13 +58,18 @@ public class PHPTextHover implements ITextHover { String word = textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength()); if (functionDescriptions == null) { functionDescriptions = new HashMap(); + identDescriptions = new HashMap(); ArrayList syntaxbuffer = PHPSyntaxRdr.getSyntaxData(); String strbuffer = null; PHPElement elbuffer = null; if (syntaxbuffer != null) { for (int i = 0; i < syntaxbuffer.size(); i++) { elbuffer = (PHPElement) syntaxbuffer.get(i); - functionDescriptions.put(elbuffer.getName(), elbuffer.getHoverText()); + if (elbuffer instanceof PHPFunction) { + functionDescriptions.put(elbuffer.getName(), elbuffer.getHoverText()); + } else { + identDescriptions.put(elbuffer.getName(), elbuffer.getHoverText()); + } } } // @@ -74,7 +80,7 @@ public class PHPTextHover implements ITextHover { // elbuffer.getHoverText()); // } } - String hoverInfo = (String) functionDescriptions.get(word); + String hoverInfo = (String) identDescriptions.get(word); if (hoverInfo == null & word.length() > 0) { hoverInfo = (String) functionDescriptions.get(word.toLowerCase()); } -- 1.7.1