You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2025/08/04 03:29:04 UTC
(groovy) branch master updated (79382e73d5 -> 0e07e7faaa)
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
from 79382e73d5 GROOVY-8162: Update Groovysh to JLine3 (additional documentation)
new ab49056d2c GROOVY-8162: Update Groovysh to JLine3 (document /colors and /types)
new 0e07e7faaa GROOVY-8162: Update Groovysh to JLine3 (retain ordering of fragments)
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../org/apache/groovy/groovysh/jline/GroovyEngine.java | 16 +++++++++-------
.../src/spec/doc/assets/img/repl_classloader.png | Bin 0 -> 603259 bytes
.../src/spec/doc/assets/img/repl_colors.png | Bin 0 -> 747095 bytes
.../src/spec/doc/assets/img/repl_types.png | Bin 0 -> 368103 bytes
subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc | 14 ++++++++++++++
5 files changed, 23 insertions(+), 7 deletions(-)
create mode 100644 subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_classloader.png
create mode 100644 subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_colors.png
create mode 100644 subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_types.png
(groovy) 02/02: GROOVY-8162: Update Groovysh to JLine3 (retain ordering of fragments)
Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 0e07e7faaa1e14397c5f1541fcdee7c2cf83339b
Author: Paul King <pa...@asert.com.au>
AuthorDate: Mon Aug 4 13:28:52 2025 +1000
GROOVY-8162: Update Groovysh to JLine3 (retain ordering of fragments)
---
.../org/apache/groovy/groovysh/jline/GroovyEngine.java | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyEngine.java b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyEngine.java
index 7aeda02138..c9ce985fc4 100644
--- a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyEngine.java
+++ b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyEngine.java
@@ -69,9 +69,11 @@ import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.TreeMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@@ -136,15 +138,15 @@ public class GroovyEngine implements ScriptEngine {
"groovy.util.*",
"java.math.BigInteger",
"java.math.BigDecimal");
- private final Map<String, Class<?>> defaultNameClass = new HashMap<>();
+ private final Map<String, Class<?>> defaultNameClass = new TreeMap<>();
private final GroovyShell shell;
protected Binding sharedData;
private final List<Snippet> snippets = new ArrayList<>();
- private final Map<String, Integer> imports = new HashMap<>();
- private final Map<String, Integer> methods = new HashMap<>();
- private final Map<String, Integer> variables = new HashMap<>();
+ private final Map<String, Integer> imports = new LinkedHashMap<>();
+ private final Map<String, Integer> methods = new LinkedHashMap<>();
+ private final Map<String, Integer> variables = new LinkedHashMap<>();
private final Set<String> methodNames = new HashSet<>();
- private final Map<String, Integer> types = new HashMap<>();
+ private final Map<String, Integer> types = new LinkedHashMap<>();
private final Map<String, Class<?>> nameClass;
private Cloner objectCloner = new ObjectCloner();
protected final EngineClassLoader classLoader;
@@ -170,7 +172,7 @@ public class GroovyEngine implements ScriptEngine {
}
public Map<String, String> getTypes() {
- Map<String, String> out = new HashMap<>();
+ Map<String, String> out = new LinkedHashMap<>();
types.forEach((String key, Integer index) -> {
Snippet snippet = snippets.get(index);
if (snippet.getType() == SnippetType.TYPE) {
@@ -181,7 +183,7 @@ public class GroovyEngine implements ScriptEngine {
}
public Map<String, String> getVariables() {
- Map<String, String> out = new HashMap<>();
+ Map<String, String> out = new LinkedHashMap<>();
variables.forEach((String key, Integer index) -> {
Snippet snippet = snippets.get(index);
if (snippet.getType() == SnippetType.VARIABLE) {
(groovy) 01/02: GROOVY-8162: Update Groovysh to JLine3 (document /colors and /types)
Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit ab49056d2cf2b1c26a7aae81aba438021eaa0442
Author: Paul King <pa...@asert.com.au>
AuthorDate: Mon Aug 4 13:27:58 2025 +1000
GROOVY-8162: Update Groovysh to JLine3 (document /colors and /types)
---
.../src/spec/doc/assets/img/repl_classloader.png | Bin 0 -> 603259 bytes
.../src/spec/doc/assets/img/repl_colors.png | Bin 0 -> 747095 bytes
.../src/spec/doc/assets/img/repl_types.png | Bin 0 -> 368103 bytes
subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc | 14 ++++++++++++++
4 files changed, 14 insertions(+)
diff --git a/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_classloader.png b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_classloader.png
new file mode 100644
index 0000000000..fed0f34d2f
Binary files /dev/null and b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_classloader.png differ
diff --git a/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_colors.png b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_colors.png
new file mode 100644
index 0000000000..32e3ec22af
Binary files /dev/null and b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_colors.png differ
diff --git a/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_types.png b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_types.png
new file mode 100644
index 0000000000..4d425114c4
Binary files /dev/null and b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_types.png differ
diff --git a/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc b/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
index 45917bd3a8..2d3966d139 100644
--- a/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
+++ b/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc
@@ -268,6 +268,13 @@ image:assets/img/repl_classloader.png[Classloader, width=80%]
Clears the screen.
+[[GroovyShell-colors]]
+==== `/colors`
+
+Displays the available colors.
+
+image:assets/img/repl_colors.png[Colors, width=80%]
+
[[GroovyShell-del]]
==== `/del`
@@ -425,6 +432,13 @@ saved into the `.groovy/groovysh.ser` file in the user home directory.
Show the shared variables (the binding).
+[[GroovyShell-types]]
+==== `/types`
+
+Show the declared types (enums, interfaces, classes, traits, annotation definitions, and records).
+
+image:assets/img/repl_types.png[Usage of the /types command, width=80%]
+
[[GroovyShell-history]]
==== `/history`