Skip to content

Commit

Permalink
Adding filter to filter out doc comment matches (#75)
Browse files Browse the repository at this point in the history
Signed-off-by: Shawn Hurley <[email protected]>
  • Loading branch information
shawn-hurley authored Oct 12, 2023
1 parent a586a08 commit 87ddd22
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,20 @@ public void acceptSearchMatch(SearchMatch match) throws CoreException {
logInfo("maxResults > 0 && symbols.size() >= maxResults");
return;
}

if (match.isInsideDocComment()) {
logInfo("found match inside doc comment: " + match);
return;
}

// If we are not looking at files, then we don't want to return anytyhing for the match.
//logInfo("getResource().getType()" + match.getResource().getType());
if ((match.getResource().getType() | IResource.FILE) == 0 || match.getElement() == null) {
logInfo("match.getResource().getType() | IResource.FILE");
return;

}

if ((!this.query.contains("?") && !this.query.contains("*")) && match.getAccuracy() == SearchMatch.A_INACCURATE) {
var e = (IJavaElement) match.getElement();
//TODO: This is a hack, this will give use some clue of what we are looking at, if the search is exact then this should match
Expand Down

0 comments on commit 87ddd22

Please sign in to comment.