[all-commits] [llvm/llvm-project] c46c7c: [clangd] Smarter hover on auto and decltype

Quentin Chateau via All-commits all-commits at lists.llvm.org
Fri Dec 18 07:27:42 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c46c7c9bcf9752971fe4bbcf67140c99066ad2e0
      https://github.com/llvm/llvm-project/commit/c46c7c9bcf9752971fe4bbcf67140c99066ad2e0
  Author: Quentin Chateau <quentin.chateau at gmail.com>
  Date:   2020-12-18 (Fri, 18 Dec 2020)

  Changed paths:
    M clang-tools-extra/clangd/AST.cpp
    M clang-tools-extra/clangd/AST.h
    M clang-tools-extra/clangd/Hover.cpp
    M clang-tools-extra/clangd/refactor/tweaks/ExpandAutoType.cpp
    M clang-tools-extra/clangd/unittests/HoverTests.cpp

  Log Message:
  -----------
  [clangd] Smarter hover on auto and decltype

Only show the keyword as the hover "Name".

Show whether the type is deduced or undeduced as
the hover "Documentation".

Show the deduced type (if any) as the "Definition".

Don't show any hover information for:
- the "auto" word of "decltype(auto)"
- "auto" in lambda parameters
- "auto" in template arguments

---------------

This diff is a suggestion based on what @sammccall  suggested in https://reviews.llvm.org/D92977 about hover on "auto". It somehow "hacks" onto the "Documentation" and "Definition" fields of `HoverInfo`. It sure looks good on VSCode, let me know if this seem acceptable to you.

Reviewed By: sammccall

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




More information about the All-commits mailing list