Project Dependency on org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFile

已回答

I maintain a project that interfaces with the Kotlin embedded compiler. As part of this we import org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFile. Note that this project is not a plugin.

Recently this import has started to error out in IntelliJ, claiming an unresolved reference in the IDE. Strangely the project continues to build fine. But the error messages are concerning.

I suspect I have a missing dependency in my Gradle configuration file. Previous questions about how to correct import the OpenAPI have told people to set up the project like a plugin, but this project is not a plugin and so I'd prefer not to go that route.

0
Avatar
Permanently deleted user

Hello,

 

A reference to this class should work correctly. I have just checked a simple project with Kotlin compiler embeddable 1.4.31 and it works fine. Could you provide more details about your project? For example, which version of the Kotlin compiler and IDE plugin do you use?

Btw, do other references from this artifact work correctly?

0

I have the latest version (1.4.31) of both the import and the IntelliJ plugin.

Other references from this artifact seem to be working correctly. And, again, everything is still building fine, which suggests that the problem is with IntelliJ's vision of things. I'll try reimporting the project from Gradle and see if that clears things up.

0

The reimport did not help. Other references seem to work fine, including "org.jetbrains.kotlin.com.intellij.psi.PsiFileFactory", which I think is from the same artifact.

0
Avatar
Permanently deleted user

Aha, thank you. May I ask you to invalidate caches and restart Intellij IDEA as well? It might be an instance of KT-39776 

0

请先登录再写评论。