Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert type #3609

Merged
merged 1 commit into from
Jul 16, 2024
Merged
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
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
Loading