Sublime Forum

Dev Build 2030

#4

New completion system is very cool!

But wrapping selection with html tags is not working?

0 Likes

#5

Will add for the next build.

If you want the completions in the one file to apply to multiple scopes, you can use a selector like “source.python, source.ruby”. If you want different sets of completions for different scopes, then you need to use multiple .sublime-completions files.

0 Likes

#6

(on linux version)

Been playing with the autocomplete (from snippets) for PHP hoping to speed my day up, a few of them seem to work, and yet others dont.

For example the php class snippet, (checked the source and tabtrigger is just ‘class’) doesn’t seem to expand for me on tab.

Is anyone else getting the same thing?

0 Likes

#7

The PHP class snippet is working for me, FWIW. Just to be sure, you’re in a PHP file, between <?php .. ?> tokens?

0 Likes

#8

Aha well caught, I work a lot with CodeIgniter, and the default style guidelines are that you omit the ?> end token, it worked fine when I added it in. Would it be possible for this to work without the PHP termination marker? Not a feature request, just asking! I know you have enough to do as it is right now XD. Thanks again mate.

0 Likes

#9

I may be mistaking features for bugs, but expanding a snippet and deleting the generated text seems to (a) not decrement the field counter in the status bar and (b) make the next snippet expansion only work if I press Tab twice in a row, move the cursor with arrow keys before trying to do the expansion (e. g. before entering the snippet’s trigger or after that but before pressing Tab) or press Ctrl+Space instead of Tab.

0 Likes

#10

A more positive comment for you, THANK YOU THANK YOU for making the sidebar autoupdate, I am only one feature away from using it full time now :smile: (create new file from file tree).

0 Likes

#11

I second that request. I use the Codeigniter style too.

0 Likes

#12

The specific issue is that PHP snippets won’t trigger at EOF, because the selector won’t match there (the reported scope is always text.html.basic at EOF in a PHP file). I’ll fix this for the next build.

The rules for when snippet fields are cancelled aren’t great from a usability POV: they appear to stick around for too long. There’s good reasons for why they act like they do, but it’s something I need to address. In the mean time you can press escape to cancel all the snippet fields.

It’s coming, but in the mean time there’s a way to create a file in a specific directory: when creating a new file via Ctrl+N, it’ll save by default to the directory of the last file you used. Open a file in the directory of interest, then hit Ctrl+N, then Ctrl+S, and you’ll be in the right spot.

When I first implemented it, snippets used fuzzy matching on the tab trigger. I didn’t particularly like it, because I kept getting snippets unexpectedly inserted when I was just trying to complete a word. I think there’s some justification for this: snippets already tend to have short tab triggers, and a snippet often isn’t really a word completion target, but a code generation mnemonic.

For example, if I have a python function with a function called ‘classify’, it’s likely typing cls,tab means I want to insert ‘classify’, rather than generate a class template.

0 Likes

[BUG] Scope selector fails when cursor in a very end of file
#13

Great news, thanks again for all the hard work man!

0 Likes

#14

This is great! I’ve been waiting for the auto-complete feature! Komodo Editor has it’s source code open and includes some nice code intelligence under an Mozilla license I was hoping someone or me could port to sublime …to that, is there anyway we can bind the auto-complete to other keys in a per-language basis? …like for instance for some languages bind on using dot, for some on using ->, for some others, like python, on using both dot and also space under certain circumstances (i.e. when you use space after “import” or “from”) …as to show auto-complete for class members and attributes, and for modules that can be currently imported and so on. As to make auto-completion as fluid as just simply writing code and so it just pops up whenever something is available as you write code.

0 Likes

#15

There seems to be a bug with autocomplete in PHP at least, trying to complete all functions when prefixing with $. If the first letter of the word is $, autocomplete should only look for variable words, not function words. Just type $u <ctrl+space> and you get tons of results that shouldn’t be there.

0 Likes

#16

Dev Build 2031 is out now with a few tweaks.

0 Likes

#17

Dev download links aren’t updated yet. :smile:

0 Likes

#18

Fixed now, cheers

0 Likes

#19

Just noticed the PHP fixes in 2031, thanks for the quick turnaround :smile: will test now.

0 Likes

#20

Jon, the completion stuff, parameters need to be provided in descending order? I.e.:

contents: "test($1, $0)"

instead of

contents: "test($0, $1)"

At least, the former works for me, not the latter. Is that by design?

0 Likes

#21

The order is $1, $2, $3, …, $0 - it’s a TextMate-ism. Furthermore, if $0 isn’t present in the snippet, it’ll be implicitly added to the end.

0 Likes

#22

Started on a C completions file @ bitbucket.org/asmodai/sublimetext

0 Likes

#23

Awesome! Thanks. :smile:

0 Likes