1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 486672 - Syntax coloring of variable template instances

Change-Id: I32a2fd3bc64f88e368924acafca1d1e596c90877
This commit is contained in:
Nathan Ridge 2016-06-13 13:30:41 -04:00
parent 3c8a5002ba
commit abcedff7d7
2 changed files with 27 additions and 0 deletions

View file

@ -554,4 +554,19 @@ public class SemanticHighlightingTest extends TestCase {
public void testRecursion_491834() throws Exception {
makeAssertions();
}
// template <typename T> //$templateParameter
// bool templ = true; //$globalVariable
// struct A {}; //$class
// bool x = templ<A>; //$globalVariable,globalVariable,class
// struct S { //$class
// template <typename U> //$templateParameter
// static bool templ = true; //$staticField
// void bar() { //$methodDeclaration
// bool y = templ<A>; //$localVariableDeclaration,staticField,class
// }
// };
public void testVariableTemplates_486672() throws Exception {
makeAssertions();
}
}

View file

@ -252,6 +252,10 @@ public class SemanticHighlightings {
if (name instanceof ICPPASTQualifiedName && name.isReference()) {
return false;
}
if (name instanceof ICPPASTTemplateId) {
// Variable template instance - do not color the entire template-id.
return false;
}
IBinding binding= token.getBinding();
if (binding instanceof IField && !(binding instanceof IProblemBinding)) {
return ((IField)binding).isStatic();
@ -303,6 +307,10 @@ public class SemanticHighlightings {
if (name instanceof ICPPASTQualifiedName && name.isReference()) {
return false;
}
if (name instanceof ICPPASTTemplateId) {
// Variable template instance - do not color the entire template-id.
return false;
}
IBinding binding= token.getBinding();
if (binding instanceof IField) {
if (binding instanceof ICPPUnknownBinding) {
@ -847,6 +855,10 @@ public class SemanticHighlightings {
if (name instanceof ICPPASTQualifiedName) {
return false;
}
if (name instanceof ICPPASTTemplateId) {
// Variable template instance - do not color the entire template-id.
return false;
}
IBinding binding= token.getBinding();
if (binding instanceof IVariable
&& !(binding instanceof IField)