shagabutdinov / sublime-snippet-caller

Snippet system on top of default sublime snippets
Other
6 stars 3 forks source link

eval not working in ST3? #1

Closed VorpalBlade closed 9 years ago

VorpalBlade commented 9 years ago

I have installed this plugin in ST3 (build 3065, 64-bit Linux) independently (that is, all dependencies it wanted, recursively, but not the full sublime-enhanced) and I can not get to work. That section appears to be ignored. I even added a print() in my eval code and it did not show up in the sublime console.

Also, and this may perhaps be indicative of that the plugin as a whole is not properly working, using the documented .sublime-snippet-enhanced extension results in the snippets not being detected.

Please tell me if there is any other information that might be useful for debugging this issue.

VorpalBlade commented 9 years ago

The issue appears to be that this doesn't work from the built in completion (that is, the white popup that Sublime shows when you start typing containing snippets as well as other words to complete). That feature still uses the stock snippet code.

It does work from the provided keybinding (once I change it that is, I can not hit Ctrl+\ on my keyboard, I need AltGr to get ).

I would love if it was possible to add integration with the normal completion feature of sublime. If it isn't possible, it should probably be documented in the readme.md file.

shagabutdinov commented 9 years ago

I've red carefully page http://docs.sublimetext.info/en/latest/reference/api.html#sublime_plugin.EventListener.on_query_completions and I think that there is no straight way to do this, because there is no way to catch snippet expansion when completion list is used.

There is command "commit_completion", but even if we will be able to replace this command with other one I didn't find way to see which completion was selected (in order to work with this completion).

I don't use exanding completion list so I didn't found this bug by myself, sorry. Probably, the best way will be expand snippets with "eval" by hitting "tab" or using snippets list. I'll update docs soon.