Sublime Forum

20090530 Beta

#1

This is mostly a fairly minor update, just a handful of bug fixes I wanted to get out there. Notably though, it does have the much-requested auto complete support in the API.

Auto complete itself is now implemented via a plugin, and you can choose to either hook into that, or show a separate completions menu (via the new method view.showCompletions).

A short example of hooking into the existing auto complete command:

from AutoComplete import AutoCompleteCommand

def AddGreeting(view, pos, prefix, completions):
	return "Hello!"] + completions
	
AutoCompleteCommand.completionCallbacks'AddGreeting'] = AddGreeting

This will add “Hello!” as the first available auto complete suggestion.

0 Likes

#2

Freaking awesome! Thanks Jon :smile:
Can you elaborate on bug fixes in this release?

0 Likes

#3

They’re listed in the changelog at http://www.sublimetext.com/beta: the last 4 items mentioned are bug fixes.

0 Likes

#4

[quote=“jps”]

They’re listed in the changelog at http://www.sublimetext.com/beta: the last 4 items mentioned are bug fixes.[/quote]

Nice, my bad I forgot to check that page, I was on the phone when posting that :confused:

Really looking forward to

0 Likes

#5

The changed autocompletion makes me happy as you removed the dependecy on trailing punctuation. This was sometimes annoying when programming PL/SQL.
Many thanks

0 Likes

#6

[quote=“sublimator”]Any chance to get a callback API for the autocomplete widget?

Useful for example to insert automatically generated inline snippets from CTags symbols.

cleared	.\fixtures.py	/^def cleared(fixtures=None, drop_create=False):$/;"	f
cleared(${0:fixtures=None}, ${1:drop_create=False})$15

Or maybe we are just better off creating sublime-snippet files automatically from CTags definitions using x,x,x,x,tab handlers? This would allow us to tweak them.

Thoughts people?

I’m actually leaning towards the latter, in which case we wouldn’t really need a callback API would we.[/quote]

either way you do it, make it optional. In a really LARGE project I wouldn’t want a bunch of sublime-snippets files reflecting all the ctags from that project, it would easily get to the 10k snippet files in a sec lol…
On the other hand I would like for the ctags to pop down and show me all the definitions and allow me to select whichever :smile:

Now, if youre thinking of doing insertInlineSnippet when selecting the definition (function) from the drop down then I don’t see a problem why not have the snippet dynamically generated for you. (without creating sublime-snippet files tho)

0 Likes