summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeCompletion/ctor-initializer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang] Improve ctor initializer completions.Kadir Cetinkaya2018-11-011-30/+45
| | | | | | | | | | | | | | | | Summary: Instead of providing generic "args" for member and base class initializers, tries to fetch relevant constructors and show their signatures. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ZaMaZaN4iK, eraman, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53654 llvm-svn: 345844
* [CodeCompletion] Enable signature help when initializing class/struct/union ↵Kadir Cetinkaya2018-09-111-0/+24
| | | | | | | | | | | | | | | | | | | | members. Summary: Factors out member decleration gathering and uses it in parsing to call signature help. Doesn't support signature help for base class constructors, the code was too coupled with diagnostic handling, but still can be factored out but just needs more afford. Reviewers: sammccall, ilya-biryukov, ioeric Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51917 llvm-svn: 341949
* [CodeComplete] Fix completion in the middle of ident in ctor lists.Ilya Biryukov2018-04-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The example that was broken before (^ designates completion points): class Foo { Foo() : fie^ld^() {} // no completions were provided here. int field; }; To fix it we don't cut off lexing after an identifier followed by code completion token is lexed. Instead we skip the rest of identifier and continue lexing. This is consistent with behavior of completion when completion token is right before the identifier. Reviewers: sammccall, aaron.ballman, bkramer, sepavloff, arphaman, rsmith Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D44932 llvm-svn: 330833
* Fix heuristics skipping invalid ctor-initializers with C++11Olivier Goffart2016-11-031-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Use better heuristics to detect if a '{' might be the start of the constructor body or not. Especially when there is a completion token. Fix the test 'test/CodeCompletion/ctor-initializer.cpp ' when clang defaults to c++11 The problem was is how we recover invalid code in the ctor-init part as we skip the function body. In particular, we want to know if a '{' is the begining of the body. In C++03, we always consider it as the beginng of the body. The problem was that in C++11, it may be the start of an initializer, so we skip over it, causing further parse errors later. (It is important that we are able to parse correctly the rest of the class definition, to know what are the class member, for example) This commit is improving the heuristics to decide if the '{' is starting a function body. The rules are the following: If we are not in a template argument, and that the previous tokens are not an identifier, or a >, then it is much more likely to be the function body. We verify that further by checking the token after the matching '}' The commit also fix the behavior when there is a code_completion token in the ctor-initializers. Differential Revision: https://reviews.llvm.org/D21502 llvm-svn: 285883
* Fix a few issues while skipping function bodiesOlivier Goffart2016-06-161-0/+41
- In functions with try { } catch { }, only the try block would be skipped, not the catch blocks - The template functions would still be parsed. - The initializers within a constructor would still be parsed. - The inline functions within class would still be stored, only to be discared later. - Invalid code with try would assert (as in "int foo() try assert_here") This attempt to do even less while skipping function bodies. Differential Revision: http://reviews.llvm.org/D20821 llvm-svn: 272963
OpenPOWER on IntegriCloud