blob: 0e573d5c50b54810ddfcf14a3640baf692f57f83 [file] [log] [blame]
// Copyright (c) 2018, 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.
/// Implementation of Dart language experiment option handling for dartdoc.
/// See
library dartdoc.experiment_options;
import 'package:analyzer/file_system/file_system.dart';
// ignore: implementation_imports
import 'package:analyzer/src/dart/analysis/experiments.dart';
import 'package:dartdoc/src/dartdoc_options.dart';
mixin DartdocExperimentOptionContext implements DartdocOptionContextBase {
List<String> get enableExperiment =>
// TODO(jcollins-g): Implement YAML parsing for these flags and generation
// of [DartdocExperimentOptionContext], once a YAML file is available.
List<DartdocOption<Object>> createExperimentOptions(
ResourceProvider resourceProvider) {
return [
// TODO(jcollins-g): Consider loading experiment values from dartdoc_options.yaml?
'enable-experiment', ['non-nullable'], resourceProvider,
'Enable or disable listed experiments.\n${ => ' [no-]${e.enableString}: ${e.documentation} (default: ${e.isEnabledByDefault})').join('\n')}'),