mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
* [Diagnostics] Turn educational notes on-by-default * [Diagnostics] Only include educational notes in printed output if -print-educational-notes is passed * Make -print-educational-notes a driver option * [Diagnostics] Issue a printed remark if educational notes are available, but disabled * [docs] Update educational notes documentation and add a contributing guide * [Diagnostics] Cleanup PrintingDiagnosticConsumer handling of edu notes * Revert "[Diagnostics] Issue a printed remark if educational notes are available, but disabled" For now, don't notify users if edu notes are available but disabled. This decision can be reevaluated later.
79 lines
2.5 KiB
C++
79 lines
2.5 KiB
C++
//===--- DiagnosticOptions.h ------------------------------------*- C++ -*-===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef SWIFT_BASIC_DIAGNOSTICOPTIONS_H
|
|
#define SWIFT_BASIC_DIAGNOSTICOPTIONS_H
|
|
|
|
#include "llvm/ADT/Hashing.h"
|
|
|
|
namespace swift {
|
|
|
|
/// Options for controlling diagnostics.
|
|
class DiagnosticOptions {
|
|
public:
|
|
/// Indicates whether textual diagnostics should use color.
|
|
bool UseColor = false;
|
|
|
|
/// Indicates whether the diagnostics produced during compilation should be
|
|
/// checked against expected diagnostics, indicated by markers in the
|
|
/// input source file.
|
|
enum {
|
|
NoVerify,
|
|
Verify,
|
|
VerifyAndApplyFixes
|
|
} VerifyMode = NoVerify;
|
|
|
|
/// Indicates whether to allow diagnostics for \c <unknown> locations if
|
|
/// \c VerifyMode is not \c NoVerify.
|
|
bool VerifyIgnoreUnknown = false;
|
|
|
|
/// Indicates whether diagnostic passes should be skipped.
|
|
bool SkipDiagnosticPasses = false;
|
|
|
|
/// Keep emitting subsequent diagnostics after a fatal error.
|
|
bool ShowDiagnosticsAfterFatalError = false;
|
|
|
|
/// When emitting fixits as code edits, apply all fixits from diagnostics
|
|
/// without any filtering.
|
|
bool FixitCodeForAllDiagnostics = false;
|
|
|
|
/// Suppress all warnings
|
|
bool SuppressWarnings = false;
|
|
|
|
/// Treat all warnings as errors
|
|
bool WarningsAsErrors = false;
|
|
|
|
// When printing diagnostics, include the diagnostic name at the end
|
|
bool PrintDiagnosticNames = false;
|
|
|
|
/// If set to true, include educational notes in printed output if available.
|
|
/// Educational notes are documentation which supplement diagnostics.
|
|
bool PrintEducationalNotes = false;
|
|
|
|
// If set to true, use the more descriptive experimental formatting style for
|
|
// diagnostics.
|
|
bool EnableExperimentalFormatting = false;
|
|
|
|
std::string DiagnosticDocumentationPath = "";
|
|
|
|
/// Return a hash code of any components from these options that should
|
|
/// contribute to a Swift Bridging PCH hash.
|
|
llvm::hash_code getPCHHashComponents() const {
|
|
// Nothing here that contributes anything significant when emitting the PCH.
|
|
return llvm::hash_value(0);
|
|
}
|
|
};
|
|
|
|
} // end namespace swift
|
|
|
|
#endif // SWIFT_BASIC_DIAGNOSTICOPTIONS_H
|