Skip to content

Commit

Permalink
Function defninitions were failing. This has been fixed and suggestio…
Browse files Browse the repository at this point in the history
…ns should pop up now
  • Loading branch information
RappelBerryPi committed May 4, 2020
1 parent dad047f commit 8aa1dda
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<classpathentry kind="lib" path="C:/Users/leppa/eclipse/plugins/org.eclipse.ui.genericeditor_1.1.500.v20190823-1613.jar"/>
<classpathentry kind="lib" path="C:/Users/leppa/eclipse/plugins/org.eclipse.cdt.core_6.9.0.201909091953.jar"/>
<classpathentry kind="lib" path="resources/libaries/commons-text-1.8.jar"/>
<classpathentry kind="lib" path="resources/libaries/jackson-core-2.10.3.jar"/>
<classpathentry kind="lib" path="resources/libaries/jackson-databind-2.10.3.jar"/>
<classpathentry exported="true" kind="lib" path="resources/libaries/jackson-core-2.10.3.jar"/>
<classpathentry exported="true" kind="lib" path="resources/libaries/jackson-databind-2.10.3.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
7 changes: 2 additions & 5 deletions META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: RexxEditor Plug-in
Bundle-SymbolicName: RexxEditor; singleton:=true
Bundle-Version: 0.1.1
Bundle-Version: 0.1.0
Bundle-Activator: org.imperfectmommy.rexxeditor.Activator
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.jface.text,
org.eclipse.ui.editors,
org.eclipse.ui.workbench.texteditor,
org.eclipse.debug.core,
org.eclipse.core.resources,
org.eclipse.ui.ide,
org.eclipse.ui.views,
org.eclipse.debug.ui,
org.eclipse.ui.console,
com.fasterxml.jackson.core.jackson-core;bundle-version="2.10.3"
org.eclipse.cdt.core;bundle-version="6.11.0"
Bundle-ActivationPolicy: lazy
Bundle-Vendor: org.imperfectmommy
Export-Package: .,
Expand Down
Binary file not shown.
5 changes: 1 addition & 4 deletions build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/,\
resources/,\
resources/libaries/jackson-core-2.10.3.jar,\
resources/libaries/jackson-databind-2.10.3.jar,\
resources/libaries/jackson-annotations-2.10.3.jar
resources/
2 changes: 1 addition & 1 deletion resources/configuration/FunctionDefinitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@
],
"additionalInfo": ""
},
//TODO: C2D, C2X, DATATYPE, DATE, DELSTR, DELWORD, DIGITS< D2C, D2X, ERRORTEXT, FORM, FORMAT, FORMAT (v2), FUZZ, INSERT, LASTPOS, LEFT< LENGTH, LINEIN, Lineout, LINES, MAX, MIN, OVERLAY
//TODO: DATE, DELSTR, DELWORD, DIGITS< D2C, D2X, ERRORTEXT, FORM, FORMAT, FORMAT (v2), FUZZ, INSERT, LASTPOS, LEFT< LENGTH, LINEIN, Lineout, LINES, MAX, MIN, OVERLAY
{
"pattern": "POS(Needle,Haystack)",
"returnValue": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public String getFunctionName() {

public Template getTemplate() {
if (template == null) {
this.template = new Template(this.pattern + ": " + this.returnValue.getType(), "builtin: " + this.getAdditionalInfo(), "org.imperfectmommy.rexxeditor.editors.RexxEditor", this.pattern, false);
this.template =
new Template(this.pattern + ": " + this.returnValue.getType(), "builtin: " + this.getAdditionalInfo(), "org.imperfectmommy.rexxeditor.editors.RexxEditor", this.pattern, false);
}
return template;
}
Expand Down Expand Up @@ -79,13 +80,16 @@ public void setAdditionalInfo(String additionalInfo) {
public static Map<String, RexxFunctionProposalData> getFunctionMap() {
if (functionMap.isEmpty()) {
try {
ObjectMapper mapper = new ObjectMapper();
ObjectMapper mapper = new ObjectMapper();
mapper.enable(JsonParser.Feature.ALLOW_COMMENTS);
Bundle bundle = org.eclipse.core.runtime.Platform.getBundle("RexxEditor");
URL fUrl = bundle.getEntry("resources/configuration/FunctionDefinitions.json");
RexxFunctionProposalData[] data = mapper.readValue(fUrl.openConnection().getInputStream(), RexxFunctionProposalData[].class);
for (RexxFunctionProposalData rexxFunctionProposalData : data) {
functionMap.putIfAbsent(rexxFunctionProposalData.pattern, rexxFunctionProposalData);
Bundle bundle = org.eclipse.core.runtime.Platform.getBundle("RexxEditor");
URL fUrl = bundle.getEntry("resources/configuration/FunctionDefinitions.json");
if (mapper.canSerialize(RexxFunctionProposalData.class)) {
RexxFunctionProposalData[] data = mapper.readValue(fUrl.openConnection().getInputStream(), RexxFunctionProposalData[].class);
for (RexxFunctionProposalData rexxFunctionProposalData : data) {
functionMap.putIfAbsent(rexxFunctionProposalData.pattern, rexxFunctionProposalData);
}

}
} catch (IOException e) {
e.printStackTrace();
Expand Down

0 comments on commit 8aa1dda

Please sign in to comment.