Home Download Buy Blog Forum Support

Auto complete plugin

Auto complete plugin

Postby quarnster on Tue Nov 29, 2011 11:48 am

Hi,

If I for example insert a C++ std::map snippet, "key" will be selected and if I press tab it'll select "value". It would be great if the auto complete on_query_completions api could insert a function with the full parameter list filled in, select the first parameter and on pressing tab selects the next parameter in a similar fashion as if I had inserted a snippet. Is this possible and if so how?

Also, the autocomplete popup window's width is too small for what I want to display in it. Is there a way to resize it?

Thanks
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: Auto complete plugin

Postby quarnster on Tue Nov 29, 2011 12:05 pm

Nevermind about the "snippet" functionality, I figured it out. You just make it return something like:
Code: Select all
[("test()","test(${1:int arg1}, ${2:char arg2})")]


I love this editor! :)
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: Auto complete plugin

Postby C0D312 on Tue Nov 29, 2011 8:53 pm

EDIT: autocomplete accepts a tuple, the first being what's visible to the user, the second what is actually inserted. Autocomplete accepts snippet notation (${1:SOME TEXT}). In more recent builds, snippet markup is hidden by from user by default.

---
IGNORE: Not possible, unfortunately. I hope this gets added. I think the autocomplete API could use an upgrade.
Last edited by C0D312 on Wed Jan 11, 2012 7:56 pm, edited 1 time in total.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Auto complete plugin

Postby masonmark on Mon Dec 12, 2011 2:32 am

Just to note, I also need the completion menu to handle (much) wider completions.

There is a ticket in the system, at:

http://sublimetext.userecho.com/topic/8 ... -be-wider/

Please go upvote it so it gets some attention from Jon. (I really doubt it's a hard change to make.)
masonmark
 
Posts: 3
Joined: Thu Jun 30, 2011 8:48 am

Re: Auto complete plugin

Postby C0D312 on Sun Dec 18, 2011 8:56 pm

Nevermind about the "snippet" functionality, I figured it out.


Stop the presses. We can have snippets in autocomplete?! :D
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 10 guests