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 import 'package:analysis_server/protocol/protocol.dart'; | 5 import 'package:analysis_server/protocol/protocol.dart'; |
6 import 'package:analysis_server/protocol/protocol_generated.dart'; | 6 import 'package:analysis_server/protocol/protocol_generated.dart'; |
7 import 'package:analysis_server/src/constants.dart'; | 7 import 'package:analysis_server/src/constants.dart'; |
8 import 'package:analysis_server/src/services/index/index.dart'; | 8 import 'package:analysis_server/src/services/index/index.dart'; |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 test_discardNotifications_onSourceChange() async { | 58 test_discardNotifications_onSourceChange() async { |
59 createProject(); | 59 createProject(); |
60 addTestFile(''); | 60 addTestFile(''); |
61 await server.onAnalysisComplete; | 61 await server.onAnalysisComplete; |
62 server.setAnalysisSubscriptions({ | 62 server.setAnalysisSubscriptions({ |
63 AnalysisService.NAVIGATION: [testFile].toSet() | 63 AnalysisService.NAVIGATION: [testFile].toSet() |
64 }); | 64 }); |
65 // update file, analyze, but don't sent notifications | 65 // update file, analyze, but don't sent notifications |
66 navigationCount = 0; | 66 navigationCount = 0; |
67 server.updateContent('1', {testFile: new AddContentOverlay('foo() {}')}); | 67 server.updateContent('1', {testFile: new AddContentOverlay('foo() {}')}); |
68 server.test_performAllAnalysisOperations(); | |
69 expect(serverErrorCount, 0); | 68 expect(serverErrorCount, 0); |
70 expect(navigationCount, 0); | 69 expect(navigationCount, 0); |
71 // replace the file contents, | 70 // replace the file contents, |
72 // should discard any pending notification operations | 71 // should discard any pending notification operations |
73 server.updateContent('2', {testFile: new AddContentOverlay('bar() {}')}); | 72 server.updateContent('2', {testFile: new AddContentOverlay('bar() {}')}); |
74 await server.onAnalysisComplete; | 73 await server.onAnalysisComplete; |
75 expect(serverErrorCount, 0); | 74 expect(serverErrorCount, 0); |
76 expect(navigationCount, 1); | 75 expect(navigationCount, 1); |
77 } | 76 } |
78 | 77 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 | 310 |
312 @override | 311 @override |
313 bool matches(arg) { | 312 bool matches(arg) { |
314 return arg is CompilationUnit && | 313 return arg is CompilationUnit && |
315 resolutionMap.elementDeclaredByCompilationUnit(arg).source.fullName == | 314 resolutionMap.elementDeclaredByCompilationUnit(arg).source.fullName == |
316 file; | 315 file; |
317 } | 316 } |
318 } | 317 } |
319 | 318 |
320 class _MockIndex extends TypedMock implements Index {} | 319 class _MockIndex extends TypedMock implements Index {} |
OLD | NEW |