From 43dc63a06c86ea0b2d48cfd9a33f3da5107a149c Mon Sep 17 00:00:00 2001 From: Daniel Zvara Date: Fri, 13 Nov 2020 14:17:03 +0100 Subject: [PATCH 1/3] Report document version back in diagnostics hook --- pyls/python_ls.py | 4 +++- pyls/workspace.py | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pyls/python_ls.py b/pyls/python_ls.py index 04a3b42f..9e091413 100644 --- a/pyls/python_ls.py +++ b/pyls/python_ls.py @@ -291,10 +291,12 @@ def hover(self, doc_uri, position): def lint(self, doc_uri, is_saved): # Since we're debounced, the document may no longer be open workspace = self._match_uri_to_workspace(doc_uri) + textDocument = workspace.get_maybe_document(doc_uri) if doc_uri in workspace.documents: workspace.publish_diagnostics( doc_uri, - flatten(self._hook('pyls_lint', doc_uri, is_saved=is_saved)) + flatten(self._hook('pyls_lint', doc_uri, is_saved=is_saved)), + textDocument.version if textDocument else None ) def references(self, doc_uri, position, exclude_declaration): diff --git a/pyls/workspace.py b/pyls/workspace.py index e3a7e7ab..4e5f4c1e 100644 --- a/pyls/workspace.py +++ b/pyls/workspace.py @@ -104,8 +104,12 @@ def update_config(self, settings): def apply_edit(self, edit): return self._endpoint.request(self.M_APPLY_EDIT, {'edit': edit}) - def publish_diagnostics(self, doc_uri, diagnostics): - self._endpoint.notify(self.M_PUBLISH_DIAGNOSTICS, params={'uri': doc_uri, 'diagnostics': diagnostics}) + def publish_diagnostics(self, doc_uri, diagnostics, version): + self._endpoint.notify(self.M_PUBLISH_DIAGNOSTICS, params={ + 'uri': doc_uri, + 'diagnostics': diagnostics, + 'version': version + }) def show_message(self, message, msg_type=lsp.MessageType.Info): self._endpoint.notify(self.M_SHOW_MESSAGE, params={'type': msg_type, 'message': message}) From 626667573c1a7836c1e144790b5390feb7f3c111 Mon Sep 17 00:00:00 2001 From: danzvara Date: Fri, 20 Nov 2020 17:54:04 +0100 Subject: [PATCH 2/3] Update README.rst --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index 2dbe128c..e5410412 100644 --- a/README.rst +++ b/README.rst @@ -15,6 +15,10 @@ Python Language Server A Python 2.7 and 3.5+ implementation of the `Language Server Protocol`_. +[Deepnote] Local development +------------ +Run ``python -m pyls --tcp --host 0.0.0.0 -v`` to start language server, before launching colaboration service. + Installation ------------ From 5500b9a8ab614e05f7bd9eb1a26d3a79dbde6a8a Mon Sep 17 00:00:00 2001 From: Oleh Date: Fri, 28 Feb 2025 11:36:38 +0100 Subject: [PATCH 3/3] Add deprecation notice (#4) --- README.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.rst b/README.rst index e5410412..c6b4d891 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,9 @@ Python Language Server ====================== +Deprecated in favor of `our fork of python-lsp-server `_ . Use it instead. + + .. image:: https://github.com/palantir/python-language-server/workflows/Linux%20tests/badge.svg :target: https://github.com/palantir/python-language-server/actions?query=workflow%3A%22Linux+tests%22