Skip to content

Commit

Permalink
Fixed keystroke delay (eclipse#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiganov committed Oct 29, 2021
1 parent edfeb8f commit dd44ad5
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,13 @@ public static ICompilationUnit resolveCompilationUnit(URI uri) {
if (resource.getFileExtension() != null) {
String name = resource.getName();
if (org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(name)) {
return JavaCore.createCompilationUnitFrom(resource);
ICompilationUnit unit = JavaCore.createCompilationUnitFrom(resource);
try {
// Give underlying resource time to catch up (max 3 seconds).
long endTime = System.currentTimeMillis() + 3000;
while (!unit.isConsistent() && System.currentTimeMillis() < endTime) { }
} catch (JavaModelException e) { }
return unit;
}
}
return null;
Expand Down

0 comments on commit dd44ad5

Please sign in to comment.