Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundles/org.eclipse.search/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.search; singleton:=true
Bundle-Version: 3.19.0.qualifier
Bundle-Version: 3.19.100.qualifier
Bundle-Activator: org.eclipse.search.internal.ui.SearchPlugin
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2023 IBM Corporation and others.
* Copyright (c) 2000, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -176,6 +176,7 @@ private SearchMessages() {
public static String FileSearchPage_sort_by_label;
public static String FileSearchPage_limited_format_files;
public static String FileSearchPage_limited_format_matches;
public static String FileSearchPage_matches_on_lines_format;
public static String FileSearchPage_filtered_message;
public static String FileSearchPage_filteredWithCount_message;
public static String WorkspaceScope;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2000, 2023 IBM Corporation and others.
# Copyright (c) 2000, 2026 IBM Corporation and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -182,6 +182,7 @@ FileSearchPage_error_marker=Could not create marker
FileSearchPage_sort_by_label=Sort By
FileSearchPage_limited_format_files={0} (showing {1} of {2} files)
FileSearchPage_limited_format_matches={0} (showing {1} of {2} matches)
FileSearchPage_matches_on_lines_format={0} (found on {1} lines)
FileSearchPage_open_file_dialog_title=Open File
FileSearchPage_filtered_message={0} (Filtered)
FileSearchPage_filteredWithCount_message={0} ({1} matches filtered from view)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2023 IBM Corporation and others.
* Copyright (c) 2000, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -450,9 +450,15 @@ public String getLabel() {
int itemCount = fContentProvider.getLeafCount(result);
if (showLineMatches()) {
int matchCount = result.getMatchCount();
if (itemCount < matchCount) {
int visibleMatchCount = getVisibleMatchCount(result);
if (visibleMatchCount < matchCount) {
Comment on lines +453 to +454
// real truncation happened so some matches are not represented at all
msg = Messages.format(SearchMessages.FileSearchPage_limited_format_matches,
new Object[] { label, Integer.valueOf(itemCount), Integer.valueOf(matchCount) });
new Object[] { label, Integer.valueOf(visibleMatchCount), Integer.valueOf(matchCount) });
} else if (itemCount < matchCount) {
// all matches shown, just spread across fewer lines
msg = Messages.format(SearchMessages.FileSearchPage_matches_on_lines_format,
new Object[] { label, Integer.valueOf(itemCount) });
}
} else {
int fileCount = result.getElementsCount();
Expand All @@ -476,6 +482,27 @@ public String getLabel() {
return msg;
}

private int getVisibleMatchCount(AbstractTextSearchResult result) {
StructuredViewer viewer = getViewer();
if (viewer instanceof TreeViewer treeViewer) {
ITreeContentProvider cp = (ITreeContentProvider) treeViewer.getContentProvider();
return getVisibleMatchCount(cp, getRootElements(treeViewer), result);
}
return result.getMatchCount();
}

private int getVisibleMatchCount(ITreeContentProvider cp, Object[] elements, AbstractTextSearchResult result) {
int count = 0;
for (Object element : elements) {
if (element instanceof LineElement lineElement) {
count += lineElement.getNumberOfMatches(result);
} else {
count += getVisibleMatchCount(cp, cp.getChildren(element), result);
Comment on lines +497 to +500
}
}
return count;
}

private int getFilteredMatchCount() {
StructuredViewer viewer = getViewer();
if (viewer instanceof TreeViewer) {
Expand Down
Loading