diff --git a/README.rst b/README.rst index 2dbe128c..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 @@ -15,6 +18,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 ------------ 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})