mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Bug 334405 - Source hover is sometimes imprecise
Patch by Marc-Andre Laperle
This commit is contained in:
parent
c50b35dc33
commit
03518d718f
1 changed files with 3 additions and 3 deletions
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -394,7 +394,7 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
} else if (binding instanceof IVariable) {
|
} else if (binding instanceof IVariable) {
|
||||||
type= ((IVariable)binding).getType();
|
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);
|
final int nameLine= doc.getLineOfOffset(nameOffset);
|
||||||
sourceStart= nameOffset;
|
sourceStart= nameOffset;
|
||||||
int commentBound;
|
int commentBound;
|
||||||
|
@ -442,7 +442,7 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
boolean searchBrace= false;
|
boolean searchBrace= false;
|
||||||
boolean searchSemi= false;
|
boolean searchSemi= false;
|
||||||
boolean searchComma= false;
|
boolean searchComma= false;
|
||||||
if (binding instanceof ICompositeType || binding instanceof IEnumeration) {
|
if (binding instanceof ICompositeType && isDefinition || binding instanceof IEnumeration) {
|
||||||
searchBrace= true;
|
searchBrace= true;
|
||||||
} else if (binding instanceof ICPPTemplateDefinition) {
|
} else if (binding instanceof ICPPTemplateDefinition) {
|
||||||
searchBrace= true;
|
searchBrace= true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue