Closed IgorGee closed 3 years ago
Hi, may I ask where could you find company-diag
? I could not find it either on MELPA or ELPA. Can you post me a link to that package so I could further investigate the issue.
company-diag
is a command that is part of company
itself:
https://github.com/company-mode/company-mode/blob/master/company.el#L2653
@dgutov Sorry to ping you here.
I have read through the code from company-diag
but not quite sure why this package doesn't provide information to company-diag
. Any clue with this behaviour? 😕
The logic behinds this tool is to combine all backends to one backend then do the fuzzy scoring. That's about it! Not sure why this wouldn't work with company-diag
? Am I missing some important command from the backend?
@jcs090218 What is unexpected here?
company-diag
examines and prints the current value of company-backends
. Which company-fuzzy--enable
sets to its own value, a list with single element: the wrapper backend. company-diag
has no idea about the variable company-fuzzy--backends
, so it doesn't print its value.
I was expecting to see the result from backend company-fuzzy-all-other-backends
?
I assumed company-diag
would know company-backends
but why not printing the only backend company-fuzzy-all-other-backends
? 😕 For example,
...
Completions:
"capf1"
"capf2"
...
Completions:
"keyword1"
"keyword2"
If company-fuzzy
is enabled,
...
Completions:
"capf1"
"capf2"
"keyword1"
"keyword2"
I would expect to see all of them in a list?
Yep. I would expect to see it there too.
I guess something in the implementation depends on some context info, maybe private vars or not well-defined behavior.
This is your code, right? I recommend some edebug-ing. Instrument company-fuzzy-all-candidates
, then evaluate
(let ((company-backend 'company-fuzzy-all-other-backends)) (company-call-backend 'candidates "def-"))
The above is the form that company-diag
uses. See why your function returns nil. Since it's called in the original buffer, I would expect all the local vars, etc, still have the necessary values.
Okay, I miss used the command candidates
in function company-fuzzy-all-candidates
. It always return nil
, not sure why I did that in the first place. 😕
Now it should be fixed in 7140e63325bea502959e853512d7c78588de8c9c.
Surely it didn't always return nil
? If it did that, the backend would never have worked in the first place.
Surely it didn't always return nil? If it did that, the backend would never have worked in the first place.
I had injected candidates right in front of the sorting function. :P
I don't remember why I did that though..
Erm.
That would do it. :man_shrugging:
When using
company-fuzzy
, it seems to remove a lot of valuable information incompany-diag
.When debugging, it's useful to know which backends are enabled. Here is what it looks like without
company-fuzzy
:It would be nice to maintain the functionality of
company-diag
while still usingcompany-fuzzy