blob: a207980a7d79c9727533d9d59794db54026db03f [file] [edit]
// Copyright (c) 2026, 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.
import 'package:analyzer/analysis_rule/analysis_rule.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:meta/meta.dart';
part 'rule_handler.g.dart';
/// The handler of the end of a library, after every unit of the library has
/// been visited.
@experimental
abstract interface class LibraryEndHandler implements RuleHandler {
/// Called once for the library, after every unit has been visited.
///
/// There is no current unit: the rule's reporter still reports to the last
/// unit visited. To report a diagnostic, use the reporter of the unit that
/// declares the reported node, remembered when the node was handled.
void handleLibraryEnd();
}
/// The supertype of the handler interfaces.
///
/// A rule returns its handler from [AbstractAnalysisRule.createHandler]. The
/// handler implements the handler interfaces of the node kinds and events that
/// the rule handles, and the runner calls their methods.
@experimental
sealed class RuleHandler {}