[PATCH] D110823: [clangd] Add code completion of param name on /* inside function calls.

Adam Czachorowski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 30 06:20:04 PDT 2021


adamcz created this revision.
Herald added subscribers: usaxena95, kadircet, arphaman.
adamcz requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.

For example, if you have:

  void foo(int bar);
  foo(/*^

it should auto-complete to "bar=".

Because Sema callbacks for code completion in comments happen before we
have an AST we need to cheat in clangd by detecting completion on /*
before, moving cursor back by two characters, then running a simplified
verion of SignatureHelp to extract argument name(s) from possible
overloads.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110823

Files:
  clang-tools-extra/clangd/ClangdLSPServer.cpp
  clang-tools-extra/clangd/CodeComplete.cpp
  clang-tools-extra/clangd/test/initialize-params.test
  clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110823.376177.patch
Type: text/x-patch
Size: 7715 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210930/00d52f03/attachment-0001.bin>


More information about the cfe-commits mailing list