-
Notifications
You must be signed in to change notification settings - Fork 523
Open
Description
I didn't like the fact it had a lot of text in an entry, which at the same time didn't give quick feedback to user about what the completion is about.
So I started playing around with code, to improve this, and I got to this point:

I wanted to create a pull request, but the changes are done to the version that's different from master. Also that's probably one of my first Python lines in my life.
Here I attach format_competions_by_language function:
def format_completions_by_language(cplns, language, text_in_current_line, trigger):
function = None if 'import ' in text_in_current_line else 'function'
def get_symbol(t):
symbols = {
'variable': '🅥',
'constant': '🅓',
'namespace': '🅝',
'keyword': '🅚',
'function': '🅕',
'class': '🅒',
'interface': '🅘',
}
if language == "PHP" and trigger and (trigger.name == "php-complete-object-members" or trigger.name == "php-complete-static-members"):
symbols['variable'] = '🅟'
symbols['function'] = '🅜'
return symbols[t] if t in symbols else t
def get_name(t, n):
if t == 'variable' and language == 'PHP':
return '$'+n
elif t == 'function':
return n+'(…)'
return n
return [('%s %s' % (get_symbol(t), get_name(t, n,)), (n).replace("$", "") + ('($0)' if t == function else '')) for t, n in cplns]Feel free to use this code and I'll be happy if it gets implemented into master
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels