Skip to content

Commit

Permalink
Also read initially visible marker fields from extensions eclipse-pla…
Browse files Browse the repository at this point in the history
  • Loading branch information
travkin79 committed Aug 16, 2024
1 parent 348eeb2 commit 1a9dfac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,12 @@ public String getId() {
* @return {@link MarkerField}[]
*/
public MarkerField[] getInitialVisible() {
return initialVisibleWithoutExtensions;
List<MarkerField> allVisibleFieldsList = new ArrayList<>(Arrays.asList(initialVisibleWithoutExtensions));

getExtensionsDescriptorsStream().flatMap(descriptor -> Arrays.stream(descriptor.getInitialVisible()))
.forEach(field -> allVisibleFieldsList.add(field));

return allVisibleFieldsList.toArray(new MarkerField[allVisibleFieldsList.size()]);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ public void markerContentGeneratorExtensionLoaded() throws Exception {
assertNotNull(descriptor);

MarkerField[] allFields = descriptor.getAllFields();

boolean foundAdditionalField1 = false;
boolean foundRecursivelyAddedField2 = false;
for (MarkerField field : allFields) {
Expand All @@ -160,6 +159,16 @@ public void markerContentGeneratorExtensionLoaded() throws Exception {
assertTrue("MarkerField not loaded from recursive marker content generator extension.",
foundRecursivelyAddedField2);

MarkerField[] initiallyVisibleFields = descriptor.getInitialVisible();
boolean foundAdditionalVisbileField = false;
for (MarkerField field : initiallyVisibleFields) {
if ("Problem Key".equals(field.getName())) {
foundAdditionalVisbileField = true;
}
}
assertTrue("Visible attribute from marker fields from marker content generator extensions not loaded.",
foundAdditionalVisbileField);

MarkerType markerTypeFromExtension = descriptor.getType("org.eclipse.ui.tests.markers.artificial.problem");
assertNotNull("Marker type from marker content generator extensions not loaded.", markerTypeFromExtension);
assertTrue(descriptor.getMarkerTypes().contains(markerTypeFromExtension));
Expand Down

0 comments on commit 1a9dfac

Please sign in to comment.