[clangd] Tweak "provides" hover card when symbols have the same name
authorSam McCall <sam.mccall@gmail.com>
Tue, 16 May 2023 15:24:48 +0000 (17:24 +0200)
committerSam McCall <sam.mccall@gmail.com>
Wed, 17 May 2023 18:25:42 +0000 (20:25 +0200)
commit0e66105a9260d80d58215c0c627f35e950c35b99
tree6dcb79cdacd0c8ecef418d3b0c563f182890ee62
parent8497dfdf5f35cc9c2f0e74762b34873eb3b1022d
[clangd] Tweak "provides" hover card when symbols have the same name

Previously for overloaded functions we'd show:
  Provides: foo, bar bar bar bar

The symbol name is duplicated
  ==> only show unique names, since we're not displaying the signature

Commas are missing
  ==> fix the logic which was checking for "last element" by value
      (though after the above fix this bug is dead anyway)

While here, remove a redundant bounds check before take_front().

Differential Revision: https://reviews.llvm.org/D150683
clang-tools-extra/clangd/Hover.cpp
clang-tools-extra/clangd/unittests/HoverTests.cpp