Skip to content

Commit e50a0ac

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 7723894 commit e50a0ac

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
@@ -138,33 +138,32 @@ script's own line numbers.
138138
## Code completion
139139

140140
The Script Editor completes code in these scripts with a Python language
141-
server, `scijava-code-lsp-jedi`'s:
142-
[jedi-language-server](https://github.com/pappasam/jedi-language-server)
143-
(built on [Jedi](https://jedi.readthedocs.io/)). This plugin's
141+
server, `scijava-code-lsp-ty`'s: [ty](https://docs.astral.sh/ty/). This
142+
plugin's
144143
`ApposePythonDialect` shows it each script as plain Python, and says where
145144
the script runs (so any other client of `scijava-code-lsp`'s
146145
`LanguageServerService` gets the same). It completes names in scope,
147146
the script's `#@` parameters, `task`, builtins and keywords, and members of
148147
objects and modules; and it gives function signatures (with parameter names
149148
and types), documentation, hover and syntax errors.
150149

151-
The server runs in a small environment of its own (`code-lsp-jedi`: Python,
152-
Jedi, jedi-language-server, NumPy and uv), which is built in the background
150+
The server runs in a small environment of its own (`code-lsp-ty`: Python,
151+
NumPy and ty), which is built in the background
153152
the first time you complete code, and takes a while only then; until it is, there are no completions. The server
154153
talks to the editor via the
155154
[Language Server Protocol](https://microsoft.github.io/language-server-protocol/)
156155
(see `scijava-code-lsp`); it sees the script as plain Python, with its `#@`
157156
parameters declared. One server runs per script environment; servers
158157
unused for 10 minutes stop. Their error output goes to
159-
`code-lsp-jedi-server.log`, next to Appose's environments.
158+
`code-lsp-ty-server.log`, next to Appose's environments.
160159

161160
Once a script's environment is built, by running the script (in this session
162161
or an earlier one), the server analyzes the script against it, so that the packages
163162
installed there are known too. Packages the script declares (in its
164163
`# /// script` block) but its environment lacks, e.g. a dependency you just
165164
added, are installed for completion only, into a separate directory, a moment
166165
after you stop editing the dependencies; so they are known before you run the
167-
script. (`scijava-code-lsp-jedi` does this, for any Python script.) This
166+
script. This
168167
covers PyPI packages; conda packages (`[tool.pixi.dependencies]`)
169168
and environments declared in files are known once the script has run.
170169
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)