diff options
Diffstat (limited to 'clangd/Diagnostics.h')
-rw-r--r-- | clangd/Diagnostics.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/clangd/Diagnostics.h b/clangd/Diagnostics.h index 6318e88f..9130ad56 100644 --- a/clangd/Diagnostics.h +++ b/clangd/Diagnostics.h @@ -1,9 +1,8 @@ //===--- Diagnostics.h -------------------------------------------*- C++-*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -100,9 +99,15 @@ public: void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const clang::Diagnostic &Info) override; + using DiagFixer = std::function<std::vector<Fix>(DiagnosticsEngine::Level, + const clang::Diagnostic &)>; + /// If set, possibly adds fixes for diagnostics using \p Fixer. + void contributeFixes(DiagFixer Fixer) { this->Fixer = Fixer; } + private: void flushLastDiag(); + DiagFixer Fixer = nullptr; std::vector<Diag> Output; llvm::Optional<LangOptions> LangOpts; llvm::Optional<Diag> LastDiag; |