Closed Alexey-T closed 3 years ago
Из вики:
on_func_hint ... Method should return function-hint string (comma-separated parameters, brackets are optional).
Я просто следовал букве закона :)
Я с огромным удовольствием показывал бы типа параметров и активный параметр; описание функции наверное достаточно иметь в hover? Вот что сервер дает в этом случае:
{'activeParameter': 0,
'activeSignature': 0,
'message_id': 1,
'signatures': [{'activeParameter': None,
'documentation': '',
'label': 'read(n: int=...) -> AnyStr',
'parameters': [{'documentation': None, 'label': 'n'}]}]}
и например еще re.match()
(это из команды плагина - Server responses)
{'activeParameter': 0,
'activeSignature': 0,
'message_id': 2,
'signatures': [{'activeParameter': None,
'documentation': 'Try to apply the pattern at the start of the string, returning\n'
'a Match object, or None if no match was found.',
'label': 'match(pattern: AnyStr, string: AnyStr, flags: _FlagsType=...) -> '
'Optional[Match[AnyStr]]',
'parameters': [{'documentation': None, 'label': 'pattern'},
{'documentation': None, 'label': 'string'},
{'documentation': None, 'label': 'flags'}]}]}
Есть шанс добавить сюда цвета или хотя бы bold,italic? Потому что простой текст не очень помогает
you can return str, or True!
on_func_hint(self, ed_self): Called by "show function-hint" command (default hotkey: Ctrl+Shift+Space). Method should return function-hint string (comma-separated parameters, brackets are optional). Empty string or None mean that no hint was found. True return value means that plugin handled the event, don't call other plugins.
if True, show func-tip with msg_status_alt()
2) bold html tags in result str-- Todo for me
3) why linked pic shows different params-tooltip?
нужен небольшой фикс- on_func_hint отдавать не '' а True, потом плаг все равно показывает msg_status_alt.
I meant that wiki quote says result should be just a
comma-separated parameters
I understood that I should give just parameter names coma-separated... for sys.stdin.read
it is just n
...anyway, does this looks alright for now?
it can be
new variant looks better!
changed
https://github.com/palantir/python-language-server Signature Help: https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/signature-help.gif
у нас по 'function hint' совсем не то показывает- для sys.stdin.read кажет "n"