Skip to content

Commit

Permalink
Implement type validation as part of parser (#152)
Browse files Browse the repository at this point in the history
* Implement type validation as part of parser

Make sure that all LST elements or of the expected type. Type inconsistencies can occur due to the type erasure of Java generics.

* Add two missing visit calls

* Add a few more missing calls

* Move and register validator

* Polish

* `J.MethodDeclaration#typeParameters` has a non-standard accessor
  • Loading branch information
knutwannheden authored Nov 22, 2024
1 parent b2ba10e commit 32b5410
Show file tree
Hide file tree
Showing 3 changed files with 796 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.openrewrite.remote.Receiver;
import org.openrewrite.remote.Sender;
import org.openrewrite.remote.SenderReceiverProvider;
import org.openrewrite.remote.Validator;

@AutoService(SenderReceiverProvider.class)
public class JavaScriptSenderReceiverProvider implements SenderReceiverProvider<JS> {
Expand All @@ -37,4 +38,9 @@ public Sender<JS> newSender() {
public Receiver<JS> newReceiver() {
return new JavaScriptReceiver();
}

@Override
public Validator newValidator() {
return Validator.fromVisitor(new JavaScriptValidator<>());
}
}
Loading

0 comments on commit 32b5410

Please sign in to comment.