New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Synergy with company *during* yasnippet expansion #781
Comments
Try setting a breakpoint on |
Hmnn, It looks like sometimes company-active-map's tab is the one that gets called over yasnippet's tab. When that happens, I see this breakage. this command company-select-next-if-tooltip-visible-or-complete-selection ;; <-- yas--check-commit-snippet not called yet
this command indent-for-tab-command ;; pressing TAB again prints these two messages out
yas--check-commit-snippet called
So clashing mode maps,, I would've thought yasnippet would have the highest priority with its keymap being in the overlay vs company which pushes its keymap to emulation-mode-map-alists. Then again, this bug only shows 5-10% of the time so it seems like in the good case, yasnippet does have priority. |
Do you have a reproducible recipe for the bad case? |
I'm closing, as there is no bug that I can see. Don't hesitate to post if you have more info. |
Possibly this is the same as #982. |
I had the same problem where pressing The details of my use case are (using company-lsp with lsp-mode):
I assume keymaps are last-one-wins, so maybe the second use of company-mode doesn't reinstate the company-mode keymap? I am currently using this yassnippet
|
Edit: nevermind about this, I don't actually want this behavior. While I'm on this topic, I tried updating my tab to be:
So after it company completes it automatically jumps to the next snippet, but the snippet jumping doesn't seem to happen. I see |
Actually this is #987. It requires minor changes to both yasnippet (to add a hook) and company-mode (to use the hook).
I'll make a quick guess that |
@muirrn With the latest snapshot builds of company and yasnippet, you now get this behavior. I can imagine a couple of reasons why you might not want it after all, but the second option doesn't seem universal either. I'm open to new ideas in this area, though. |
Thanks. I can confirm it works. I was using |
Nice, working so far for me too.
Welp, sorry about that. Slipped my mind on the order of about 2 years. :D |
I'm trying to get company and yasnippet to behave properly together when a snippet expansion is already happening.
For example
I have something like this to hopefully prioritize company.
This seems to work, company expands the snippet or cycles through the completion list. At this point, I'd expect yasnippet's snippet expansion to continue working. It seems to continue working half the time afterward company 'completes', I'm able to get to the next field/expansion. The other half of the time, it seems to backfill to my
previous?
tab command.I took a quick look at the code and possibly, the overlay is going away?
Setting a breakpoint on
This actually gets called in the good case but never gets called in the bad case, so I'm a little lost on how to figure this out.
Any help would be appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: