Skip to content

Commit

Permalink
fix wrong resolver order and allow trailing comma
Browse files Browse the repository at this point in the history
  • Loading branch information
m0rkeulv committed Sep 10, 2023
1 parent cff91ff commit b1f705f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ static public void check(final HaxeClass clazzPsi, final AnnotationHolder holder
// avoiding unnecessary extra annotations when HaxeAnonymousType is part of other non-anonymous types like typedefs etc.
return;
}
// TODO mlo:
// check abstract keyword for methods without body in classes

checkModifiers(clazz, holder);
checkDuplicatedFields(clazz, holder);
Expand Down Expand Up @@ -245,6 +247,8 @@ private static void checkInterfacesMethods(final HaxeClassModel clazz, final Ann
checkInterfaceMethods(clazz, reference, holder, checkMissingInterfaceMethods, checkInterfaceMethodSignature,
checkInheritedInterfaceMethodSignature);
}

//TODO check abstract classes for abstract methods to implement
}

private static void checkInterfacesFields(final HaxeClassModel clazz, final AnnotationHolder holder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ private anonymousInterfaceBodyList ::= (optionalFieldDeclaration | interfaceBody
private simpleAnonymousTypeBody ::= anonymousTypeFieldList (sep anonymousInterfaceBodyList)?
typeExtendsList ::= '>' type (',' '>' type)* {pin=1}

anonymousTypeFieldList ::= anonymousTypeField (',' anonymousTypeField)* {recoverWhile="object_literal_part_recover" pin=1}
anonymousTypeFieldList ::= anonymousTypeField (',' anonymousTypeField)* ','? {recoverWhile="object_literal_part_recover" pin=1}
private sep ::= ',' | ';'
anonymousTypeField ::= "?"? componentName typeTag
{pin=3 mixin="com.intellij.plugins.haxe.lang.psi.impl.HaxePsiFieldImpl" implements="com.intellij.plugins.haxe.lang.psi.HaxePsiField"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ private List<? extends PsiElement> doResolveInner(@NotNull HaxeReference referen
if (result == null) result = checkIsFullyQualifiedStatement(reference);
if (result == null) result = checkIsSuperExpression(reference);
if (result == null) result = checkIsClassName(reference);
if (result == null) result = checkMemberReference(reference);
if (result == null) result = checkMacroIdentifier(reference);
if (result == null) result = checkIsChain(reference);
if (result == null) result = checkIsAccessor(reference);
Expand All @@ -186,6 +185,7 @@ private List<? extends PsiElement> doResolveInner(@NotNull HaxeReference referen
if (result == null) result = checkCaptureVar(reference);
if (result == null) result = checkCaptureVarReference(reference);
if (result == null) result = checkEnumExtractor(reference);
if (result == null) result = checkMemberReference(reference); // must be after resolvers that can find identifier inside a method
if (result == null) {


Expand Down

0 comments on commit b1f705f

Please sign in to comment.