[clangd] Use the active file's language for hover code blocks
authorDavid Goldman <davg@google.com>
Mon, 23 Aug 2021 17:58:43 +0000 (13:58 -0400)
committerDavid Goldman <davg@google.com>
Fri, 3 Sep 2021 15:38:27 +0000 (11:38 -0400)
commit2982bd9e9b58ea17bc047ffb9b28df6f92531287
tree0af88400c8e67ea2f3a1009732121795c91f4505
parentb6d1a31c1b88227b38b3dad7b4430fa42516e82c
[clangd] Use the active file's language for hover code blocks

This helps improve the syntax highlighting for Objective-C code,
although it currently doesn't work well in VS Code with
methods/properties/ivars since we don't currently include the proper
decl context (e.g. class).

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