| OLD | NEW |
| 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 test.analysis.updateContent; | 5 library test.analysis.updateContent; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/constants.dart'; | 7 import 'package:analysis_server/src/constants.dart'; |
| 8 import 'package:analysis_server/src/protocol.dart'; | 8 import 'package:analysis_server/src/protocol.dart'; |
| 9 import 'package:analysis_server/src/services/index/index.dart'; | 9 import 'package:analysis_server/src/services/index/index.dart'; |
| 10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 test_sendNoticesAfterNopChange_flushedUnit() async { | 198 test_sendNoticesAfterNopChange_flushedUnit() async { |
| 199 createProject(); | 199 createProject(); |
| 200 addTestFile(''); | 200 addTestFile(''); |
| 201 await server.onAnalysisComplete; | 201 await server.onAnalysisComplete; |
| 202 // add an overlay | 202 // add an overlay |
| 203 server.updateContent( | 203 server.updateContent( |
| 204 '1', {testFile: new AddContentOverlay('main() {} main() {}')}); | 204 '1', {testFile: new AddContentOverlay('main() {} main() {}')}); |
| 205 await server.onAnalysisComplete; | 205 await server.onAnalysisComplete; |
| 206 // clear errors and make a no-op change | 206 // clear errors and make a no-op change |
| 207 filesErrors.clear(); | 207 filesErrors.clear(); |
| 208 server.test_flushResolvedUnit(testFile); | 208 server.test_flushAstStructures(testFile); |
| 209 server.updateContent('2', { | 209 server.updateContent('2', { |
| 210 testFile: new ChangeContentOverlay([new SourceEdit(0, 4, 'main')]) | 210 testFile: new ChangeContentOverlay([new SourceEdit(0, 4, 'main')]) |
| 211 }); | 211 }); |
| 212 await server.onAnalysisComplete; | 212 await server.onAnalysisComplete; |
| 213 // errors should have been resent | 213 // errors should have been resent |
| 214 expect(filesErrors, isNotEmpty); | 214 expect(filesErrors, isNotEmpty); |
| 215 } | 215 } |
| 216 | 216 |
| 217 List<Source> _getUserSources(AnalysisContext context) { | 217 List<Source> _getUserSources(AnalysisContext context) { |
| 218 List<Source> sources = <Source>[]; | 218 List<Source> sources = <Source>[]; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 232 | 232 |
| 233 @override | 233 @override |
| 234 bool matches(arg) { | 234 bool matches(arg) { |
| 235 return arg is CompilationUnit && arg.element.source.fullName == file; | 235 return arg is CompilationUnit && arg.element.source.fullName == file; |
| 236 } | 236 } |
| 237 } | 237 } |
| 238 | 238 |
| 239 class _MockIndex extends TypedMock implements Index { | 239 class _MockIndex extends TypedMock implements Index { |
| 240 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 240 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 241 } | 241 } |
| OLD | NEW |