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: docs/source/howto/migrate-to-v2.rst
+38-8Lines changed: 38 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,55 @@
1
-
How To Migrate to v2.0
1
+
How To Migrate to v2.0
2
2
======================
3
3
4
+
4
5
.. note::
5
6
6
7
This guide is still a draft, some details may change
7
8
8
9
The highlight of the *pygls* v2 release is upgrading ``lsprotocol`` to ``v2024.x`` bringing with it support for the proposed LSP v3.18 types and methods.
9
-
It also includes standardised object names (so no more classes like ``NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2CellsType``!)
10
+
The new version includes standardised object names (so no more classes like ``NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2CellsType``!)
10
11
12
+
With the major version bump, this release also takes the opportunity to clean up the codebase by removing deprecated code and renaming a few things to try and improve overall consistency.
11
13
This guide outlines how to adapt an existing server to the breaking changes introduced in this release.
12
14
13
15
**Known Migrations**
14
16
15
-
You may find insight and inspiration from these projects that have already successfully migrated to v2:
17
+
You may find these projects that have already successfully migrated to v2 a useful reference:
*pygls v2* removes support for Python 3.8 and adds support for Python 3.13 (with the GIL, you are welcome to try the free-threaded version just note that it has not been tested yet!)
27
+
16
28
17
-
.. NOTE: The missing link below will be filled in a future PR once we have a stable hash for the commit that updates the example servers.
29
+
Removed Deprecated Functions
30
+
----------------------------
18
31
19
-
- Our `example servers <>`__
32
+
The following methods and functions have been deprecated for some time and have now been removed in *pygls v2*.
``pygls.workspace.utf16_unit_offset`` ``TextDocument.position_codec.utf16_unit_offset`` or ``Workspace.position_codec.utf16_unit_offset``
39
+
``pygls.workspace.utf16_num_units`` ``TextDocument.position_codec.client_num_units`` or ``Workspace.position_codec.client_num_units``
40
+
``pygls.workspace.position_from_utf16`` ``TextDocument.position_codec.position_from_client_units`` or ``Workspace.position_codec.position_from_client_units``
41
+
``pygls.workspace.position_to_utf16`` ``TextDocument.position_codec.position_to_client_units`` or ``Workspace.position_codec.position_to_client_units``
42
+
``pygls.workspace.range_from_utf16`` ``TextDocument.position_codec.range_from_client_units`` or ``Workspace.position_codec.range_from_client_units``
43
+
``pygls.workspace.range_to_utf16`` ``TextDocument.position_codec.range_to_client_units`` or ``Workspace.position_codec.range_to_client_units``
The :class:`~pygls.lsp.LanuageServer` class has been moved to the ``pygls.lsp`` module::
26
55
@@ -32,7 +61,7 @@ The :class:`~pygls.lsp.LanuageServer` class has been moved to the ``pygls.lsp``
32
61
from pygls.lsp.server import LanguageServer
33
62
server = LanguageServer(name="my-language-server", version="v1.0")
34
63
35
-
All server-side LSP methods are now automatically generated from the specification, as a result the following methods have been renamed
64
+
All LSP requests and notifications that can be sent by a server are now automatically generated from the specification, as a result the following methods have been renamed
0 commit comments