[all-commits] [llvm/llvm-project] 9e6a34: [clangd] Implement end-definition-comment inlay hints

Daiyousei via All-commits all-commits at lists.llvm.org
Sat Jul 15 16:44:53 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9e6a342fdac8978ef6d3e373cbbc7425e3dfe0f8
      https://github.com/llvm/llvm-project/commit/9e6a342fdac8978ef6d3e373cbbc7425e3dfe0f8
  Author: daiyousei-qz <qyzheng2 at outlook.com>
  Date:   2023-07-16 (Sun, 16 Jul 2023)

  Changed paths:
    M clang-tools-extra/clangd/Config.h
    M clang-tools-extra/clangd/ConfigCompile.cpp
    M clang-tools-extra/clangd/ConfigFragment.h
    M clang-tools-extra/clangd/ConfigYAML.cpp
    M clang-tools-extra/clangd/InlayHints.cpp
    M clang-tools-extra/clangd/Protocol.cpp
    M clang-tools-extra/clangd/Protocol.h
    M clang-tools-extra/clangd/unittests/InlayHintTests.cpp

  Log Message:
  -----------
  [clangd] Implement end-definition-comment inlay hints

This patch implements a new inlay hint feature proposed in https://github.com/clangd/clangd/issues/1634. It introduces a new inlay hint kind BlockEnd which shows a comment-like hint after a definition brace pair, including function/type/namespace. For example,
```
void foo() {
} ^
```
In the code shown above, a hint should be displayed at ^ labelling `// foo`. Such hint only shows when there's no trailing character after the position except whitespaces and optionally ';'.

Also, new configurations are introduced in the inlay hints block
```
InlayHints:
    BlockEnd: Yes # toggling the feature
```

Reviewed By: sammccall

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




More information about the All-commits mailing list