mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 09:55:29 +02:00
Fix check for IVariableDeclaration.
This commit is contained in:
parent
5914d59aca
commit
e301d1e30b
1 changed files with 2 additions and 2 deletions
|
@ -58,7 +58,7 @@ public class CElementLabelProvider extends LabelProvider {
|
||||||
if (element instanceof ICElement) {
|
if (element instanceof ICElement) {
|
||||||
ICElement celem= (ICElement)element;
|
ICElement celem= (ICElement)element;
|
||||||
|
|
||||||
String name;
|
String name = "";
|
||||||
switch(celem.getElementType()){
|
switch(celem.getElementType()){
|
||||||
case ICElement.C_FIELD:
|
case ICElement.C_FIELD:
|
||||||
case ICElement.C_VARIABLE:
|
case ICElement.C_VARIABLE:
|
||||||
|
@ -79,7 +79,7 @@ public class CElementLabelProvider extends LabelProvider {
|
||||||
case ICElement.C_ENUMERATION:
|
case ICElement.C_ENUMERATION:
|
||||||
if((celem.getElementName() != null) && (celem.getElementName().length() > 0)){
|
if((celem.getElementName() != null) && (celem.getElementName().length() > 0)){
|
||||||
name = celem.getElementName();
|
name = celem.getElementName();
|
||||||
} else {
|
} else if (celem instanceof IVariableDeclaration) {
|
||||||
IVariableDeclaration varDecl = (IVariableDeclaration) celem;
|
IVariableDeclaration varDecl = (IVariableDeclaration) celem;
|
||||||
name = varDecl.getTypeName();
|
name = varDecl.getTypeName();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue