mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
IJPL-149042 use LighterAST from one thread only
LighterAST is not thread-safe, so we have to build classes and symbols in a single thread only GitOrigin-RevId: bc578d797bd9eb29dd58ed3b294826331d11490f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b31852a5f0
commit
513f3fa1ee
@@ -161,15 +161,15 @@ internal class VFSBasedEmbeddingEntitiesIndexer(private val cs: CoroutineScope)
|
||||
content.putUserData(PSI_FILE, psiFile) // todo I think we can avoid explicit passing of file
|
||||
content.setSubstituteFileType(fileType) // todo we don't want to infer the substituted file type, do we?
|
||||
|
||||
// we can't run processing concurrently because LighterAST is not thread-safe
|
||||
if (classesChannel != null) {
|
||||
launch {
|
||||
readActionUndispatched { ClassesProvider.extractClasses(content) }.forEach { classesChannel.send(it) }
|
||||
}
|
||||
val classes = readActionUndispatched { ClassesProvider.extractClasses(content) }
|
||||
classes.forEach { classesChannel.send(it) }
|
||||
}
|
||||
|
||||
if (symbolsChannel != null) {
|
||||
launch {
|
||||
readActionUndispatched { SymbolsProvider.extractSymbols(content) }.forEach { symbolsChannel.send(it) }
|
||||
}
|
||||
val symbols = readActionUndispatched { SymbolsProvider.extractSymbols(content) }
|
||||
symbols.forEach { symbolsChannel.send(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user