getOptionsFromSource method

YamlMap getOptionsFromSource (
  1. Source source

Provide the options found in source. Recursively merge options referenced by an include directive and remove the include directive from the resulting options map. Return an empty options map if the file does not exist.


YamlMap getOptionsFromSource(Source source) {
  YamlMap options = getOptionsFromString(_readAnalysisOptions(source));
  YamlNode node = getValue(options, AnalyzerOptions.include);
  if (sourceFactory != null && node is YamlScalar) {
    var path = node.value;
    if (path is String) {
      Source parent = sourceFactory.resolveUri(source, path);
      options = merge(getOptionsFromSource(parent), options);
  return options;