How get I get PsiElement instance for specified testData's code file into junit test? Follow
Answered
Hello, I'm writing a codegen Intellij IDEA Plugin and I want to test my plugin whether it parse code correctly.
My project folder structure:
└── src
├── main
│ ├── kotlin
│ └── resources
└── test
├── kotlin
└── testData
I place all test code into src/test/testData folder(like SimpleKtClass.kt or SimpleJavaClass.java).
How can parsed src/test/testData/SimpleKtClass.kt and get it as PsiFile Instance into junit test?
Thanks!
Please sign in to leave a comment.
See https://plugins.jetbrains.com/docs/intellij/test-project-and-testdata-directories.html, see also https://plugins.jetbrains.com/docs/intellij/parsing-test.html#define-a-parsing-test for real world sample