Skip to content

Commit ee7c337

Browse files
gselzerclaude
andcommitted
Test completion with ty, rather than jedi-language-server
scijava-code-lsp-jedi is gone; scijava-code-lsp-ty serves Python now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent da245ee commit ee7c337

3 files changed

Lines changed: 12 additions & 13 deletions

File tree

‎README.md‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,33 +149,32 @@ script's own line numbers.
149149
## Code completion
150150

151151
The Script Editor completes code in these scripts with a Python language
152-
server, `scijava-code-lsp-jedi`'s:
153-
[jedi-language-server](https://github.com/pappasam/jedi-language-server)
154-
(built on [Jedi](https://jedi.readthedocs.io/)). This plugin's
152+
server, `scijava-code-lsp-ty`'s: [ty](https://docs.astral.sh/ty/). This
153+
plugin's
155154
`ApposePythonDialect` shows it each script as plain Python, and says where
156155
the script runs (so any other client of `scijava-code-lsp`'s
157156
`LanguageServerService` gets the same). It completes names in scope,
158157
the script's `#@` parameters, `task`, builtins and keywords, and members of
159158
objects and modules; and it gives function signatures (with parameter names
160159
and types), documentation, hover and syntax errors.
161160

162-
The server runs in a small environment of its own (`code-lsp-jedi`: Python,
163-
Jedi, jedi-language-server, NumPy and uv), which is built in the background
161+
The server runs in a small environment of its own (`code-lsp-ty`: Python,
162+
NumPy and ty), which is built in the background
164163
the first time you complete code, and takes a while only then; until it is, there are no completions. The server
165164
talks to the editor via the
166165
[Language Server Protocol](https://microsoft.github.io/language-server-protocol/)
167166
(see `scijava-code-lsp`); it sees the script as plain Python, with its `#@`
168167
parameters declared. One server runs per script environment; servers
169168
unused for 10 minutes stop. Their error output goes to
170-
`code-lsp-jedi-server.log`, next to Appose's environments.
169+
`code-lsp-ty-server.log`, next to Appose's environments.
171170

172171
Once a script's environment is built, by running the script (in this session
173172
or an earlier one), the server analyzes the script against it, so that the packages
174173
installed there are known too. Packages the script declares (in its
175174
`# /// script` block) but its environment lacks, e.g. a dependency you just
176175
added, are installed for completion only, into a separate directory, a moment
177176
after you stop editing the dependencies; so they are known before you run the
178-
script. (`scijava-code-lsp-jedi` does this, for any Python script.) This
177+
script. This
179178
covers PyPI packages; conda packages (`[tool.pixi.dependencies]`)
180179
and environments declared in files are known once the script has run.
181180
Completion never builds a script's environment itself, and never disturbs

‎pom.xml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<scijava-common.version>2.101.0</scijava-common.version>
9898

9999
<scijava-code-lsp.version>0.1.0-SNAPSHOT</scijava-code-lsp.version>
100-
<scijava-code-lsp-jedi.version>0.1.0-SNAPSHOT</scijava-code-lsp-jedi.version>
100+
<scijava-code-lsp-ty.version>0.1.0-SNAPSHOT</scijava-code-lsp-ty.version>
101101
</properties>
102102

103103
<dependencies>
@@ -117,8 +117,8 @@
117117
</dependency>
118118
<dependency>
119119
<groupId>org.scijava</groupId>
120-
<artifactId>scijava-code-lsp-jedi</artifactId>
121-
<version>${scijava-code-lsp-jedi.version}</version>
120+
<artifactId>scijava-code-lsp-ty</artifactId>
121+
<version>${scijava-code-lsp-ty.version}</version>
122122
<!-- NB: For integration tests; applications choose their servers. -->
123123
<scope>test</scope>
124124
</dependency>

‎src/test/java/org/scijava/plugins/scripting/appose/python/completion/ApposePythonCompletionIntegrationTest.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@
6060

6161
/**
6262
* End-to-end tests of completing Python scripts run via Appose (see
63-
* {@link ApposePythonDialect}), with a real jedi-language-server (from
64-
* scijava-code-lsp-jedi, whose own tests test it on plain Python), through the
63+
* {@link ApposePythonDialect}), with a real ty language server (from
64+
* scijava-code-lsp-ty, whose own tests test it on plain Python), through the
6565
* {@link LanguageServerService}, as editors use it: what is particular to
6666
* these scripts.
6767
* <p>
68-
* The first completion builds jedi-language-server's environment, a script
68+
* The first completion builds ty's environment, a script
6969
* run the small uv environment of {@code appose-test/requirements.txt}, and a
7070
* script declaring a new dependency its own environment; all require network
7171
* access.

0 commit comments

Comments
 (0)