SASANQUA
11/10/2022, 2:33 AMKotlinCoreProjectEnvironment#project can be used to obtain services (PsiManager, PsiFileFactory...). But I am wondering whether the KotlinCoreProjectEnvironment is a one-time use only so that when any files in a root directory change, the whole environment needs to be recreated. I can obtain a PsiFile instance through PsiManager but I cannot call PsiManager#reloadFromDisk when a file change because that throws Missing extension point: com.intellij.psi.treeChangePreprocessor in container com.intellij.mock.MockProject@4a8355dd .Am I doing this wrong or are there other ways to do it? It also seems that I can only add a root (as a directory or a jar) through JavaCoreProjectEnvironment#addSourcesToClassPath or JavaCoreProjectEnvironment#addJarToClassPath but cannot remove them. I tried looking into intellij-community and it seems to use a ProjectExImpl instance but not sure where it registers all its services or how it manages text changes in a file. Any help would be appreciated!