Skip to content

Commit 27c7c1a

Browse files
committed
Fix broken known language servers link, add entry point mention
1 parent d7033b1 commit 27c7c1a

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,15 +325,16 @@ python scripts/lint.py
325325
While language servers can be configured by the user using a simple JSON or Python [configuration file](./Configuring.ipynb#language_servers),
326326
it is preferable to provide users with an option that does not require manual configuration. The language server specifications (specs)
327327
wrap the configuration (as would be defined by the user) into a Python class or function that can be either:
328-
329328
- distributed using PyPI/conda-forge and made conveniently available to users for `pip install` and/or `conda install`
330329
- contributed to the collection of built-in specs of jupyter-lsp by opening a PR (preferable for popular language servers, say >100 users)
331330

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+
332333
> If an advanced user installs, locates, and configures, their own language server it will always win vs an auto-configured one.
333334
334335
#### Writing a spec
335336

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
337338
`LanguageServerManager` instance, and returns a dictionary of the form:
338339

339340
```python
@@ -351,7 +352,6 @@ For details on the dictionary contents, see the [schema][] definition and [built
351352
Basic concepts (meaning of the `argv` and `languages` arguments) are also explained in the [configuration files](./Configuring.ipynb#language_servers) documentation.
352353

353354
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-
355355
- `ShellSpec` helps to create specs for servers that can be started from command-line
356356
- `PythonModuleSpec` is useful for servers which are Python modules
357357
- `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:
366366
otherwise an empty dictionary (`{}`) should be returned.
367367

368368
[built-in specs]: https://github.com/krassowski/jupyterlab-lsp/tree/master/python_packages/jupyter_lsp/jupyter_lsp/specs
369+
[setup.cfg]: https://github.com/krassowski/jupyterlab-lsp/blob/master/python_packages/jupyter_lsp/setup.cfg
369370
[schema]: https://github.com/krassowski/jupyterlab-lsp/blob/master/python_packages/jupyter_lsp/jupyter_lsp/schema/schema.json
370371
[utilities]: https://github.com/krassowski/jupyterlab-lsp/blob/master/python_packages/jupyter_lsp/jupyter_lsp/specs/utils.py
371372

docs/Configuring.ipynb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
"> default: `True`\n",
145145
"\n",
146146
"If `True`, `jupyter-lsp` will look for all\n",
147-
"[known language servers](#installing-language-servers). User-configured\n",
147+
"[known language servers](./Language%20Servers.ipynb). User-configured\n",
148148
"`language_servers` of the same implementation will be preferred over\n",
149149
"`autodetect`ed ones."
150150
]
@@ -199,13 +199,12 @@
199199
"source": [
200200
"### Python `entry_points`\n",
201201
"\n",
202-
"`pip`-installable packages in the same environment as the Jupyter `notebook`\n",
203-
"server can be automatically detected as providing\n",
204-
"[language_servers](#language_servers). These are a little more involved, but\n",
205-
"also more powerful: see more in [Contributing](Contributing.ipynb#Specs).\n",
206-
"Servers configured this way are loaded _before_ those defined in\n",
207-
"[configuration files](#Configuration-Files), so that a user can fine-tune their\n",
208-
"available servers."
202+
"`pip`-installable packages in the same environment as the Jupyter server can be\n",
203+
"automatically detected as providing [language_servers](#language_servers). These\n",
204+
"are a little more involved, but also more powerful: see more in\n",
205+
"[Contributing](Contributing.ipynb#Specs). Servers configured this way are loaded\n",
206+
"_before_ those defined in [configuration files](#Configuration-Files), so that a\n",
207+
"user can fine-tune their available servers."
209208
]
210209
},
211210
{

0 commit comments

Comments
 (0)