Completion list spam and macros

So code completion has lots of irrelevant results :slight_smile:

Macros seem to be the worst offenders. We’re doing a better job of downranking them, but it still means that the result list is always long:
https://i.imgur.com/gRZl0PZ.png
We currently don’t index macros and I’m scared that doing so would make this problem worse.

What do people think about these ideas (not alternatives, we could try several):
A) not completing macros at all, ever
B) completing macros only for case-insensitive prefix matches (not fuzzy)
C) tightening the word segmentation aspects of fuzzy matching (for all symbols) so this stuff doesn’t match
D) tightening the case-matching aspects of fuzzy matching (for all symbols) so this stuff doesn’t match
E) trying to identify the boundary between goodish results and bad results, and truncating the list there? (This will require disabling client-side filtering)
F) ignoring this problem as long as good results aren’t being buried under the bad ones?

(I’ll send a patch shortly for B which seems like an easy win to me, please try it out and we can revert if it’s terrible)

Hi Sam!
I think completing macros is useful so I would say A would not be good. I think B sounds good for the short/medium term. I’d like to eventually come up with a proposal of what to truncate, because I see results that are every unlikely to match the user intention. For example, not showing strtod and CLONE_CHILD_SETTID. But I don’t know enough about how this is implemented to make a concrete proposal.

Cheers,
Marc-André

Hi Sam!
I think completing macros is useful so I would say A would not be good. I think B sounds good for the short/medium term.

Agreed on both counts here. I actually landed a patch for B as it seemed like such a clear win. If it’s causing problems for anyone happy to revert.
(One possibility is windows devs: apparently API calls like CreateFile are macros that point to the A/W string variants)

I’d like to eventually come up with a proposal of what to truncate, because I see results that are every unlikely to match the user intention. For example, not showing strtod and CLONE_CHILD_SETTID. But I don’t know enough about how this is implemented to make a concrete proposal.

I noticed this too, can you try https://reviews.llvm.org/D47950 and see how it feels? I think this is the right fix for that problem.

“I noticed this too, can you try https://reviews.llvm.org/D47950 and see how it feels? I think this is the right fix for that problem.”

It seems much better! I’ll comment there on that subject.