You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -325,15 +325,16 @@ python scripts/lint.py
325
325
While language servers can be configured by the user using a simple JSON or Python [configuration file](./Configuring.ipynb#language_servers),
326
326
it is preferable to provide users with an option that does not require manual configuration. The language server specifications (specs)
327
327
wrap the configuration (as would be defined by the user) into a Python class or function that can be either:
328
-
329
328
- distributed using PyPI/conda-forge and made conveniently available to users for `pip install` and/or `conda install`
330
329
- contributed to the collection of built-in specs of jupyter-lsp by opening a PR (preferable for popular language servers, say >100 users)
331
330
331
+
In either case the detection of available specifications uses Python `entry_points` (see the `[options.entry_points]` section in jupyter-lsp [setup.cfg]).
332
+
332
333
> If an advanced user installs, locates, and configures, their own language server it will always win vs an auto-configured one.
333
334
334
335
#### Writing a spec
335
336
336
-
A spec is a Python callable (a function or class with `__call__` method) that accepts a single argument, the
337
+
A spec is a Python callable (a function, or a class with `__call__` method) that accepts a single argument, the
337
338
`LanguageServerManager` instance, and returns a dictionary of the form:
338
339
339
340
```python
@@ -351,7 +352,6 @@ For details on the dictionary contents, see the [schema][] definition and [built
351
352
Basic concepts (meaning of the `argv` and `languages` arguments) are also explained in the [configuration files](./Configuring.ipynb#language_servers) documentation.
352
353
353
354
When contributing a specification we recommend to make use of the helper classes and other [utilities][] that take care of the common use-cases:
354
-
355
355
-`ShellSpec` helps to create specs for servers that can be started from command-line
356
356
-`PythonModuleSpec` is useful for servers which are Python modules
357
357
-`NodeModuleSpec` will take care of finding Node.js modules
@@ -366,6 +366,7 @@ The spec should only be advertised if the command _could actually_ be run:
366
366
otherwise an empty dictionary (`{}`) should be returned.
0 commit comments