FIR LC: set modifier list as a parent of light annotations

^KTIJ-22354 Fixed
This commit is contained in:
Jinseong Jeon
2022-08-02 00:58:10 -07:00
committed by Ilya Kirillov
parent 79030c9252
commit 199219483e
10 changed files with 1277 additions and 4 deletions
@@ -16,16 +16,22 @@ object LightClassTestCommon {
private val SUBJECT_FQ_NAME_PATTERN = Pattern.compile("^//\\s*(.*)$", Pattern.MULTILINE)
const val NOT_GENERATED_DIRECTIVE = "// NOT_GENERATED"
fun fqNameInTestDataFile(
testDataFile: File,
): String {
val text = FileUtil.loadFile(testDataFile, true)
val matcher = SUBJECT_FQ_NAME_PATTERN.matcher(text)
TestCase.assertTrue("No FqName specified. First line of the form '// f.q.Name' expected", matcher.find())
return matcher.group(1)
}
fun getActualLightClassText(
testDataFile: File,
findLightClass: (String) -> PsiClass?,
normalizeText: (String) -> String,
membersFilter: PsiClassRenderer.MembersFilter = PsiClassRenderer.MembersFilter.DEFAULT
): String {
val text = FileUtil.loadFile(testDataFile, true)
val matcher = SUBJECT_FQ_NAME_PATTERN.matcher(text)
TestCase.assertTrue("No FqName specified. First line of the form '// f.q.Name' expected", matcher.find())
val fqName = matcher.group(1)
val fqName = fqNameInTestDataFile(testDataFile)
val lightClass = findLightClass(fqName)