Closed BlankSpruce closed 1 year ago
Thanks for the report. Unfortunately I need more information to act.
Can you try this with Corfu and provide me with a minimal self-contained example which I can actually test? I haven't used the Company Capf converter much, but in my basic tests of some common Company backends it went well. It exceeds my bandwidth to support and test additional packages like Yasnippet. Some parts of Cape are tricky, e.g., cape-company-to-capf
and cape-super-capf
. I am not sure, but I think some people already use Corfu+cape-company-to-capf+company-yasnippet successfully.
If you are interested it would be great if you dig deeper and figure out the reason for the deviation you observed. Ideally you could provide an example where cape-company-to-capf
does the wrong thing for a Company backend, which does not depend on an additional package like Yasnippet?
(Maybe someone has written a yasnippet-capf
in the meantime, which you could try. If not, you could also use my Tempel package, but that's maybe asking too much if you are already heavily invested in Yasnippet.)
In my setup I have installed the following packages:
cape
company
embark
(to demonstrate list of the candidates)yasnippet
yasnippet-snippets
The last one provides a couple of templates for org-mode that start with
<
: In particular I'm interested in this template: https://github.com/AndreaCrotti/yasnippet-snippets/blob/master/snippets/org-mode/src which has<src
key.I use
cape-company-to-capf
to get relevant yasnippet templates. For the purpose of this report I invoke it withM-: (call-interactively (cape-interactive-capf (cape-company-to-capf #'company-yasnippet)))
. Given the initial state of the buffer:I get a long list of candidates and among them is
<src
I'm looking for:When my buffer is in this state:
it immediately expands to: which is associated to this snippet instead https://github.com/AndreaCrotti/yasnippet-snippets/blob/master/snippets/org-mode/setup (key
set
). This result is "kind of correct" since it's at least consistent with howcompany
behaves here (example further in this report).With buffer state:
no candidates are offered but a cryptic message is printed instead:
And with this buffer state:
I don't get neither candidates nor it expands (because there should be the only candidate that matches
<src
) with similar cryptic message:Comparing that situation to invoking
M-x company-yasnippet
these are the results:initial
<
:initial
<s
: Note:company
makes the same mistake here by considerings
as a start instead of<s
but for the sake of this report let's just focus on inconsistency betweencape
wrapper andcompany
.initial
<sr
:initial
<src
:There's not much to do with unexpected suggestion at input
<s
because that's how company behaves here but at least the wrapper should offer the same candidates as company does. As far as I've experienced that it behaves like that with at least two letter inputs starting with non-letter.