Replies: 2 comments 2 replies
-
I'm not sure the The current behavior completes the common prefix, and that is it. But suppose you have a fuzzy matching backend, or completion style, etc, where you typed and get completions like
What do you expect All three completions above contain an I suppose can be more optimal strategies: when we discussed this with Stefan Monnier (a while ago), one of the ideas was that the chain of common parts would be returned by the completion function (in the c-a-p-f API), or the completion style. But that never materialized, thus far, so I never wired this approach into company backends. If you have a particular strategy in mind, I suppose we could try to implement it. Or implement delegation. Regarding the preview frontend, I don't know how it should behave with non-prefix inputs. That's why we use the pseudo-tooltip backend for those cases. But ideas welcome. |
Beta Was this translation helpful? Give feedback.
-
I would expect I think it is enough to delegate setting Previewing could work by overwriting the prefix except the last characther typed, so the preview would have a hole in the middle at the location of the cursor (in case the common part is longer than the prefix). If it is shorter it would just replace the necessary length (without overwriting the whole prefix). Pressing If there is a common part and you press |
Beta Was this translation helpful? Give feedback.
-
If I am using a package like
orderless
orprescient,
company-common
will never match becausecompany-prefix
is not exact, (it would be something likesm-p-rf
.I managed to make
company-complete-common
work by adding this advice:which is not ideal, because company is still setting its own
company-common
and overriding it insidecompany-update-candidates
doesn't look possible without replacing the whole func.Moreover, showing the preview candidate when the prefix is inexact also doesn't work. This is harder to fix because it's unclear how the prefix should be joined with the common completion, should the common completion overwrite the prefix altogether?
Beta Was this translation helpful? Give feedback.
All reactions