Skip to content

Commit

Permalink
Copy over eclipse-lsp4mp/lsp4mp#480 into qute.jdt
Browse files Browse the repository at this point in the history
Use the secondary-type search for types in the project,
and if that fails, use the non-secondary type search for types.

Signed-off-by: David Thompson <[email protected]>
  • Loading branch information
datho7561 committed Dec 6, 2024
1 parent f8561ef commit 07a84da
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ public static String getSimpleClassName(String className) {

public static IType findType(IJavaProject project, String className) {
try {
return project.findType(className, new NullProgressMonitor());
IType type = project.findType(className, new NullProgressMonitor());
if (type != null && type.exists()) {
return type;
}
} catch (JavaModelException e) {
}
try {
return project.findType(className);
} catch (JavaModelException e) {
LOGGER.log(Level.SEVERE, "Error while finding type for '" + className + "'.", e);
return null;
Expand Down

0 comments on commit 07a84da

Please sign in to comment.