mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CPP-778 Support for semantic per-variable highlighting (test)
This commit is contained in:
+17
@@ -1778,6 +1778,23 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getHighlightingDescription(@NotNull List<HighlightInfo> highlighting, @NotNull String tagName) {
|
||||
final List<Border> borders = new LinkedList<Border>();
|
||||
for (HighlightInfo region : highlighting) {
|
||||
borders.add(new Border(Border.LEFT, region.getStartOffset(), "", false));
|
||||
borders.add(new Border(Border.RIGHT, region.getEndOffset(), "", false));
|
||||
}
|
||||
Collections.sort(borders);
|
||||
|
||||
StringBuilder result = new StringBuilder(myEditor.getDocument().getText());
|
||||
for (Border border : borders) {
|
||||
result.insert(border.getOffset(), (border.isSide() == Border.LEFT ? "<": "</") + tagName + ">");
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
private void testFoldingRegions(@NotNull String verificationFileName, @Nullable String destinationFileName, boolean doCheckCollapseStatus) {
|
||||
String expectedContent;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user