https://kotlinlang.org logo
r

raulraja

06/23/2019, 11:59 PM
@dsavvinov @dmitriy.novozhilov in case any of you can help with the reason and alternatives. I’m getting this error when attempting to modify a Psi node in the `SyntenthicResolverExtensions.generateSyntheticClasses(PackageDescriptor...)`:
Copy code
Caused by: java.util.MissingResourceException: Can't find bundle for base name messages.PsiBundle, locale en_GB
	at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1581)
	at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1396)
	at java.util.ResourceBundle.getBundle(ResourceBundle.java:782)
	at org.jetbrains.kotlin.com.intellij.psi.PsiBundle.getBundle(PsiBundle.java:45)
	at org.jetbrains.kotlin.com.intellij.psi.PsiBundle.message(PsiBundle.java:33)
	at org.jetbrains.kotlin.com.intellij.psi.impl.CheckUtil.checkWritable(CheckUtil.java:47)
	at org.jetbrains.kotlin.com.intellij.extapi.psi.ASTDelegatePsiElement.replace(ASTDelegatePsiElement.java:371)
k

kralli

06/24/2019, 6:18 AM
You cannot modify the PSI in the compiler. PSI modification is only supported in the IDE as it requires components that only exist there. Even if you were to hack the writable flag of the containing KtFile, it would still be just the beginning of a long list of really bad exceptions. You will have to transform your tree during code generation.
r

raulraja

06/25/2019, 11:55 PM
makes sense thanks
3 Views