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

Side by Side Diff: pkg/analyzer/lib/src/context/context.dart

Issue 1394023004: allow computeErrors to work on non-.dart files (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 | « no previous file | no next file » | 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 library analyzer.src.context.context; 5 library analyzer.src.context.context;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/instrumentation/instrumentation.dart'; 10 import 'package:analyzer/instrumentation/instrumentation.dart';
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 return null; 576 return null;
577 } 577 }
578 String code = getContents(source).data; 578 String code = getContents(source).data;
579 String comment = code.substring(docRange.offset, docRange.end); 579 String comment = code.substring(docRange.offset, docRange.end);
580 return comment.replaceAll('\r\n', '\n'); 580 return comment.replaceAll('\r\n', '\n');
581 } 581 }
582 582
583 @override 583 @override
584 List<AnalysisError> computeErrors(Source source) { 584 List<AnalysisError> computeErrors(Source source) {
585 String name = source.shortName; 585 String name = source.shortName;
586 if (AnalysisEngine.isDartFileName(name)) { 586 if (AnalysisEngine.isHtmlFileName(name)) {
587 return computeResult(source, DART_ERRORS);
588 } else if (AnalysisEngine.isHtmlFileName(name)) {
589 return computeResult(source, HTML_ERRORS); 587 return computeResult(source, HTML_ERRORS);
590 } 588 }
591 return AnalysisError.NO_ERRORS; 589 return computeResult(source, DART_ERRORS);
592 } 590 }
593 591
594 @override 592 @override
595 List<Source> computeExportedLibraries(Source source) => 593 List<Source> computeExportedLibraries(Source source) =>
596 computeResult(source, EXPORTED_LIBRARIES); 594 computeResult(source, EXPORTED_LIBRARIES);
597 595
598 @override 596 @override
599 @deprecated 597 @deprecated
600 HtmlElement computeHtmlElement(Source source) { 598 HtmlElement computeHtmlElement(Source source) {
601 // TODO(brianwilkerson) Remove this method after switching to the new task 599 // TODO(brianwilkerson) Remove this method after switching to the new task
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
2088 new PendingFuture<T>(_context, target, computeValue); 2086 new PendingFuture<T>(_context, target, computeValue);
2089 if (!pendingFuture.evaluate(entry)) { 2087 if (!pendingFuture.evaluate(entry)) {
2090 _context._pendingFutureTargets 2088 _context._pendingFutureTargets
2091 .putIfAbsent(target, () => <PendingFuture>[]) 2089 .putIfAbsent(target, () => <PendingFuture>[])
2092 .add(pendingFuture); 2090 .add(pendingFuture);
2093 scheduleComputation(); 2091 scheduleComputation();
2094 } 2092 }
2095 return pendingFuture.future; 2093 return pendingFuture.future;
2096 } 2094 }
2097 } 2095 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698