[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-kawa 72dbb50 036/119: Refactor: rename classes, mo
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-kawa 72dbb50 036/119: Refactor: rename classes, move static field between classes |
Date: |
Sun, 1 Aug 2021 18:30:34 -0400 (EDT) |
branch: elpa/geiser-kawa
commit 72dbb509fe9ab1e8574961569ef54e5e0a264e28
Author: spellcard199 <spellcard199@protonmail.com>
Commit: spellcard199 <spellcard199@protonmail.com>
Refactor: rename classes, move static field between classes
---
src/main/java/kawageiser/Geiser.java | 9 ++++-----
src/main/java/kawageiser/GeiserEval.java | 9 +++++----
.../kawageiser/java/{Complete.java => GeiserCompleteJava.java} | 10 ++++++----
3 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/main/java/kawageiser/Geiser.java
b/src/main/java/kawageiser/Geiser.java
index b7f6a40..4c57b92 100644
--- a/src/main/java/kawageiser/Geiser.java
+++ b/src/main/java/kawageiser/Geiser.java
@@ -7,15 +7,14 @@ package kawageiser;
import gnu.expr.Language;
import kawageiser.geiserDoc.ManualEpubUnzipToTmpDir;
+import kawageiser.java.GeiserCompleteJava;
public class Geiser implements Runnable {
private static boolean prettyPrintResult = true;
public static boolean isPrettyPrintResult() { return prettyPrintResult; }
- public static boolean isPrettyPrintOutput() { return
evaluator.isPrettyPrintOutput(); }
+ public static boolean isPrettyPrintOutput() { return
GeiserEval.evaluator.isPrettyPrintOutput(); }
public static void setPrettyPrintResult(boolean v) { prettyPrintResult =
v; }
- public static void setPrettyPrintOutput(boolean v) {
evaluator.setPrettyPrintOutput(v); }
-
- public static kawadevutil.eval.Eval evaluator = new
kawadevutil.eval.Eval();
+ public static void setPrettyPrintOutput(boolean v) {
GeiserEval.evaluator.setPrettyPrintOutput(v); }
@Override
public void run() {
@@ -26,7 +25,7 @@ public class Geiser implements Runnable {
lang.defineFunction(new GeiserCompleteSymbol("geiser:completions"));
lang.defineFunction(new
GeiserCompleteModule("geiser:module-completions"));
lang.defineFunction(new GeiserAutodoc("geiser:autodoc", lang));
- lang.defineFunction(new
kawageiser.java.Complete("geiser:complete-java"));
+ lang.defineFunction(new GeiserCompleteJava("geiser:complete-java"));
lang.defineFunction(new
ManualEpubUnzipToTmpDir("geiser:manual-epub-unzip-to-tmp-dir"));
lang.defineFunction(new GeiserMacroexpand("geiser:macroexpand"));
}
diff --git a/src/main/java/kawageiser/GeiserEval.java
b/src/main/java/kawageiser/GeiserEval.java
index 5303a03..842d7b1 100644
--- a/src/main/java/kawageiser/GeiserEval.java
+++ b/src/main/java/kawageiser/GeiserEval.java
@@ -18,10 +18,11 @@ import kawadevutil.redirect.RedirectedOutErr;
public class GeiserEval extends Procedure2 {
/*
- * Actual evaluation happens in kawadevtools.eval.Eval.
+ * Actual evaluation happens in kawadevutil.eval.Eval.
* Here we are just sending arguments and converting our own
* types into the geiser protocol.
*/
+ public static kawadevutil.eval.Eval evaluator = new
kawadevutil.eval.Eval();
GeiserEval(String procName) {
super(procName);
@@ -59,13 +60,13 @@ public class GeiserEval extends Procedure2 {
public static String
evalStr(Environment module, String codeStr) {
- EvalResultAndOutput resOutErr =
Geiser.evaluator.evalCatchingOutErr(module, codeStr);
+ EvalResultAndOutput resOutErr = evaluator.evalCatchingOutErr(module,
codeStr);
return formatGeiserProtocol(evaluationDataToGeiserProtocol(resOutErr));
}
public static String
evalForm(Environment module, Object sexpr) {
- EvalResultAndOutput resOutErr =
Geiser.evaluator.evalCatchingOutErr(module, sexpr);
+ EvalResultAndOutput resOutErr = evaluator.evalCatchingOutErr(module,
sexpr);
return formatGeiserProtocol(evaluationDataToGeiserProtocol(resOutErr));
}
@@ -85,7 +86,7 @@ public class GeiserEval extends Procedure2 {
: "";
messages = (messages != null) ? messages : "";
String stackTrace = (evalRes.getThrowed() != null)
- ? Geiser.evaluator.formatStackTrace(evalRes.getThrowed())
+ ? evaluator.formatStackTrace(evalRes.getThrowed())
: "";
String output = outErr.getOutAndErrInPrintOrder();
// If we wanted, we could include stack traces directly in
diff --git a/src/main/java/kawageiser/java/Complete.java
b/src/main/java/kawageiser/java/GeiserCompleteJava.java
similarity index 93%
rename from src/main/java/kawageiser/java/Complete.java
rename to src/main/java/kawageiser/java/GeiserCompleteJava.java
index deaec3b..b9cb060 100644
--- a/src/main/java/kawageiser/java/Complete.java
+++ b/src/main/java/kawageiser/java/GeiserCompleteJava.java
@@ -19,11 +19,11 @@ import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
-public class Complete extends Procedure4 {
+public class GeiserCompleteJava extends Procedure4 {
public static boolean showTypes = true;
- public Complete(String name) {
+ public GeiserCompleteJava(String name) {
super(name);
}
@@ -46,7 +46,8 @@ public class Complete extends Procedure4 {
cursorIndexChecked = ((IntNum) cursorIndex).intValue();
} else {
throw new IllegalArgumentException(
- "`cursorIndex` must be either Integer or IntNum: " +
cursorIndex.getClass().toString());
+ "`cursorIndex` must be either Integer or IntNum: "
+ + cursorIndex.getClass().toString());
}
// Get Data
@@ -65,7 +66,8 @@ public class Complete extends Procedure4 {
} else if
(complData.getClass().equals(CompletionDataForJavaPackage.class)) {
res = toLList((CompletionDataForJavaPackage) complData);
} else {
- throw new Error("Bug spotted.");
+ throw new Error("[BUG SPOTTED] `complData's class is one not
expected: "
+ + complData.getClass().toString());
}
return gnu.kawa.functions.Format.format("~S", res);
}
- [nongnu] elpa/geiser-kawa f5a1697 026/119: README - small reword, (continued)
- [nongnu] elpa/geiser-kawa f5a1697 026/119: README - small reword, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa 2ec29bd 011/119: pom.xml - use specific commit instead of -SNAPSHOT for kawa-geiser dep, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa 63e662d 012/119: README - reword quickstart instructions, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa fabe331 047/119: Use kawa-devutil's Kawa server wrapper instead of own solution, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa 1b82b8f 056/119: Add tests for elisp, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa 3c57d06 059/119: TODO.org: Add todos, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa 1f6357f 009/119: README - Update, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa 4ba3dc2 035/119: Add support for macroexpand, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa 266413b 038/119: Refactor: replace Kawa procedures with primitive methods + update kawa-devutil dep, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa 281d27c 028/119: Add COPYING, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa 72dbb50 036/119: Refactor: rename classes, move static field between classes,
Philip Kaludercic <=
- [nongnu] elpa/geiser-kawa 91929a6 013/119: Small naming change, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa 8451f3b 017/119: README.org - Small reword, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa ed8d954 055/119: Rename funcs, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa e4679f7 066/119: pom.xml update kawa-devutil dep + fix code accordingly, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa 80ed3e7 068/119: Update geiser version + remove geiser workaround for Cask, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa f258b9a 073/119: TODO.org: add notes to self on how to make the melpa recipe, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa da47cd7 082/119: Fix broken name, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa e0fd1de 084/119: Refactor geiser-kawa-devutil-exprtree.el, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa 4750e5c 021/119: Update README, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-kawa c9c493e 006/119: Add pom.xml for kawa-geiser dependency, Philip Kaludercic, 2021/08/01