diff options
Diffstat (limited to 'clang-tools-extra/clangd/ClangdServer.cpp')
-rw-r--r-- | clang-tools-extra/clangd/ClangdServer.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp index 449c0c98099..9989f610d8b 100644 --- a/clang-tools-extra/clangd/ClangdServer.cpp +++ b/clang-tools-extra/clangd/ClangdServer.cpp @@ -461,15 +461,18 @@ void ClangdServer::findDocumentHighlights( } void ClangdServer::findHover(PathRef File, Position Pos, - Callback<llvm::Optional<Hover>> CB) { - auto Action = [Pos](Callback<llvm::Optional<Hover>> CB, + Callback<llvm::Optional<HoverInfo>> CB) { + auto Action = [Pos](Callback<llvm::Optional<HoverInfo>> CB, Path File, llvm::Expected<InputsAndAST> InpAST) { if (!InpAST) return CB(InpAST.takeError()); - CB(clangd::getHover(InpAST->AST, Pos)); + format::FormatStyle Style = getFormatStyleForFile( + File, InpAST->Inputs.Contents, InpAST->Inputs.FS.get()); + CB(clangd::getHover(InpAST->AST, Pos, std::move(Style))); }; - WorkScheduler.runWithAST("Hover", File, Bind(Action, std::move(CB))); + WorkScheduler.runWithAST("Hover", File, + Bind(Action, std::move(CB), File.str())); } void ClangdServer::typeHierarchy(PathRef File, Position Pos, int Resolve, |