Skip to content

Commit

Permalink
Allow multiple hover results
Browse files Browse the repository at this point in the history
  • Loading branch information
Richardk2n committed Jun 3, 2023
1 parent 297099c commit f8b42d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pylsp/hookspecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion pylsp/python_lsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit f8b42d1

Please sign in to comment.