From e9fd585cdaf085e0d70d31746877cc09e84d4263 Mon Sep 17 00:00:00 2001 From: Prescott Murphy Date: Mon, 22 Jul 2024 18:59:29 -0400 Subject: [PATCH 1/2] Pass style with meta completion text --- ptpython/completer.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ptpython/completer.py b/ptpython/completer.py index e8bab28..736756a 100644 --- a/ptpython/completer.py +++ b/ptpython/completer.py @@ -285,12 +285,15 @@ def get_completions( if jc.type == "param": suffix = "..." + style = _get_style_for_jedi_completion(jc) + display_meta = jc.type if style == "" else [(style, jc.type)] + yield Completion( jc.name_with_symbols, len(jc.complete) - len(jc.name_with_symbols), display=jc.name_with_symbols + suffix, - display_meta=jc.type, - style=_get_style_for_jedi_completion(jc), + display_meta=display_meta, + style=style, ) From 514e8a989989fd80ddadc420ec65dbbc00a04361 Mon Sep 17 00:00:00 2001 From: Prescott Murphy Date: Mon, 22 Jul 2024 19:29:59 -0400 Subject: [PATCH 2/2] Use distinct style to make feature completely opt-in --- ptpython/completer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ptpython/completer.py b/ptpython/completer.py index 736756a..40701ca 100644 --- a/ptpython/completer.py +++ b/ptpython/completer.py @@ -286,7 +286,9 @@ def get_completions( suffix = "..." style = _get_style_for_jedi_completion(jc) - display_meta = jc.type if style == "" else [(style, jc.type)] + display_meta = ( + jc.type if style == "" else [(f"{style}-meta", jc.type)] + ) yield Completion( jc.name_with_symbols,