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

Side by Side Diff: pkg/analysis_server/test/context_manager_test.dart

Issue 2566013002: Implement 'analysis.getErrors' for the new driver. (Closed)
Patch Set: Created 4 years 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 test.context.directory.manager; 5 library test.context.directory.manager;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analysis_server/src/context_manager.dart'; 9 import 'package:analysis_server/src/context_manager.dart';
10 import 'package:analysis_server/src/utilities/null_string_sink.dart'; 10 import 'package:analysis_server/src/utilities/null_string_sink.dart';
(...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after
1765 String filePath = path.posix.joinAll(pathComponents); 1765 String filePath = path.posix.joinAll(pathComponents);
1766 resourceProvider.deleteFile(filePath); 1766 resourceProvider.deleteFile(filePath);
1767 } 1767 }
1768 1768
1769 /** 1769 /**
1770 * TODO(brianwilkerson) This doesn't add the strong mode processor when using 1770 * TODO(brianwilkerson) This doesn't add the strong mode processor when using
1771 * the new analysis driver. 1771 * the new analysis driver.
1772 */ 1772 */
1773 ErrorProcessor getProcessor(AnalysisError error) => 1773 ErrorProcessor getProcessor(AnalysisError error) =>
1774 callbacks.currentDriver == null 1774 callbacks.currentDriver == null
1775 ? ErrorProcessor.getProcessor(callbacks.currentContext, error) 1775 ? ErrorProcessor.getProcessor(
1776 callbacks.currentContext.analysisOptions, error)
1776 : errorProcessors.firstWhere((ErrorProcessor p) => p.appliesTo(error), 1777 : errorProcessors.firstWhere((ErrorProcessor p) => p.appliesTo(error),
1777 orElse: () => null); 1778 orElse: () => null);
1778 1779
1779 String newFile(List<String> pathComponents, [String content = '']) { 1780 String newFile(List<String> pathComponents, [String content = '']) {
1780 String filePath = path.posix.joinAll(pathComponents); 1781 String filePath = path.posix.joinAll(pathComponents);
1781 resourceProvider.newFile(filePath, content); 1782 resourceProvider.newFile(filePath, content);
1782 return filePath; 1783 return filePath;
1783 } 1784 }
1784 1785
1785 String newFileFromBytes(List<String> pathComponents, List<int> bytes) { 1786 String newFileFromBytes(List<String> pathComponents, List<int> bytes) {
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
2824 class TestUriResolver extends UriResolver { 2825 class TestUriResolver extends UriResolver {
2825 Map<Uri, Source> uriMap; 2826 Map<Uri, Source> uriMap;
2826 2827
2827 TestUriResolver(this.uriMap); 2828 TestUriResolver(this.uriMap);
2828 2829
2829 @override 2830 @override
2830 Source resolveAbsolute(Uri uri, [Uri actualUri]) { 2831 Source resolveAbsolute(Uri uri, [Uri actualUri]) {
2831 return uriMap[uri]; 2832 return uriMap[uri];
2832 } 2833 }
2833 } 2834 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698