1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 01:15:29 +02:00

Bug 334405 - Source hover is sometimes imprecise

Patch by Marc-Andre Laperle
This commit is contained in:
Anton Leherbauer 2011-01-17 10:27:55 +00:00
parent c50b35dc33
commit 03518d718f

View file

@ -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;