[PATCH] D39730: Enabling constructor code completion

2017-11-28 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. I'll take a look, but my guess is that you might have to use scoping information https://reviews.llvm.org/D39730 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[PATCH] D39730: Enabling constructor code completion

2017-11-28 Thread Jan Korous via Phabricator via cfe-commits
jkorous-apple added a comment. No luck. If I understand it correctly all the information that would be needed to distinguish between: foo:: and int i = foo:: in ResultBuilder::AddResult() is missing since the context is represented only by DeclContext. Something like a DirectASTParentNod

[PATCH] D39730: Enabling constructor code completion

2017-11-23 Thread Jan Korous via Phabricator via cfe-commits
jkorous-apple added a comment. Sorry for delays, I'm working on this on and off when there's nothing more important. Let me specify a little narrower scope of this change: - Make code completion contain constructor item for out-of-line constructor definition: struct foo { foo(); }; foo:: // re

[PATCH] D39730: Enabling constructor code completion

2017-11-15 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D39730#926108, @jkorous-apple wrote: > Sorry, what do you mean by "this works in the body of the class"? > > Definition of constructor inside class definition has been working even > before: > > struct foo { > foo(); > f > }; >

[PATCH] D39730: Enabling constructor code completion

2017-11-15 Thread Jan Korous via Phabricator via cfe-commits
jkorous-apple added a comment. Sorry, what do you mean by "this works in the body of the class"? Definition of constructor inside class definition has been working even before: struct foo { foo(); f }; Do you mean that a test shall be added in order to check that it still works? https:/

[PATCH] D39730: Enabling constructor code completion

2017-11-10 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Also, Comment at: lib/Sema/SemaCodeComplete.cpp:980 + if (isa(R.Declaration) + && dyn_cast(CurContext) == nullptr + && dyn_cast(CurContext) == nullptr arphaman wrote: > You can use `!isa` Have you checked if this check works

[PATCH] D39730: Enabling constructor code completion

2017-11-10 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. It doesn't look like this works in the body of the class (at least there's no test for it). For that you might have to inject these kind results by performing another lookup when completing inside the body of the class. Comment at: lib/Sema/SemaCodeC

[PATCH] D39730: Enabling constructor code completion

2017-11-10 Thread Jan Korous via Phabricator via cfe-commits
jkorous-apple updated this revision to Diff 122470. jkorous-apple added a comment. I am able to enable ctor completion selectively in translate unit scope and namespace scope so ctor completion does not appear in dot access context. I haven't figured out how to explicitly specify that completion

[PATCH] D39730: Enabling constructor code completion

2017-11-07 Thread Jan Korous via Phabricator via cfe-commits
jkorous-apple added a comment. I agree and it seems to be the case but I will upgrade my ad-hoc testing code snippet to a proper test as I should have done it in the first place. I also agree that this change looks really suspicious and I was basically surprised that it works. https://reviews

[PATCH] D39730: Enabling constructor code completion

2017-11-07 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. This approach doesn't look right. We don't want to code-complete constructors after the `.`. Instead we want to complete the constructors/destructors in bodies of classes and in out-of-line declarations after `~`, right? https://reviews.llvm.org/D39730

[PATCH] D39730: Enabling constructor code completion

2017-11-07 Thread Jan Korous via Phabricator via cfe-commits
jkorous-apple created this revision. Herald added a subscriber: eraman. It seems like constructor code completion was intentionally disabled ages ago in this commit (and refactored later): commit 33224e61bfca370850abae89bbd415a4dabe07fa Author: Douglas Gregor Date: Fri Sep 18 17:42:29 2009 +0