mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-02 13:13:36 +02:00
Bug 451772 - Syntax-color names of structures in C files
Change-Id: I193648ffd15f581af75f71d62261068543a5769d Signed-off-by: Nathan Ridge <zeratul976@hotmail.com> Reviewed-on: https://git.eclipse.org/r/36887 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
17ec42f5cd
commit
c78d2fe823
2 changed files with 8 additions and 1 deletions
|
@ -420,4 +420,10 @@ public class SemanticHighlightingTest extends TestCase {
|
||||||
public void testDependentMethodCall_379626() throws Exception {
|
public void testDependentMethodCall_379626() throws Exception {
|
||||||
makeAssertions();
|
makeAssertions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// struct S {}; //$class
|
||||||
|
// struct S waldo; //$class,globalVariable
|
||||||
|
public void testCStructureName_451772() throws Exception {
|
||||||
|
makeAssertions(false /* parse as C file */);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTProblem;
|
import org.eclipse.cdt.core.dom.ast.IASTProblem;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ICompositeType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IEnumeration;
|
import org.eclipse.cdt.core.dom.ast.IEnumeration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IEnumerator;
|
import org.eclipse.cdt.core.dom.ast.IEnumerator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IField;
|
import org.eclipse.cdt.core.dom.ast.IField;
|
||||||
|
@ -946,7 +947,7 @@ public class SemanticHighlightings {
|
||||||
}
|
}
|
||||||
if (node instanceof IASTName) {
|
if (node instanceof IASTName) {
|
||||||
IBinding binding= token.getBinding();
|
IBinding binding= token.getBinding();
|
||||||
if (binding instanceof ICPPClassType && !(binding instanceof ICPPTemplateParameter)) {
|
if (binding instanceof ICompositeType && !(binding instanceof ICPPTemplateParameter)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue