@@ -137,30 +137,25 @@ script's own line numbers.
137137
138138## Code completion
139139
140- The Script Editor completes code in these scripts with one language server
140+ The Script Editor completes code in these scripts with a language server
141141(` ApposePythonLanguageServer ` , offered to ` scijava-code-lsp ` 's
142142` LanguageServerService ` by ` ApposePythonServerPlugin ` , so any other LSP client
143- of it gets the same), combining two sources: jedi's answers first, then the
144- syntax-only ones for names jedi has not completed.
145-
146- * ** Instantly, with no Python needed:** names in scope (variables,
147- functions, classes, imports, parameters of the enclosing function), the
148- script's ` #@ ` parameters, ` task ` , builtins and keywords. This comes from
149- parsing the script with [ tree-sitter] ( https://tree-sitter.github.io/ )
150- (` PythonSyntaxLanguageServer ` ).
151- * ** With a language server,
152- [ jedi-language-server] ( https://github.com/pappasam/jedi-language-server )
153- (built on [ Jedi] ( https://jedi.readthedocs.io/ ) ):**
154- members of objects and modules, function signatures (with parameter names
155- and types), documentation, hover and syntax errors. The server runs in a small environment of its own
156- (` appose-python-completion ` : Python, jedi-language-server, Appose and uv),
157- which is built in the background the first time you complete code, and
158- takes a while only then. The server talks to the editor via the
159- [ Language Server Protocol] ( https://microsoft.github.io/language-server-protocol/ )
160- (see ` scijava-code-lsp ` ); it sees the script as plain Python, with its ` #@ `
161- parameters declared. One server runs per script environment; servers
162- unused for 10 minutes stop. Their error output goes to
163- ` appose-python-completion-server.log ` , next to Appose's environments.
143+ of it gets the same): [ jedi-language-server] ( https://github.com/pappasam/jedi-language-server )
144+ (built on [ Jedi] ( https://jedi.readthedocs.io/ ) ). It completes names in scope,
145+ the script's ` #@ ` parameters, ` task ` , builtins and keywords, and members of
146+ objects and modules; and it gives function signatures (with parameter names
147+ and types), documentation, hover and syntax errors.
148+
149+ The server runs in a small environment of its own
150+ (` appose-python-completion ` : Python, jedi-language-server, Appose and uv),
151+ which is built in the background the first time you complete code, and
152+ takes a while only then; until it is, there are no completions. The server
153+ talks to the editor via the
154+ [ Language Server Protocol] ( https://microsoft.github.io/language-server-protocol/ )
155+ (see ` scijava-code-lsp ` ); it sees the script as plain Python, with its ` #@ `
156+ parameters declared. One server runs per script environment; servers
157+ unused for 10 minutes stop. Their error output goes to
158+ ` appose-python-completion-server.log ` , next to Appose's environments.
164159
165160Once a script's environment is built, by running the script (in this session
166161or an earlier one), the server analyzes the script against it, so that the packages
@@ -175,6 +170,6 @@ its worker. Script parameters are known by the Python types they have at run
175170time, e.g. images as NumPy arrays.
176171
177172Typing never waits for the server: if its answer for a word is not ready
178- within a moment (the first answer for a package can take a few seconds), the
179- instant completions show, and the server's are used once ready. Questions
180- that are no longer of interest (e.g. as you type on) are cancelled.
173+ within a moment (the first answer for a package can take a few seconds), it
174+ is shown once ready. Questions that are no longer of interest (e.g. as you
175+ type on) are cancelled.
0 commit comments