remove method

  1. @override
Future<void> remove(
  1. String file
)
override

Implementation

@override
Future<void> remove(String file) async {
  AnalysisContext context;
  try {
    context = analysisCollection.contextFor(file);
  } catch (e) {
    // its likely this file does not need to be included within analysis
    // so we can just return
    return;
  }

  try {
    _memoryProvider.deleteFile(file);
  } catch (e) {
    // Path may not exist in memory provider (e.g. dependency file never
    // loaded, or stored as folder). The file is gone from the real FS
    // anyway - safe to ignore.
    logger.detail('Could not remove from analyzer cache: $e');
    return;
  }

  context.changeFile(file);

  await refreshDependencies();
}