Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: pkg/analyzer/lib/plugin/options.dart

Issue 1392143002: Add context to OptionsProcessor callback API. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Master merge Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/CHANGELOG.md ('k') | pkg/analyzer/lib/src/plugin/plugin_configuration.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Support for client code that wants to consume options contributed to the 5 /// Support for client code that wants to consume options contributed to the
6 /// analysis options file. 6 /// analysis options file.
7 library analyzer.plugin.options; 7 library analyzer.plugin.options;
8 8
9 import 'package:analyzer/src/generated/engine.dart';
9 import 'package:analyzer/src/plugin/options_plugin.dart'; 10 import 'package:analyzer/src/plugin/options_plugin.dart';
10 import 'package:plugin/plugin.dart'; 11 import 'package:plugin/plugin.dart';
11 import 'package:yaml/yaml.dart'; 12 import 'package:yaml/yaml.dart';
12 13
13 /// The identifier of the extension point that allows plugins to access 14 /// The identifier of the extension point that allows plugins to access
14 /// options defined in the analysis options file. The object used as an 15 /// options defined in the analysis options file. The object used as an
15 /// extension must be an [OptionsProcessor]. 16 /// extension must be an [OptionsProcessor].
16 final String OPTIONS_PROCESSOR_EXTENSION_POINT_ID = Plugin.join( 17 final String OPTIONS_PROCESSOR_EXTENSION_POINT_ID = Plugin.join(
17 OptionsPlugin.UNIQUE_IDENTIFIER, 18 OptionsPlugin.UNIQUE_IDENTIFIER,
18 OptionsPlugin.OPTIONS_PROCESSOR_EXTENSION_POINT); 19 OptionsPlugin.OPTIONS_PROCESSOR_EXTENSION_POINT);
(...skipping 22 matching lines...) Expand all
41 /// matter of inspecting the parsed nodes. For example, testing whether the 42 /// matter of inspecting the parsed nodes. For example, testing whether the
42 /// compiler's resolver is set to use the `useMultiPackage` option might look 43 /// compiler's resolver is set to use the `useMultiPackage` option might look
43 /// something like this (eliding error-checking): 44 /// something like this (eliding error-checking):
44 /// 45 ///
45 /// bool useMultiPackage = 46 /// bool useMultiPackage =
46 /// options['compiler']['resolver']['useMultiPackage']; 47 /// options['compiler']['resolver']['useMultiPackage'];
47 abstract class OptionsProcessor { 48 abstract class OptionsProcessor {
48 /// Called when an error occurs in processing options. 49 /// Called when an error occurs in processing options.
49 void onError(Exception exception); 50 void onError(Exception exception);
50 51
51 /// Called when the options file is processed. 52 /// Called when an options file is processed.
52 /// 53 ///
53 /// The options file is processed on analyzer initialization and 54 /// The options file is processed on analyzer initialization and
54 /// subsequently when the file is changed on disk. In the event of a 55 /// subsequently when the file is changed on disk. In the event of a
55 /// change notification, note that the notification simply indicates 56 /// change notification, note that the notification simply indicates
56 /// a change on disk. Content in specific option scopes may or may not 57 /// a change on disk. Content in specific option scopes may or may not
57 /// be different. It is up to the implementer to check whether specific 58 /// be different. It is up to the implementer to check whether specific
58 /// options have changed and to handle those changes appropriately. 59 /// options have changed and to handle those changes appropriately. In
59 void optionsProcessed(Map<String, YamlNode> options); 60 /// addition to the [options] map, the associated analysis [context] is
61 /// provided as well to allow for context-specific configuration.
62 void optionsProcessed(Map<String, YamlNode> options, AnalysisContext context);
Brian Wilkerson 2015/10/08 16:46:47 nit: In general, I like putting collection-valued
pquitslund 2015/10/08 17:09:05 Will do!
60 } 63 }
OLDNEW
« no previous file with comments | « pkg/analyzer/CHANGELOG.md ('k') | pkg/analyzer/lib/src/plugin/plugin_configuration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698