mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 09:15:38 +02:00
Fix wrong highlighting of macro substitutions
This commit is contained in:
parent
301ee51670
commit
27d806f738
2 changed files with 9 additions and 4 deletions
|
@ -186,7 +186,6 @@ public class SemanticHighlightingTest extends AbstractSemanticHighlightingTest {
|
||||||
Position[] expected= new Position[] {
|
Position[] expected= new Position[] {
|
||||||
createPosition(11, 20, 1),
|
createPosition(11, 20, 1),
|
||||||
createPosition(28, 35, 3),
|
createPosition(28, 35, 3),
|
||||||
createPosition(29, 8, 19),
|
|
||||||
createPosition(30, 19, 3),
|
createPosition(30, 19, 3),
|
||||||
createPosition(77, 21, 4),
|
createPosition(77, 21, 4),
|
||||||
createPosition(77, 30, 4),
|
createPosition(77, 30, 4),
|
||||||
|
@ -291,10 +290,8 @@ public class SemanticHighlightingTest extends AbstractSemanticHighlightingTest {
|
||||||
setUpSemanticHighlighting(SemanticHighlightings.FUNCTION_INVOCATION);
|
setUpSemanticHighlighting(SemanticHighlightings.FUNCTION_INVOCATION);
|
||||||
Position[] actual= getSemanticHighlightingPositions();
|
Position[] actual= getSemanticHighlightingPositions();
|
||||||
Position[] expected= new Position[] {
|
Position[] expected= new Position[] {
|
||||||
createPosition(29, 8, 19),
|
|
||||||
createPosition(30, 8, 10),
|
createPosition(30, 8, 10),
|
||||||
createPosition(99, 1, 16),
|
createPosition(99, 1, 16)
|
||||||
createPosition(120, 4, 17),
|
|
||||||
};
|
};
|
||||||
if (PRINT_POSITIONS) System.out.println(toString(actual));
|
if (PRINT_POSITIONS) System.out.println(toString(actual));
|
||||||
assertEqualPositions(expected, actual);
|
assertEqualPositions(expected, actual);
|
||||||
|
|
|
@ -84,6 +84,13 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
|
||||||
if (!fFilePath.equals(declaration.getContainingFilename())) {
|
if (!fFilePath.equals(declaration.getContainingFilename())) {
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
IASTNodeLocation[] nodeLocations= declaration.getNodeLocations();
|
||||||
|
if (nodeLocations.length > 0 && nodeLocations[0] instanceof IASTMacroExpansion) {
|
||||||
|
if (visitNode(declaration)) {
|
||||||
|
return PROCESS_SKIP;
|
||||||
|
}
|
||||||
|
return PROCESS_SKIP;
|
||||||
|
}
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,6 +106,7 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
|
||||||
if (visitNode(expression)) {
|
if (visitNode(expression)) {
|
||||||
return PROCESS_SKIP;
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
return PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue