Skip to content

Commit 69ec15b

Browse files
gselzerclaude
andcommitted
code-lsp: let script dialects choose servers
A ScriptDialect is now a plugin: it says which script language it translates, the LSP language of the plain code, and (for scripts that declare one) the environment a script runs in. Sessions launch servers for the dialect's language, one per environment, via RoutingLanguageServer, now public in code-lsp (and fixed: diagnostics published while opening, shutdown racing queued routes, exit reaching the servers, and closing no longer stopping a server). The servers move out of the scripting repos into code-lsp-* modules: code-lsp-groovy and code-lsp-jython are new, and code-lsp-jedi serves "python" (editor tuning and PEP 723 overlays, installed by uv in jedi's own environment) on top of the raw "jedi" process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 6e7f65f commit 69ec15b

55 files changed

Lines changed: 8671 additions & 200 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎code-lsp-groovy/README.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SciJava Code LSP Groovy
2+
3+
Groovy code intelligence for SciJava: an in-process language server for
4+
`groovy` (`GroovyLanguageServer`, offered to `scijava-code-lsp` by
5+
`GroovyServerPlugin`), driven by Groovy's own compiler, which types the code
6+
statically as far as it can (see `TypedAST`). It completes names in scope,
7+
members of objects and classes (Java's, by reflection), class names (adding
8+
their imports) and keywords; and it gives signature help, hover and the
9+
compiler's problems.
10+
11+
It knows plain Groovy only. SciJava's Groovy scripts become plain Groovy as
12+
scripting-groovy's dialect says (their `#@` parameters declared); for code
13+
typed into a running interpreter, its bindings are declared too, as Java
14+
objects of their values' types.

‎code-lsp-groovy/pom.xml‎

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<groupId>org.scijava</groupId>
7+
<artifactId>pom-scijava</artifactId>
8+
<version>45.1.0</version>
9+
<relativePath />
10+
</parent>
11+
12+
<artifactId>scijava-code-lsp-groovy</artifactId>
13+
<version>0.1.0-SNAPSHOT</version>
14+
15+
<name>SciJava Code LSP Groovy</name>
16+
<description>Groovy code intelligence for SciJava, via Groovy's own compiler.</description>
17+
<url>https://github.com/scijava/scijava</url>
18+
<inceptionYear>2026</inceptionYear>
19+
<organization>
20+
<name>SciJava</name>
21+
<url>https://scijava.org/</url>
22+
</organization>
23+
<licenses>
24+
<license>
25+
<name>Simplified BSD License</name>
26+
<distribution>repo</distribution>
27+
</license>
28+
</licenses>
29+
30+
<developers>
31+
<developer>
32+
<id>ctrueden</id>
33+
<name>Curtis Rueden</name>
34+
<url>https://imagej.net/people/ctrueden</url>
35+
<roles>
36+
<role>founder</role>
37+
<role>lead</role>
38+
<role>developer</role>
39+
<role>debugger</role>
40+
<role>reviewer</role>
41+
<role>support</role>
42+
<role>maintainer</role>
43+
</roles>
44+
</developer>
45+
</developers>
46+
<contributors>
47+
<contributor>
48+
<name>None</name>
49+
</contributor>
50+
</contributors>
51+
52+
<mailingLists>
53+
<mailingList>
54+
<name>Image.sc Forum</name>
55+
<archive>https://forum.image.sc/tag/scijava</archive>
56+
</mailingList>
57+
</mailingLists>
58+
59+
<scm>
60+
<connection>scm:git:https://github.com/scijava/scijava</connection>
61+
<developerConnection>scm:git:git@github.com:scijava/scijava</developerConnection>
62+
<tag>HEAD</tag>
63+
<url>https://github.com/scijava/scijava</url>
64+
</scm>
65+
<issueManagement>
66+
<system>GitHub Issues</system>
67+
<url>https://github.com/scijava/scijava/issues</url>
68+
</issueManagement>
69+
<ciManagement>
70+
<system>GitHub Actions</system>
71+
<url>https://github.com/scijava/scijava/actions</url>
72+
</ciManagement>
73+
74+
<properties>
75+
<package-name>org.scijava.code.lsp.groovy</package-name>
76+
<license.licenseName>bsd_2</license.licenseName>
77+
<license.copyrightOwners>SciJava developers.</license.copyrightOwners>
78+
79+
<!-- TEMP: Remove after pom-scijava bump. -->
80+
<scijava-common.version>2.101.0</scijava-common.version>
81+
<scijava-code-lsp.version>0.1.0-SNAPSHOT</scijava-code-lsp.version>
82+
</properties>
83+
84+
<dependencies>
85+
<!-- SciJava dependencies -->
86+
<dependency>
87+
<groupId>org.scijava</groupId>
88+
<artifactId>scijava-common</artifactId>
89+
</dependency>
90+
<dependency>
91+
<groupId>org.scijava</groupId>
92+
<artifactId>scijava-code-lsp</artifactId>
93+
<version>${scijava-code-lsp.version}</version>
94+
</dependency>
95+
96+
<!-- Third-party dependencies -->
97+
<dependency>
98+
<groupId>org.apache.groovy</groupId>
99+
<artifactId>groovy</artifactId>
100+
</dependency>
101+
102+
<!-- Test scope dependencies -->
103+
<dependency>
104+
<groupId>org.junit.jupiter</groupId>
105+
<artifactId>junit-jupiter-api</artifactId>
106+
<scope>test</scope>
107+
</dependency>
108+
</dependencies>
109+
110+
<build>
111+
<plugins>
112+
<plugin>
113+
<artifactId>maven-compiler-plugin</artifactId>
114+
<configuration>
115+
<annotationProcessorPaths>
116+
<path>
117+
<groupId>org.scijava</groupId>
118+
<artifactId>scijava-common</artifactId>
119+
<version>${scijava-common.version}</version>
120+
</path>
121+
</annotationProcessorPaths>
122+
</configuration>
123+
</plugin>
124+
<plugin>
125+
<artifactId>maven-surefire-plugin</artifactId>
126+
<configuration>
127+
<!--
128+
NB: On the module path, the tests' plugin index would shadow the
129+
module's own (both are META-INF/json/org.scijava.plugin.Plugin),
130+
hiding its services from SciJava Common. On the classpath, as in
131+
Fiji, both are found.
132+
-->
133+
<useModulePath>false</useModulePath>
134+
</configuration>
135+
</plugin>
136+
</plugins>
137+
</build>
138+
</project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
open module org.scijava.code.lsp.groovy {
2+
requires org.scijava.code.lsp;
3+
requires org.apache.groovy;
4+
requires java.scripting;
5+
}

0 commit comments

Comments
 (0)