FIR IDE: API to indicate delegated property

This commit is contained in:
Jinseong Jeon
2021-10-18 14:59:14 -07:00
committed by Ilya Kirillov
parent 96fbbb6f69
commit b52912162f
20 changed files with 281 additions and 2 deletions
@@ -101,6 +101,8 @@ internal class KtFirKotlinPropertySymbol(
// NB: `field` in accessors indicates the property should have a backing field. To see that, though, we need BODY_RESOLVE.
override val hasBackingField: Boolean get() = firRef.withFir(FirResolvePhase.BODY_RESOLVE) { it.hasBackingField }
override val isDelegatedProperty: Boolean get() = firRef.withFir { it.delegateFieldSymbol != null }
override val isLateInit: Boolean get() = firRef.withFir { it.isLateInit }
override val isConst: Boolean get() = firRef.withFir { it.isConst }
@@ -78,6 +78,12 @@ public class FirSymbolByPsiTestGenerated extends AbstractFirSymbolByPsiTest {
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/classWithTypeParams.kt");
}
@Test
@TestMetadata("delegateField.kt")
public void testDelegateField() throws Exception {
runTest("analysis/analysis-api/testData/symbols/symbolByPsi/delegateField.kt");
}
@Test
@TestMetadata("deprecated.kt")
public void testDeprecated() throws Exception {