[PATCH] D52261: [Sema] Generate completion fix-its for C code as well

2018-09-21 Thread Ivan Donchevskii via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC342721: [CodeComplete] Generate completion fix-its for C code as well (authored by yvvan, committed by ). Repository: rC Clang https://reviews.llvm.org/D52261 Files: lib/Parse/ParseExpr.cpp

[PATCH] D52261: [Sema] Generate completion fix-its for C code as well

2018-09-21 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. Thanks! LGTM! https://reviews.llvm.org/D52261 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D52261: [Sema] Generate completion fix-its for C code as well

2018-09-21 Thread Ivan Donchevskii via Phabricator via cfe-commits
yvvan updated this revision to Diff 166407. yvvan added a comment. Provide CorrectedBase = Base for C code https://reviews.llvm.org/D52261 Files: lib/Parse/ParseExpr.cpp test/CodeCompletion/member-access.c Index: test/CodeCompletion/member-access.c

[PATCH] D52261: [Sema] Generate completion fix-its for C code as well

2018-09-21 Thread Ivan Donchevskii via Phabricator via cfe-commits
yvvan added a comment. You're right actually. The fix is much simpler than I expected :) https://reviews.llvm.org/D52261 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52261: [Sema] Generate completion fix-its for C code as well

2018-09-20 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In https://reviews.llvm.org/D52261#1240143, @yvvan wrote: > I tried that first but did not I find a way just to copy an expression (we > basically need the same expr for such case). Do you know how to properly > generate a copy of expression or some other way to

[PATCH] D52261: [Sema] Generate completion fix-its for C code as well

2018-09-20 Thread Ivan Donchevskii via Phabricator via cfe-commits
yvvan added a comment. I tried that first but did not I find a way just to copy an expression (we basically need the same expr for such case). Do you know how to properly generate a copy of expression or some other way to get the same expression? https://reviews.llvm.org/D52261

[PATCH] D52261: [Sema] Generate completion fix-its for C code as well

2018-09-19 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. It's the responsibility of the caller to provide a corrected expression, this keeps the completion function simpler. I suggest we stick to this contract. We do something in `getLangOpts().CPlusPlus` case to create a corrected expression, let's just implement a

[PATCH] D52261: [Sema] Generate completion fix-its for C code as well

2018-09-19 Thread Ivan Donchevskii via Phabricator via cfe-commits
yvvan updated this revision to Diff 166110. yvvan added a comment. Test is added https://reviews.llvm.org/D52261 Files: lib/Sema/SemaCodeComplete.cpp test/CodeCompletion/member-access.c Index: test/CodeCompletion/member-access.c

[PATCH] D52261: [Sema] Generate completion fix-its for C code as well

2018-09-19 Thread Ivan Donchevskii via Phabricator via cfe-commits
yvvan created this revision. yvvan added reviewers: nik, ilya-biryukov. Current completion fix-its approach does not provide OtherOpBase for C code. But we can easily proceed in this case taking the original Base type. https://reviews.llvm.org/D52261 Files: lib/Sema/SemaCodeComplete.cpp