Skip to content

Commit 2dbf635

Browse files
authored
Merge pull request #993 from krassowski/5.0-final
Prepare for final release of 5.0
2 parents e171ec6 + 27177c5 commit 2dbf635

File tree

10 files changed

+101
-295
lines changed

10 files changed

+101
-295
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
## Changelog
22

3+
### `@jupyter-lsp/jupyterlab-lsp 5.0.0`
4+
5+
- enhancements:
6+
- uses toast notifications instead of messages on status bar
7+
- diagnostics panel will be re-opened on reload
8+
- maintenance:
9+
- support JupyterLab 4
10+
- use upstream `@jupyterlab/lsp` package
11+
- use camelCase convention in TypeScript/JavaScript code
12+
- use `@codemirror/linter` to show diagnostics
13+
- this comes with a different style of underlines and custom tooltips
14+
15+
Requires JupyterLab `>=4.0.6,<5.0.0a0`
16+
317
### `@jupyter-lsp/jupyterlab-lsp 5.0.0-rc.1`
418

519
- restore re-use of unused standalone connections

CONTRIBUTING.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ You can contribute to the project through:
2121

2222
Thank you for all your contributions :heart:
2323

24-
[license]: https://github.com/jupyter-lsp/jupyterlab-lsp/blob/master/LICENSE
24+
[license]: https://github.com/jupyter-lsp/jupyterlab-lsp/blob/main/LICENSE
2525
[extending]: ./docs/Extending.html
2626
[roadmap]: ./docs/Roadmap.html
2727
[jupyterlab-lsp]: https://github.com/jupyter-lsp/jupyterlab-lsp.git
28-
[code-of-conduct]: https://github.com/jupyter/governance/blob/master/conduct/code_of_conduct.md
28+
[code-of-conduct]: https://github.com/jupyter/governance/blob/main/conduct/code_of_conduct.md
2929

3030
### Set up the environment
3131

@@ -52,7 +52,7 @@ pip install -r requirements/dev.txt # in a virtualenv, probably
5252
sudo apt-get install nodejs # ... e.g. on debian/ubuntu
5353
```
5454

55-
#### The Easy Way
55+
#### Single-step installation
5656

5757
Once your environment is created and activated, on Linux/OSX you can run:
5858

@@ -62,7 +62,10 @@ bash binder/postBuild
6262

6363
This performs all the basic setup steps, and is used for the binder demo.
6464

65-
#### The Hard Way
65+
This approach may not always work. Continue reading for a step-by-step
66+
instructions which also show all the underlying pieces.
67+
68+
#### Manual installation
6669

6770
Install `jupyter-lsp` from source in your virtual environment:
6871

@@ -378,25 +381,25 @@ The spec should only be advertised if the command _could actually_ be run:
378381

379382
otherwise an empty dictionary (`{}`) should be returned.
380383

381-
[built-in specs]: https://github.com/jupyter-lsp/jupyterlab-lsp/tree/master/python_packages/jupyter_lsp/jupyter_lsp/specs
382-
[setup.cfg]: https://github.com/jupyter-lsp/jupyterlab-lsp/blob/master/python_packages/jupyter_lsp/setup.cfg
383-
[schema]: https://github.com/jupyter-lsp/jupyterlab-lsp/blob/master/python_packages/jupyter_lsp/jupyter_lsp/schema/schema.json
384-
[utilities]: https://github.com/jupyter-lsp/jupyterlab-lsp/blob/master/python_packages/jupyter_lsp/jupyter_lsp/specs/utils.py
384+
[built-in specs]: https://github.com/jupyter-lsp/jupyterlab-lsp/tree/main/python_packages/jupyter_lsp/jupyter_lsp/specs
385+
[setup.cfg]: https://github.com/jupyter-lsp/jupyterlab-lsp/blob/main/python_packages/jupyter_lsp/setup.cfg
386+
[schema]: https://github.com/jupyter-lsp/jupyterlab-lsp/blob/main/python_packages/jupyter_lsp/jupyter_lsp/schema/schema.json
387+
[utilities]: https://github.com/jupyter-lsp/jupyterlab-lsp/blob/main/python_packages/jupyter_lsp/jupyter_lsp/specs/utils.py
385388

386389
##### Common Concerns
387390

388391
- some language servers need to have their connection mode specified
389392
- the `stdio` interface is the only one supported by `jupyter_lsp`
390393
- PRs welcome to support other modes!
391-
- because of its VSCode heritage, many language servers use `nodejs`
394+
- many language servers use `nodejs`
392395
- `LanguageServerManager.nodejs` will provide the location of our best
393396
guess at where a user's `nodejs` might be found
394397
- some language servers are hard to start purely from the command line
395398
- use a helper script to encapsulate some complexity, or
396-
- use a command argument of the interpreter is available (see the [r spec][] and [julia spec] for examples)
399+
- use a `command` argument of the interpreter is available (see the [r spec][] and [julia spec] for examples)
397400

398-
[r spec]: https://github.com/jupyter-lsp/jupyterlab-lsp/blob/master/python_packages/jupyter_lsp/jupyter_lsp/specs/r_languageserver.py
399-
[julia spec]: https://github.com/jupyter-lsp/jupyterlab-lsp/blob/master/python_packages/jupyter_lsp/jupyter_lsp/specs/julia_language_server.py
401+
[r spec]: https://github.com/jupyter-lsp/jupyterlab-lsp/blob/main/python_packages/jupyter_lsp/jupyter_lsp/specs/r_languageserver.py
402+
[julia spec]: https://github.com/jupyter-lsp/jupyterlab-lsp/blob/main/python_packages/jupyter_lsp/jupyter_lsp/specs/julia_language_server.py
400403

401404
##### Example: making a pip-installable `cool-language-server` spec
402405

@@ -462,7 +465,11 @@ python setup.py sdist bdist_wheel
462465

463466
## Debugging
464467

465-
Adjust `loggingLevel` in the `Advanced Settings Editor` -> `Language Server` to see more log messages.
468+
To see more see more log messages navigate to `Settings``Settings Editor``Language Servers` and adjust:
469+
470+
- adjust `Logging console verbosity level`
471+
- switch `Ask servers to send trace notifications` to `verbose`
472+
- toggle `Log all LSP communication with the LSP servers`
466473

467474
For robot tests set:
468475

docs/Architecture.ipynb

Lines changed: 10 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"source": [
3838
"### As-Is\n",
3939
"\n",
40-
"These are how we _think_ everything works in the current `master` branch."
40+
"These are how we _think_ everything works in the current `main` branch."
4141
]
4242
},
4343
{
@@ -103,54 +103,14 @@
103103
"cell_type": "markdown",
104104
"metadata": {},
105105
"source": [
106-
"#### Reorganize client source with lerna and typescript projects [#76][]\n",
107-
"\n",
108-
"> TBD\n",
109-
"\n",
110-
"[#76]: https://github.com/jupyter-lsp/jupyterlab-lsp/issues/76"
111-
]
112-
},
113-
{
114-
"cell_type": "markdown",
115-
"metadata": {},
116-
"source": [
117-
"#### Add DiagnosticsManager, refactor DiagnosticPanel [#176][]\n",
118-
"\n",
119-
"> TBD\n",
120-
"\n",
121-
"[#176]: https://github.com/jupyter-lsp/jupyterlab-lsp/issues/176"
122-
]
123-
},
124-
{
125-
"cell_type": "markdown",
126-
"metadata": {},
127-
"source": [
128-
"#### Multiple sources of LSP messages on frontend and backend [#184][]\n",
129-
"\n",
130-
"> TBD\n",
131-
"\n",
132-
"[#184]: https://github.com/jupyter-lsp/jupyterlab-lsp/issues/184"
133-
]
134-
},
135-
{
136-
"cell_type": "markdown",
137-
"metadata": {},
138-
"source": [
139-
"#### Use mime types from server spec for language detection [#190][]\n",
140-
"\n",
141-
"> TBD\n",
142-
"\n",
143-
"[#190]: https://github.com/jupyter-lsp/jupyterlab-lsp/issues/190"
144-
]
145-
},
146-
{
147-
"cell_type": "markdown",
148-
"metadata": {},
149-
"source": [
150-
"#### Formalize and extend language transclusion [#191][]\n",
151-
"\n",
152-
"> TBD\n",
153-
"\n",
106+
"- Reorganize client source with lerna and typescript projects [#76][]\n",
107+
"- Add DiagnosticsManager, refactor DiagnosticPanel [#176][]\n",
108+
"- Multiple sources of LSP messages on frontend and backend [#184][]\n",
109+
"- Formalize and extend language transclusion [#191][]\n",
110+
"\n",
111+
"[#76]: https://github.com/jupyter-lsp/jupyterlab-lsp/issues/76\n",
112+
"[#176]: https://github.com/jupyter-lsp/jupyterlab-lsp/issues/176\n",
113+
"[#184]: https://github.com/jupyter-lsp/jupyterlab-lsp/issues/184\n",
154114
"[#191]: https://github.com/jupyter-lsp/jupyterlab-lsp/issues/191"
155115
]
156116
}
@@ -171,7 +131,7 @@
171131
"name": "python",
172132
"nbconvert_exporter": "python",
173133
"pygments_lexer": "ipython3",
174-
"version": "3.7.9"
134+
"version": "3.11.4"
175135
},
176136
"widgets": {
177137
"application/vnd.jupyter.widget-state+json": {

docs/Extending.ipynb

Lines changed: 42 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -11,100 +11,43 @@
1111
"cell_type": "markdown",
1212
"metadata": {},
1313
"source": [
14-
"> Note: the API is likely to change in the future; your suggestions are welcome!\n",
15-
"\n",
1614
"### How to add a new LSP feature?\n",
1715
"\n",
1816
"Features (as well as other parts of the frontend) reuse the\n",
1917
"[JupyterLab plugins system](https://jupyterlab.readthedocs.io/en/stable/extension/extension_dev.html#plugins).\n",
2018
"Each plugin is a [TypeScript](https://www.typescriptlang.org/) package exporting\n",
2119
"one or more `JupyterFrontEndPlugin`s (see\n",
2220
"[the JupyterLab extesion developer tutorial](https://jupyterlab.readthedocs.io/en/stable/extension/extension_tutorial.html)\n",
23-
"for an overview). Each feature has to register itself with the `FeatureManager`\n",
24-
"(which is provided after requesting `ILSPFeatureManager` token) using\n",
21+
"for an overview).\n",
22+
"\n",
23+
"Each feature has to register itself with the `FeatureManager`\n",
24+
"(which is provided after requesting `ILSPFeatureManager` token from `@jupyterlab/lsp`) using\n",
2525
"`register(options: IFeatureOptions)` method.\n",
2626
"\n",
27-
"Your feature specification should follow the `IFeature` interface, which can be\n",
28-
"divided into three major parts:\n",
27+
"The feature specification should follow the `IFeature` interface as of JupyterLab 4.0, including:\n",
2928
"\n",
30-
"- `editorIntegrationFactory`: constructors for the feature-CodeEditor\n",
31-
" integrators (implementing the `IFeatureEditorIntegration` interface), one for\n",
32-
" each supported CodeEditor (e.g. CodeMirror or Monaco); for CodeMirror\n",
33-
" integration you can base your feature integration on the abstract\n",
34-
" `CodeMirrorIntegration` class.\n",
35-
"- `labIntegration`: an optional object integrating feature with the JupyterLab\n",
36-
" interface\n",
29+
"- `id`: unique identifier of the feature, we recommend `@organization/project:feature` pattern\n",
3730
"- `capabilities`: an optional object defining the [client\n",
3831
" capabilities][clientcapabilities] implemented by your feature,\n",
39-
"- optional fields for easy integration of some of the common JupyterLab systems,\n",
40-
" such as:\n",
41-
" - settings system\n",
42-
" - commands system (including context menu)\n",
4332
"\n",
44-
"For further integration with the JupyterLab, you can request additional\n",
45-
"JupyterLab tokens (consult JupyterLab documentation on\n",
46-
"[core tokens](https://jupyterlab.readthedocs.io/en/stable/extension/extension_points.html#core-tokens)).\n",
33+
"See JupyterLab [Extension Points >> LSP Features](https://jupyterlab.readthedocs.io/en/latest/extension/extension_points.html#lsp-features) documentation for more details.\n",
4734
"\n",
4835
"#### How to override the default implementation of a feature?\n",
4936
"\n",
50-
"You can specify a list of extensions to be disabled the the feature manager\n",
51-
"passing their plugin identifiers in `supersedes` field of `IFeatureOptions`.\n",
37+
"You can specify a list of plugins implementing features which you want to\n",
38+
"disable in [`jupyterlab.disabledExtensions`][disabledExtensions] stanza of `package.json`, for example:\n",
39+
"\n",
40+
"```json\n",
41+
"\"jupyterlab\": {\n",
42+
" \"disabledExtensions\": [\"@jupyter-lsp/jupyterlab-lsp:hover\"]\n",
43+
"}\n",
44+
"```\n",
45+
"\n",
46+
"will disable the hover feature.\n",
5247
"\n",
5348
"[clientCapabilities]:\n",
54-
"https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#clientCapabilities]"
55-
]
56-
},
57-
{
58-
"cell_type": "markdown",
59-
"metadata": {},
60-
"source": [
61-
"### How to integrate a new code editor implementation?\n",
62-
"\n",
63-
"`CodeMirrorEditor` code editor is supported by default, but any JupyterLab\n",
64-
"editor implementing the `CodeEditor.IEditor` interface can be adapted for the\n",
65-
"use with the LSP extension. To add your custom code editor (e.g. Monaco) after\n",
66-
"implementing a `CodeEditor.IEditor` interface wrapper (which you would have\n",
67-
"anyways for the JupyterLab integration), you need to also implement a virtual\n",
68-
"editor (`IVirtualEditor` interface) for it.\n",
69-
"\n",
70-
"#### Why virtual editor?\n",
71-
"\n",
72-
"The virtual editor takes multiple instances of your editor (e.g. in a notebook)\n",
73-
"and makes them act like a single editor. For example, when \"onKeyPress\" event is\n",
74-
"bound on the VirtualEditor instance, it should be bound onto each actual code\n",
75-
"editor; this allows the features to be implemented without the knowledge about\n",
76-
"the number of editor instances on the page.\n",
77-
"\n",
78-
"#### How to register the implementation?\n",
79-
"\n",
80-
"A `virtualEditorManager` will be provided if you request\n",
81-
"`ILSPVirtualEditorManager` token; use\n",
82-
"`registerEditorType(options: IVirtualEditorType<IEditor>)` method passing a name\n",
83-
"that you will also use to identify the code editor, the editor class, and your\n",
84-
"VirtualEditor constructor."
85-
]
86-
},
87-
{
88-
"cell_type": "markdown",
89-
"metadata": {},
90-
"source": [
91-
"### How to integrate a new `DocumentWidget`?\n",
92-
"\n",
93-
"JupyterLab editor widgets (such as _Notebook_ or _File Editor_) implement\n",
94-
"`IDocumentWidget` interface. Each such widget has to adapted by a\n",
95-
"`WidgetAdapter` to enable its use with the LSP extension. The role of the\n",
96-
"`WidgetAdapter` is to extract the document metadata (language, mimetype) and the\n",
97-
"underlying code editor (e.g. CodeMirror or Monaco) instances so that other parts\n",
98-
"of the LSP extension can interface with them without knowing about the\n",
99-
"implementation details of the DocumentWidget (or even about the existence of a\n",
100-
"Notebook construct!).\n",
101-
"\n",
102-
"Your custom `WidgetAdapter` implementation has to register itself with\n",
103-
"`WidgetAdapterManager` (which can be requested with `ILSPAdapterManager` token),\n",
104-
"calling `registerAdapterType(options: IAdapterTypeOptions)` method. Among the\n",
105-
"options, in addition to the custom `WidgetAdapter`, you need to provide a\n",
106-
"tracker (`IWidgetTracker`) which will notify the extension via a signal when a\n",
107-
"new instance of your document widget is getting created."
49+
"https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#clientCapabilities]\n",
50+
"[disabledExtensions]: https://jupyterlab.readthedocs.io/en/latest/extension/extension_dev.html#disabling-other-extensions"
10851
]
10952
},
11053
{
@@ -120,8 +63,8 @@
12063
"\n",
12164
"#### Future plans for transclusions handling\n",
12265
"\n",
123-
"We will strive to make it possible for kernels to register their custom\n",
124-
"syntax/code transformations easily, but the frontend API will remain available\n",
66+
"We welcome pull requests enabling kernels to register their custom\n",
67+
"syntax/code transformations. The frontend API will remain available\n",
12568
"for the end-users who write their custom syntax modifications with actionable\n",
12669
"side-effects (e.g. a custom IPython magic which copies a variable from the host\n",
12770
"document to the embedded document)."
@@ -166,6 +109,26 @@
166109
"[theme-vscode](https://github.com/jupyter-lsp/jupyterlab-lsp/tree/master/packages/theme-vscode)."
167110
]
168111
},
112+
{
113+
"cell_type": "markdown",
114+
"metadata": {},
115+
"source": [
116+
"### Migrating to v5.0"
117+
]
118+
},
119+
{
120+
"cell_type": "markdown",
121+
"metadata": {},
122+
"source": [
123+
"- `IFeature` interface was moved to `@jupyterlab/lsp`\n",
124+
" - `labIntegration` was removed,\n",
125+
" - `editorIntegrationFactory` was removed in JupyterLab 4.0 and restored in JupyterLab 4.1 as `extensionFactory` with new API (`ILSPEditorExtensionFactory`),\n",
126+
" - `supersedes` was removed; you can disable extensions using the JupyterLab native `jupyterlab.disabledExtensions` stanza of `package.json`.\n",
127+
"- `ILSPCompletionThemeManager`:\n",
128+
" - `register_theme()` was renamed to `registerTheme()`\n",
129+
" - all other methods were renamed to follow camelCase convention\n"
130+
]
131+
},
169132
{
170133
"cell_type": "markdown",
171134
"metadata": {},
@@ -306,7 +269,7 @@
306269
"name": "python",
307270
"nbconvert_exporter": "python",
308271
"pygments_lexer": "ipython3",
309-
"version": "3.7.9"
272+
"version": "3.11.4"
310273
},
311274
"widgets": {
312275
"application/vnd.jupyter.widget-state+json": {

0 commit comments

Comments
 (0)