Files
sdk/pkg/analyzer/lib/diagnostic/diagnostic.dart
T
Brian Wilkerson 5bac4d9b0c Reland "Add support for recording context information with analysis errors, with one example"
This reverts commit b9bf239c65.

Reason for revert: The angular and angular plugins have been updated so as to make this safe.

Original change's description:
> Revert "Add support for recording context information with analysis errors, with one example"
> 
> This reverts commit 6114435ea5.
> 
> Reason for revert: Broke angular and angular_analyzer_plugin
> 
> Original change's description:
> > Add support for recording context information with analysis errors, with one example
> > 
> > Change-Id: Iba1c48163ce264d85a68bcb9f70e5025a7cdbfbb
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100563
> > Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> > Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
> 
> TBR=scheglov@google.com,brianwilkerson@google.com
> 
> Change-Id: I275c6e4473de73199ea9b5e490379ba58aec1d43
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100628
> Reviewed-by: Paul Berry <paulberry@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>

TBR=paulberry@google.com,scheglov@google.com,brianwilkerson@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ib1b7e63a459e63bcbf02f26bcf167ddad45295b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101004
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-02 17:07:03 +00:00

50 lines
1.7 KiB
Dart

// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/// A diagnostic, as defined by the [Diagnostic Design Guidelines][guidelines]:
///
/// > An indication of a specific problem at a specific location within the
/// > source code being processed by a development tool.
///
/// Clients may not extend, implement or mix-in this class.
///
/// [guidelines]: ../doc/diagnostics.md
abstract class Diagnostic {
/// A list of messages that provide context for understanding the problem
/// being reported. The list will be empty if there are no such messages.
List<DiagnosticMessage> get contextMessages;
/// A description of how to fix the problem, or `null` if there is no such
/// description.
String get correctionMessage;
/// A message describing what is wrong and why.
DiagnosticMessage get problemMessage;
/// The severity associated with the diagnostic.
Severity get severity;
}
/// A single message associated with a [Diagnostic], consisting of the text of
/// the message and the location associated with it.
///
/// Clients may not extend, implement or mix-in this class.
abstract class DiagnosticMessage {
/// The absolute and normalized path of the file associated with this message.
String get filePath;
/// The length of the source range associated with this message.
int get length;
/// The text of the message.
String get message;
/// The zero-based offset from the start of the file to the beginning of the
/// source range associated with this message.
int get offset;
}
/// An indication of the severity of a [Diagnostic].
enum Severity { error, warning, info }