diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CTypeHover.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CTypeHover.java index 647db0f5ddb..461436af84a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CTypeHover.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CTypeHover.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,6 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Sergey Prigogin (Google) + * Marc-Andre Laperle - bug 282495 *******************************************************************************/ package org.eclipse.cdt.internal.ui.text.c.hover; @@ -28,6 +29,7 @@ import org.eclipse.cdt.ui.text.c.hover.ICEditorTextHover; public class CTypeHover implements ICEditorTextHover, ITextHoverExtension, ITextHoverExtension2, IInformationProviderExtension2 { private AbstractCEditorTextHover fProblemHover; private AbstractCEditorTextHover fCDocHover; + private AbstractCEditorTextHover fBestMatchHover; private AbstractCEditorTextHover fCurrentHover; @@ -35,6 +37,7 @@ public class CTypeHover implements ICEditorTextHover, ITextHoverExtension, IText fProblemHover= new ProblemHover(); fCDocHover= new CDocHover(); fCurrentHover= null; + fBestMatchHover = new BestMatchHover(); } /* @@ -43,6 +46,7 @@ public class CTypeHover implements ICEditorTextHover, ITextHoverExtension, IText public void setEditor(IEditorPart editor) { fProblemHover.setEditor(editor); fCDocHover.setEditor(editor); + fBestMatchHover.setEditor(editor); fCurrentHover= null; } @@ -74,8 +78,17 @@ public class CTypeHover implements ICEditorTextHover, ITextHoverExtension, IText return hoverInfo; } - fCurrentHover= fCDocHover; - return fCDocHover.getHoverInfo2(textViewer, hoverRegion); + hoverInfo = fCDocHover.getHoverInfo2(textViewer, hoverRegion); + if(hoverInfo != null){ + fCurrentHover= fCDocHover; + } + + hoverInfo = fBestMatchHover.getHoverInfo(textViewer, hoverRegion); + if(hoverInfo != null){ + fCurrentHover = fBestMatchHover; + } + + return hoverInfo; } /*