[all-commits] [llvm/llvm-project] 8fbac4: [clangd] Add code completion of param name on /* i...

Adam Czachorowski via All-commits all-commits at lists.llvm.org
Tue Oct 19 04:04:39 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8fbac4e88ac3dde30310bb63b234045075cd338b
      https://github.com/llvm/llvm-project/commit/8fbac4e88ac3dde30310bb63b234045075cd338b
  Author: Adam Czachorowski <adamcz at google.com>
  Date:   2021-10-19 (Tue, 19 Oct 2021)

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

  Log Message:
  -----------
  [clangd] Add code completion of param name on /* inside function calls.

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.

Differential Revision: https://reviews.llvm.org/D110823




More information about the All-commits mailing list