New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use C++20 concepts to inform code completion in templates #261
Comments
Indeed. It looks like core concepts stuff (constraints and such) is still landing in clang, e.g. recent https://reviews.llvm.org/D50360. The implementation of this is going to depend on what the AST looks like. If you're able to follow that closely enough, have a sense of how the AST could be structured to help enable such code completion, it might be worth prototyping and talking to the authors (looks like Saar Raz is implementing most with Richard Smith reviewing) while things are still in flux. Otherwise it might be worth holding off on this for a bit until it's more stable, and working out how to produce sensible suggestions on top of it. My read is an AST walk and a few heuristics will give us method names with argument counts (and maybe types), nested types, and that might be about as much as we get. |
What the heck, here's a rough prototype (no tests, and some cases not covered: completion after :: doesn't work, and completion of nested templates doesn't work) https://reviews.llvm.org/D73596 Have been trying it out with this snippet:
|
I remember reviewing this code, but I guess it was in a re-upload as a new review request. Did it end up landing? |
Here's the newer review request: https://reviews.llvm.org/D73649, and it did in fact land. Perhaps we should close this issue, and file follow-ups for additional cases we'd like to support? |
Agree, we have some basic support. I'm sure there's things to be improved but let's close this until we have a better idea what's high priority. |
In the following code example:
it would make sense to offer
foo
as a completion proposal.The text was updated successfully, but these errors were encountered: