mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
Bug 486672 - Syntax coloring of variable template instances
Change-Id: I32a2fd3bc64f88e368924acafca1d1e596c90877
This commit is contained in:
parent
3c8a5002ba
commit
abcedff7d7
2 changed files with 27 additions and 0 deletions
|
@ -554,4 +554,19 @@ public class SemanticHighlightingTest extends TestCase {
|
||||||
public void testRecursion_491834() throws Exception {
|
public void testRecursion_491834() throws Exception {
|
||||||
makeAssertions();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,6 +252,10 @@ public class SemanticHighlightings {
|
||||||
if (name instanceof ICPPASTQualifiedName && name.isReference()) {
|
if (name instanceof ICPPASTQualifiedName && name.isReference()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (name instanceof ICPPASTTemplateId) {
|
||||||
|
// Variable template instance - do not color the entire template-id.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
IBinding binding= token.getBinding();
|
IBinding binding= token.getBinding();
|
||||||
if (binding instanceof IField && !(binding instanceof IProblemBinding)) {
|
if (binding instanceof IField && !(binding instanceof IProblemBinding)) {
|
||||||
return ((IField)binding).isStatic();
|
return ((IField)binding).isStatic();
|
||||||
|
@ -303,6 +307,10 @@ public class SemanticHighlightings {
|
||||||
if (name instanceof ICPPASTQualifiedName && name.isReference()) {
|
if (name instanceof ICPPASTQualifiedName && name.isReference()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (name instanceof ICPPASTTemplateId) {
|
||||||
|
// Variable template instance - do not color the entire template-id.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
IBinding binding= token.getBinding();
|
IBinding binding= token.getBinding();
|
||||||
if (binding instanceof IField) {
|
if (binding instanceof IField) {
|
||||||
if (binding instanceof ICPPUnknownBinding) {
|
if (binding instanceof ICPPUnknownBinding) {
|
||||||
|
@ -847,6 +855,10 @@ public class SemanticHighlightings {
|
||||||
if (name instanceof ICPPASTQualifiedName) {
|
if (name instanceof ICPPASTQualifiedName) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (name instanceof ICPPASTTemplateId) {
|
||||||
|
// Variable template instance - do not color the entire template-id.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
IBinding binding= token.getBinding();
|
IBinding binding= token.getBinding();
|
||||||
if (binding instanceof IVariable
|
if (binding instanceof IVariable
|
||||||
&& !(binding instanceof IField)
|
&& !(binding instanceof IField)
|
||||||
|
|
Loading…
Add table
Reference in a new issue