Skip to content

Commit 2c784d4

Browse files
committed
Allow multiple hover results
1 parent 297099c commit 2c784d4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pylsp/hookspecs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def pylsp_format_range(config, workspace, document, range, options):
8989
pass
9090

9191

92-
@hookspec(firstresult=True)
92+
@hookspec
9393
def pylsp_hover(config, workspace, document, position):
9494
pass
9595

pylsp/python_lsp.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,11 @@ def highlight(self, doc_uri, position):
369369
return flatten(self._hook('pylsp_document_highlight', doc_uri, position=position)) or None
370370

371371
def hover(self, doc_uri, position):
372-
return self._hook('pylsp_hover', doc_uri, position=position) or {'contents': ''}
372+
out = self._hook('pylsp_hover', doc_uri, position=position)
373+
if out:
374+
return {'contents': [o['contents'] for o in out]}
375+
else:
376+
return {'contents': ''}
373377

374378
@_utils.debounce(LINT_DEBOUNCE_S, keyed_by='doc_uri')
375379
def lint(self, doc_uri, is_saved):

0 commit comments

Comments
 (0)