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

Unified Diff: pkg/analyzer/lib/src/context/builder.dart

Issue 2913493002: Add the analysis options path to the diagnostics page. (Closed)
Patch Set: Merge branch 'master' into options_in_diagnostics Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/context/context_root.dart ('k') | pkg/analyzer/test/src/context/builder_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/builder.dart
diff --git a/pkg/analyzer/lib/src/context/builder.dart b/pkg/analyzer/lib/src/context/builder.dart
index 0b300e585e123bcdf0d72df4fe77e0f1b7ac02ca..fe138d372793a38b5c84634dafa952963f09d98b 100644
--- a/pkg/analyzer/lib/src/context/builder.dart
+++ b/pkg/analyzer/lib/src/context/builder.dart
@@ -161,7 +161,8 @@ class ContextBuilder {
*/
AnalysisDriver buildDriver(ContextRoot contextRoot) {
String path = contextRoot.root;
- AnalysisOptions options = getAnalysisOptions(path);
+ AnalysisOptions options =
+ getAnalysisOptions(path, contextRoot: contextRoot);
//_processAnalysisOptions(context, optionMap);
final sf = createSourceFactory(path, options);
AnalysisDriver driver = new AnalysisDriver(
@@ -390,7 +391,7 @@ class ContextBuilder {
* information about the analysis options selection process.
*/
AnalysisOptions getAnalysisOptions(String path,
- {void verbosePrint(String text)}) {
+ {void verbosePrint(String text), ContextRoot contextRoot}) {
void verbose(String text) {
if (verbosePrint != null) {
verbosePrint(text);
@@ -411,6 +412,9 @@ class ContextBuilder {
if (optionsFile != null) {
try {
optionMap = optionsProvider.getOptionsFromFile(optionsFile);
+ if (contextRoot != null) {
+ contextRoot.optionsFilePath = optionsFile.path;
+ }
verbose('Loaded analysis options from ${optionsFile.path}');
} catch (e) {
// Ignore exceptions thrown while trying to load the options file.
@@ -431,6 +435,9 @@ class ContextBuilder {
if (source != null && source.exists()) {
try {
optionMap = optionsProvider.getOptionsFromSource(source);
+ if (contextRoot != null) {
+ contextRoot.optionsFilePath = source.fullName;
+ }
verbose('Loaded analysis options from ${source.fullName}');
} catch (e) {
// Ignore exceptions thrown while trying to load the options file.
« no previous file with comments | « pkg/analyzer/lib/context/context_root.dart ('k') | pkg/analyzer/test/src/context/builder_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698