- Tests for OUT_OF_CODE_BLOCK_MODIFICATION behaviour

- Enable behaviour for property accessors
This commit is contained in:
Nikolay Krasko
2012-06-05 17:38:59 +04:00
parent 494bd32636
commit 184d3fb16e
11 changed files with 166 additions and 1 deletions
@@ -26,7 +26,9 @@ public final class JetModifiableBlockHelper {
private JetModifiableBlockHelper() {
}
// TODO: Need tests for this method
/**
* Tested in OutOfBlockModificationTest
*/
public static boolean shouldChangeModificationCount(PsiElement place) {
JetDeclaration declaration = PsiTreeUtil.getParentOfType(place, JetDeclaration.class, true);
if (declaration != null) {
@@ -38,6 +40,9 @@ public final class JetModifiableBlockHelper {
return shouldChangeModificationCount(function);
}
else if (declaration instanceof JetPropertyAccessor) {
return false;
}
else if (declaration instanceof JetProperty) {
JetProperty property = (JetProperty) declaration;
if (property.getPropertyTypeRef() != null) {
@@ -47,6 +52,7 @@ public final class JetModifiableBlockHelper {
return shouldChangeModificationCount(property);
}
else if (declaration instanceof JetFunctionLiteral) {
// TODO: Check return type
return shouldChangeModificationCount(declaration);
}
}