blob: cdad71b2b558c7df10af8b8099c96d6086dc7a0a [file] [log] [blame]
// Copyright (c) 2024, 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/error/listener.dart';
import 'package:analyzer/src/dart/analysis/file_state.dart';
import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/scope.dart';
import 'package:analyzer/src/ignore_comments/ignore_info.dart';
/// Information about a file being analyzed.
class FileAnalysis {
final FileState file;
final RecordingDiagnosticListener diagnosticListener;
final ErrorReporter errorReporter;
final CompilationUnitImpl unit;
final LibraryFragmentImpl element;
final IgnoreInfo ignoreInfo;
final ImportsTracking importsTracking;
FileAnalysis({
required this.file,
required this.diagnosticListener,
required this.unit,
required this.element,
}) : errorReporter = ErrorReporter(diagnosticListener, file.source),
ignoreInfo = IgnoreInfo.forDart(unit, file.content),
importsTracking = element.scope.importsTrackingInit();
}