joaotavora / yasnippet

A template system for Emacs
http://joaotavora.github.io/yasnippet/
2.81k stars 311 forks source link

Yasnippet mirrors doesn't comply with autocomplete/company mode #588

Open ReneFroger opened 9 years ago

ReneFroger commented 9 years ago

Hi there! I really appreciate all the work for the yasnippet.

However, I'm sometimes struggling with a bug. For example, you have the following snippet

   class $1 {

   } // End of class $1

So when you're typing foobar in the first $1, then the second $1 will have the same as the first $1.

But sometimes you will get already a suggest from Company mode, that he could autocomplete the foobar for you in when you typing fo. When I press tab in order to accept the complete suggestion, then the second $1 will not get the input while $1 is being completed by company.

I'm aware this is somewhat complex to debug, but I'm wondering if this is even possible to solve it?

Thanks in advance for your answer.

stardiviner commented 9 years ago

@ReneFroger Maybe you need to try to bind company-mode select to [C-j] instead of [Tab] to test whether this is a problem of key conflicting.

npostavs commented 9 years ago

When I press tab in order to accept the complete suggestion, then the second $1 will not get the input while $1 is being completed by company.

I'm aware this is somewhat complex to debug, but I'm wondering if this is even possible to solve it?

I guess the problem is Company mode bypasses some modification hooks that yasnippet relies on? Maybe there is other hook that Company runs when it inserts a completion?