21 lines
533 B
Python
21 lines
533 B
Python
# Copyright 2017 Palantir Technologies, Inc.
|
|
|
|
import logging
|
|
|
|
from confls import hookimpl
|
|
from pyls import _utils
|
|
from confls.helpers import SYSTEMD_COMPLETOR
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
|
|
@hookimpl
|
|
def pyls_hover(document, position):
|
|
code_position = _utils.position_to_jedi_linecolumn(document, position)
|
|
word = document.word_at_position(position)
|
|
details = SYSTEMD_COMPLETOR.get_one(word)
|
|
if details is not None:
|
|
return {'contents': details.doc, "contentFormat": "markdown"}
|
|
else:
|
|
return
|