[PATCH] D51038: [clang] Make sure codecompletion is called for calls even when inside a token.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 7 11:39:36 PDT 2018


kadircet updated this revision to Diff 164477.
kadircet added a comment.

- Rebase and use new signature help.

Currently the problem is, there are again some tests out there that rely on
CodeCompeleteOrdinaryName to be called even when getting overloads at an unknown
parameter type. These tests are:

  Clang :: CodeCompletion/call.cpp
  Clang :: Index/code-completion.cpp
  Clang :: Index/complete-call.cpp
  Clang :: Index/complete-functor-call.cpp
  Clang :: Index/complete-optional-params.cpp
  Clang :: Index/complete-pointer-and-reference-to-functions.cpp

You can run something like this to check for the output(change ../clangd_bugs):

  ninja c-index-test && ./bin/c-index-test -code-completion-at=../clangd_bugs/tools/clang/test/Index/complete-call.cpp:53:12 ../clan
  gd_bugs/tools/clang/test/Index/complete-call.cpp

As you can see current version generates only overloadcandidates, but tests
don't check them with a next loop, because they expect other completions, which
is not problematic but after checks for the items they also look for completion
context, which is not set as desired if CodeCompleteOrdinaryName or
CodeCompleteExpression is not called.

But for the first test case it is more complicated, it checks for code patterns
like dynamic_cast<EXPR>(EXPR); which is not generated if we don't call
CodeCompletionOrdinaryName or Expressions.


Repository:
  rC Clang

https://reviews.llvm.org/D51038

Files:
  include/clang/Parse/Parser.h
  lib/Parse/ParseExpr.cpp
  test/CodeCompletion/function-overloads-inside-param.cpp
  test/CodeCompletion/function-overloads.cpp
  test/Index/complete-block-property-assignment.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51038.164477.patch
Type: text/x-patch
Size: 5445 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180907/b35e73b1/attachment.bin>


More information about the cfe-commits mailing list