Skip to content

Commit

Permalink
Fix issue with Eclipse containers
Browse files Browse the repository at this point in the history
"Attempted to beginRule"
See: #59 (comment)
  • Loading branch information
Virtlink committed Jan 24, 2023
1 parent 6c98ee5 commit 9b08c1b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import mb.pie.api.Supplier;
import mb.pie.api.TaskDef;
import mb.resource.ResourceKey;
import mb.resource.hierarchical.ResourcePath;
import mb.spoofax.core.language.command.CommandFeedback;
import mb.spoofax.core.language.command.ShowFeedback;
import mb.statix.referenceretention.stratego.RRStrategoContext;
Expand All @@ -35,13 +36,16 @@
public class InlineMethodCallTaskDef implements TaskDef<InlineMethodCallTaskDef.Args, CommandFeedback> {

public static class Args implements Serializable {
public final ResourcePath project;
public final ResourceKey resource;
public final @Nullable Region region;

public Args(
ResourcePath project,
ResourceKey resource,
@Nullable Region region
) {
this.project = project;
this.resource = resource;
this.region = region;
}
Expand All @@ -50,20 +54,23 @@ public Args(
if(this == o) return true;
if(o == null || getClass() != o.getClass()) return false;
final Args that = (Args)o;
return this.resource.equals(that.resource)
return Objects.equals(this.project, that.project)
&& this.resource.equals(that.resource)
&& Objects.equals(this.region, that.region);
}

@Override public int hashCode() {
return Objects.hash(
project,
resource,
region
);
}

@Override public String toString() {
return "InlineMethodCallTaskDef.Input{" +
"file=" + resource + "," +
"project=" + project + "," +
"resource=" + resource + "," +
"region=" + region +
'}';
}
Expand Down
7 changes: 7 additions & 0 deletions example/tiger/spoofax3/tiger.spoofax3/spoofaxc.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ let inlineMethodCommand = command-def {
display-name = "Inline method call"
description = "Inline a method call."
parameters = [
project {
type = java mb.resource.hierarchical.ResourcePath
required = true
argument-providers = [ EnclosingContext(Project) ]
}
resource {
type = java mb.resource.ResourceKey
required = true
Expand All @@ -68,6 +73,7 @@ editor-context-menu [
command-action {
command-def = inlineMethodCommand
execution-type = Once
required-enclosing-resource-types = [Project]
}
]
]
Expand All @@ -78,6 +84,7 @@ resource-context-menu [
command-def = inlineMethodCommand
execution-type = Once
required-resource-types = [File]
required-enclosing-resource-types = [Project]
}
]
]

This file was deleted.

0 comments on commit 9b08c1b

Please sign in to comment.