Tomasz Wesolowski provided a nice matcher
that not just supports the camel case notation, but also the underscore
notation that is so widely used in C/C++ (see bug 173458).
I would like to integrate that matcher into
the CDT content assist. I basically see two options to do this:
1) Segment matching is provided by CDT
core.
The CDT core currently only supports a
prefix matching. The idea of prefix matching could simply be extended to mean
segment matching. No syntactic change in the API would be needed. Nevertheless,
it’s a semantic change, and the documentation should be adapted. Possibly
some parameter names should be changed, too.
I attached the resulting patch to bug
173458.
2) Segment matching is implemented in CDT UI
on top of the prefix lookup of CDT core.
The DOCCompletionProposalComputer would
only use the first character of the name typed sofar to call IASTCompletionContext#findBindings.
Then it would apply segment matching to finally narrow down to the relevant
proposals. Unfortunately, IASTCompletionContext#findBindings requires an
IASTName to specify the prefix, and I don’t how to create an IASTName for
that purpose. Otherwise this option would seem to be cleaner.
Any feedback is welcome.
Jens.