4242
4343/**
4444 * A {@link SciJavaPlugin} that knows how to turn the scripts of a SciJava
45- * language into plain code of an LSP language (a {@link ScriptDocument}), for
46- * language servers of that language to analyze (see
47- * {@link ScriptSession}). E.g. Appose-Python scripts become
48- * plain Python, their parameters declared as NumPy arrays and the like.
45+ * language into plain code for language servers to analyze.
4946 * <p>
50- * So script languages need not offer language servers themselves: servers
51- * know their language, not SciJava scripts (see {@link LanguageServerPlugin}).
52- * </p>
53- * <p>
54- * A dialect supplies the declarations, rather than translating scripts: a
55- * {@link ScriptDocument} translates every script the same way, prepending the
56- * dialect's {@link #header}, and blanking in place the lines SciJava removes
57- * before a script runs (e.g. its {@code #@} lines). So, for every language,
58- * positions in a script and in its document differ by just the header's
59- * length, which is how a session maps servers' answers back to the script
60- * (and leaves out those about the header); and that mapping is written, and
61- * tested, once. A language whose scripts need more (e.g. wrapping in a class)
62- * would extend that rule in {@link ScriptDocument}, for all languages.
47+ * A dialect supplies the declarations, rather than translating scripts:
48+ * every script is translated the same way, prepending the dialect's
49+ * {@link #header} (and a line break), and blanking in place, with spaces, the
50+ * lines SciJava removes before a script runs (e.g. its {@code #@} lines).
51+ * Nothing else changes. So, for every language, positions in a script and in
52+ * the code it becomes differ by just the header's length, which is how a
53+ * session maps servers' answers back to the script (and leaves out those
54+ * about the header); and that mapping is written, and tested, once. A
55+ * language whose scripts need more (e.g. wrapping in a class) would extend
56+ * that one rule, for all languages.
6357 * </p>
6458 *
6559 * @author Gabriel Selzer
66- * @see ScriptDocument
6760 */
6861public interface ScriptDialect extends SciJavaPlugin {
6962
@@ -99,15 +92,15 @@ default Environment environment(final String text,
9992
10093 /**
10194 * Gets the code declaring the variables a script has before it runs, with
102- * the types they have then, for a {@link ScriptDocument} to prepend to the
103- * script: e.g. {@code import numpy; image: numpy.ndarray} for an image in
104- * CPython. It may also import what the declarations need, and declare other
105- * variables scripts can use (e.g. Appose's {@code task}); variables without
106- * a useful type may be left out.
95+ * the types they have then, to prepend to the script: e.g.
96+ * {@code import numpy; image: numpy.ndarray} for an image in CPython. It may
97+ * also import what the declarations need, and declare other variables
98+ * scripts can use (e.g. Appose's {@code task}); variables without a useful
99+ * type may be left out.
107100 *
108101 * @param variables The script's variables, by name, in order: its
109- * parameters (see {@link ScriptDocument }), and, if typed into a
110- * live interpreter, the interpreter's (see {@link ScriptSession}).
102+ * parameters ({@code #@ }), and, if typed into a live interpreter,
103+ * the interpreter's (see {@link ScriptSession}).
111104 */
112105 Header header (Map <String , Variable > variables );
113106
@@ -160,7 +153,7 @@ final class Header {
160153
161154 /**
162155 * @param code The code: one line, without a line break (the
163- * {@link ScriptDocument} adds one after it), or empty if none.
156+ * translation adds one after it), or empty if none.
164157 * @param hiddenNames The names to leave out of completion: those the
165158 * code binds only to declare the parameters, e.g.
166159 * {@code numpy} for {@code import numpy}.
@@ -184,8 +177,7 @@ public String code() {
184177 /**
185178 * The names to leave out of completion: those the code binds only to
186179 * declare the parameters, e.g. {@code numpy} for {@code import numpy}
187- * (unless the script itself mentions them, see
188- * {@link ScriptDocument#hiddenNames()}).
180+ * (unless the script itself mentions them).
189181 */
190182 public Set <String > hiddenNames () {
191183 return hiddenNames ;
0 commit comments