Merge pull request #3726 from continuedev/pe/jb-crash-bugix
bugfix(JB): autocomplete crashing IDE
This commit is contained in:
commit
12917cbde6
1 changed files with 6 additions and 7 deletions
|
|
@ -297,13 +297,12 @@ class AutocompleteService(private val project: Project) {
|
|||
}
|
||||
|
||||
private fun isInjectedFile(editor: Editor): Boolean {
|
||||
return ApplicationManager.getApplication().executeOnPooledThread<Boolean> {
|
||||
ApplicationManager.getApplication().runReadAction<Boolean> {
|
||||
val psiFile =
|
||||
PsiDocumentManager.getInstance(project).getPsiFile(editor.document) ?: return@runReadAction false
|
||||
return@runReadAction psiFile.isInjectedText()
|
||||
}
|
||||
}.get()
|
||||
val psiFile = runReadAction { PsiDocumentManager.getInstance(project).getPsiFile(editor.document) }
|
||||
if (psiFile == null) {
|
||||
return false
|
||||
}
|
||||
val response = runReadAction { psiFile.isInjectedText() }
|
||||
return response
|
||||
}
|
||||
|
||||
fun hideCompletions(editor: Editor) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue