Sublime Forum

Adding a description to the completions format

#1

I just finished a Python.sublime-completions file and noticed a discrepancy between the snippet and completion formats. Snippets include a description field where as the sublime-completion format does not.

Can this feature be added so .sublime-completions will have descriptions like snippets do?

0 Likes

#2

It has been a while but I believe you can suffix the contents with “\tYOUR_DESCRIPTION_HERE”

0 Likes

#3

It is actually within the trigger. Here’s an example:

{ "trigger": "shape\tArea", "contents": "shape" },
0 Likes

#4

Awesome, thanks!

0 Likes

#5

No worries. **Hint **don’t use brackets or other *odd *characters ( - . “space”, etc.) as part of the trigger as this can prevent the default (file) completions from appearing, as I discovered recently. (Odd characters in the description don’t seem to be a concern.)

Added: I have Python completions under Package Control as AndyPython :wink: .

0 Likes

#6

Cool, thanks again. It’s a shame brackets won’t work, it would be nice to include function diagrams
(ie. open(name, mode, buffering]])) or something similar in the description.

I’ll take a look at AndyPython as well. :smile:

0 Likes

#7

…you can in the description but not in the trigger. Andy.

0 Likes

#8

Ahh… I see. So as long as a tab separates the two, then you can have special chars in the desc. Thanks.

0 Likes