Home Download Buy Blog Forum Support

Adding a description to the completions format

Adding a description to the completions format

Postby eliquious on Wed Dec 05, 2012 4:01 pm

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?
eliquious
 
Posts: 6
Joined: Tue Dec 04, 2012 7:55 pm

Re: Adding a description to the completions format

Postby C0D312 on Wed Dec 05, 2012 4:51 pm

It has been a while but I believe you can suffix the contents with "\tYOUR_DESCRIPTION_HERE"
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Adding a description to the completions format

Postby agibsonsw on Wed Dec 05, 2012 8:40 pm

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

Code: Select all
{ "trigger": "shape\tArea", "contents": "shape" },
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Adding a description to the completions format

Postby eliquious on Wed Dec 05, 2012 9:13 pm

Awesome, thanks!
eliquious
 
Posts: 6
Joined: Tue Dec 04, 2012 7:55 pm

Re: Adding a description to the completions format

Postby agibsonsw on Wed Dec 05, 2012 9:15 pm

eliquious wrote:Awesome, thanks!

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 ;) .
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Adding a description to the completions format

Postby eliquious on Wed Dec 05, 2012 9:58 pm

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. :)
eliquious
 
Posts: 6
Joined: Tue Dec 04, 2012 7:55 pm

Re: Adding a description to the completions format

Postby agibsonsw on Thu Dec 06, 2012 9:37 am

or something similar in the description


..you can in the description but not in the trigger. Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Adding a description to the completions format

Postby eliquious on Thu Dec 06, 2012 4:07 pm

Ahh.. I see. So as long as a tab separates the two, then you can have special chars in the desc. Thanks.
eliquious
 
Posts: 6
Joined: Tue Dec 04, 2012 7:55 pm


Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 8 guests