Skip to content

Commit

Permalink
revert type (#3609)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuataylor authored Jul 16, 2024
1 parent 66f64c7 commit 029b5d0
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/org/elixir_lang/sdk/elixir/Type.kt
Original file line number Diff line number Diff line change
Expand Up @@ -531,23 +531,21 @@ ELIXIR_SDK_HOME
return if (!project.isDisposed) {
/* ModuleUtilCore.findModuleForPsiElement can fail with NullPointerException if the
ProjectFileIndex.SERVICE.getInstance(Project) returns {@code null}, so check that the
ProjectFileIndex is available first
*/
ProjectFileIndex is available first */
if (ProjectFileIndex.SERVICE.getInstance(project) != null) {
ApplicationManager.getApplication().executeOnPooledThread(Callable {
ReadAction.compute<Sdk?, Throwable> {
try {
val module = ModuleUtilCore.findModuleForPsiElement(psiElement)
if (module != null) {
mostSpecificSdk(module)
} else {
mostSpecificSdk(project)
}
} catch (_: AlreadyDisposedException) {
null
}
val module = try {
ReadAction.compute<Module, Throwable> {
ModuleUtilCore.findModuleForPsiElement(psiElement)
}
}).get()
} catch (_: AlreadyDisposedException) {
null
}

if (module != null) {
mostSpecificSdk(module)
} else {
mostSpecificSdk(project)
}
} else {
mostSpecificSdk(project)
}
Expand Down

0 comments on commit 029b5d0

Please sign in to comment.