emacs-ycmd icon indicating copy to clipboard operation
emacs-ycmd copied to clipboard

Suggestion: Using snippet instead of company-template

Open zhuzhongshu opened this issue 10 years ago • 5 comments
trafficstars

I use company-irony as my C++ completion backend before, but it doesn't support fuzzy matching, so I try to use company-ycmd instead. While I find company-ycmd utilize company-template to deal with function args expansion, which doesn't support font-lock inside the template. Do you think the choice of company-irony is better, it seems to use a yasnippet-like form rather than company-template.

zhuzhongshu avatar Mar 01 '15 08:03 zhuzhongshu

I'm personally satisfied with the current use of company-ycmd. The lack of font-lock doesn't really bother me. However, I suppose that template expansion with font-lock would be least marginally better (assuming that it functions as well as the current solution.)

I don't really have any time to spend on implementing this kind of low priority change. However, I'm happy to consider alternatives if you want to provide a patch or give more explicit instructions on how to make the change.

abingham avatar Mar 01 '15 11:03 abingham

OK, the current solution is good enough. I find auto-complete mode and company-irony and yasnippet uses the same expansion solution and I simply want the unified form for everything.

I know little about elisp, so I can't provide a patch, what I can do is just help to do the test and report bugs, sorry!

zhuzhongshu avatar Mar 01 '15 11:03 zhuzhongshu

OK, thanks for the suggestions. It's always good to get feedback, even if I can't act on it immediately. I'll leave this issue open in case someone feels like working on it. And definitely let us know if you have more ideas.

abingham avatar Mar 01 '15 11:03 abingham

I also tried using irony-snippet for template expansion and used the functions here in the code: https://github.com/ptrv/emacs.d/blob/master/site-lisp/company-ycmd-ext.el

You just have to (require 'company-ycmd-ext)

It works, but it is not perfect and does not work in all cases i.e. when the function argument have template arguments.

But I switched back to company-templateify because it really good enough.

ptrv avatar Mar 01 '15 11:03 ptrv

OK, I will try it, many thanks!

zhuzhongshu avatar Mar 01 '15 12:03 zhuzhongshu