From 03518d718f307c4a569d074db246635aea787aa9 Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Mon, 17 Jan 2011 10:27:55 +0000 Subject: [PATCH] Bug 334405 - Source hover is sometimes imprecise Patch by Marc-Andre Laperle --- .../eclipse/cdt/internal/ui/text/c/hover/CSourceHover.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CSourceHover.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CSourceHover.java index 97a5563c0eb..3140888f431 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CSourceHover.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CSourceHover.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2010 QNX Software Systems and others. + * Copyright (c) 2002, 2011 QNX Software Systems 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 @@ -394,7 +394,7 @@ public class CSourceHover extends AbstractCEditorTextHover { } else if (binding instanceof IVariable) { type= ((IVariable)binding).getType(); } - expectClosingBrace= type instanceof ICompositeType || type instanceof IEnumeration; + expectClosingBrace= (type instanceof ICompositeType || type instanceof IEnumeration) && !(binding instanceof IVariable); final int nameLine= doc.getLineOfOffset(nameOffset); sourceStart= nameOffset; int commentBound; @@ -442,7 +442,7 @@ public class CSourceHover extends AbstractCEditorTextHover { boolean searchBrace= false; boolean searchSemi= false; boolean searchComma= false; - if (binding instanceof ICompositeType || binding instanceof IEnumeration) { + if (binding instanceof ICompositeType && isDefinition || binding instanceof IEnumeration) { searchBrace= true; } else if (binding instanceof ICPPTemplateDefinition) { searchBrace= true;