diff --git a/pylsp/hookspecs.py b/pylsp/hookspecs.py index d1a2458e..39343e80 100644 --- a/pylsp/hookspecs.py +++ b/pylsp/hookspecs.py @@ -89,7 +89,7 @@ def pylsp_format_range(config, workspace, document, range, options): pass -@hookspec(firstresult=True) +@hookspec def pylsp_hover(config, workspace, document, position): pass diff --git a/pylsp/python_lsp.py b/pylsp/python_lsp.py index 43f886cc..d35f42f2 100644 --- a/pylsp/python_lsp.py +++ b/pylsp/python_lsp.py @@ -369,7 +369,10 @@ def highlight(self, doc_uri, position): return flatten(self._hook('pylsp_document_highlight', doc_uri, position=position)) or None def hover(self, doc_uri, position): - return self._hook('pylsp_hover', doc_uri, position=position) or {'contents': ''} + out = self._hook('pylsp_hover', doc_uri, position=position) + if out: + return {'contents': [o['contents'] for o in out]} + return {'contents': ''} @_utils.debounce(LINT_DEBOUNCE_S, keyed_by='doc_uri') def lint(self, doc_uri, is_saved):