mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for 209203: Wrong global variables syntax coloring for template parameters
This commit is contained in:
parent
7ebcda8101
commit
643f6c20d3
3 changed files with 13 additions and 0 deletions
|
@ -127,3 +127,10 @@ label:
|
|||
SDKFunction();
|
||||
return 0;
|
||||
}
|
||||
|
||||
//http://bugs.eclipse.org/209203
|
||||
template <int n>
|
||||
int f()
|
||||
{
|
||||
return n;
|
||||
}
|
||||
|
|
|
@ -193,6 +193,8 @@ public class SemanticHighlightingTest extends AbstractSemanticHighlightingTest {
|
|||
createPosition(77, 27, 2),
|
||||
createPosition(83, 15, 2),
|
||||
createPosition(83, 66, 2),
|
||||
createPosition(131, 14, 1),
|
||||
createPosition(134, 9, 1),
|
||||
};
|
||||
if (PRINT_POSITIONS) System.out.println(toString(actual));
|
||||
assertEqualPositions(expected, actual);
|
||||
|
@ -259,6 +261,7 @@ public class SemanticHighlightingTest extends AbstractSemanticHighlightingTest {
|
|||
createPosition(12, 12, 16),
|
||||
createPosition(19, 16, 10),
|
||||
createPosition(98, 8, 13),
|
||||
createPosition(132, 4, 1),
|
||||
};
|
||||
if (PRINT_POSITIONS) System.out.println(toString(actual));
|
||||
assertEqualPositions(expected, actual);
|
||||
|
@ -275,6 +278,7 @@ public class SemanticHighlightingTest extends AbstractSemanticHighlightingTest {
|
|||
createPosition(98, 8, 13),
|
||||
createPosition(99, 1, 16),
|
||||
createPosition(126, 4, 11),
|
||||
createPosition(132, 4, 1),
|
||||
};
|
||||
if (PRINT_POSITIONS) System.out.println(toString(actual));
|
||||
assertEqualPositions(expected, actual);
|
||||
|
|
|
@ -48,6 +48,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionScope;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateNonTypeParameter;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||
import org.eclipse.cdt.core.index.IIndex;
|
||||
import org.eclipse.cdt.core.index.IIndexBinding;
|
||||
|
@ -936,6 +937,7 @@ public class SemanticHighlightings {
|
|||
if (binding instanceof IVariable
|
||||
&& !(binding instanceof IField)
|
||||
&& !(binding instanceof IParameter)
|
||||
&& !(binding instanceof ICPPTemplateNonTypeParameter)
|
||||
&& !(binding instanceof IProblemBinding)) {
|
||||
try {
|
||||
IScope scope= binding.getScope();
|
||||
|
|
Loading…
Add table
Reference in a new issue