| OLD | NEW |
| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analysis_server/protocol/protocol.dart'; | 7 import 'package:analysis_server/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/protocol/protocol_constants.dart'; | 8 import 'package:analysis_server/protocol/protocol_constants.dart'; |
| 9 import 'package:analysis_server/protocol/protocol_generated.dart'; | 9 import 'package:analysis_server/protocol/protocol_generated.dart'; |
| 10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // the last notification should indicate that analysis is complete | 146 // the last notification should indicate that analysis is complete |
| 147 Notification notification = notifications[notifications.length - 1]; | 147 Notification notification = notifications[notifications.length - 1]; |
| 148 var params = new ServerStatusParams.fromNotification(notification); | 148 var params = new ServerStatusParams.fromNotification(notification); |
| 149 expect(params.analysis.isAnalyzing, isFalse); | 149 expect(params.analysis.isAnalyzing, isFalse); |
| 150 }); | 150 }); |
| 151 } | 151 } |
| 152 | 152 |
| 153 test_setAnalysisSubscriptions_fileInIgnoredFolder_newOptions() async { | 153 test_setAnalysisSubscriptions_fileInIgnoredFolder_newOptions() async { |
| 154 String path = '/project/samples/sample.dart'; | 154 String path = '/project/samples/sample.dart'; |
| 155 resourceProvider.newFile(path, ''); | 155 resourceProvider.newFile(path, ''); |
| 156 resourceProvider.newFile( | 156 resourceProvider.newFile('/project/analysis_options.yaml', r''' |
| 157 '/project/analysis_options.yaml', | |
| 158 r''' | |
| 159 analyzer: | 157 analyzer: |
| 160 exclude: | 158 exclude: |
| 161 - 'samples/**' | 159 - 'samples/**' |
| 162 '''); | 160 '''); |
| 163 server.setAnalysisRoots('0', ['/project'], [], {}); | 161 server.setAnalysisRoots('0', ['/project'], [], {}); |
| 164 server.setAnalysisSubscriptions(<AnalysisService, Set<String>>{ | 162 server.setAnalysisSubscriptions(<AnalysisService, Set<String>>{ |
| 165 AnalysisService.NAVIGATION: new Set<String>.from([path]) | 163 AnalysisService.NAVIGATION: new Set<String>.from([path]) |
| 166 }); | 164 }); |
| 167 // the file is excluded, so no navigation notification | 165 // the file is excluded, so no navigation notification |
| 168 await server.onAnalysisComplete; | 166 await server.onAnalysisComplete; |
| 169 expect(channel.notificationsReceived.any((notification) { | 167 expect(channel.notificationsReceived.any((notification) { |
| 170 return notification.event == ANALYSIS_NOTIFICATION_NAVIGATION; | 168 return notification.event == ANALYSIS_NOTIFICATION_NAVIGATION; |
| 171 }), isFalse); | 169 }), isFalse); |
| 172 } | 170 } |
| 173 | 171 |
| 174 test_setAnalysisSubscriptions_fileInIgnoredFolder_oldOptions() async { | 172 test_setAnalysisSubscriptions_fileInIgnoredFolder_oldOptions() async { |
| 175 String path = '/project/samples/sample.dart'; | 173 String path = '/project/samples/sample.dart'; |
| 176 resourceProvider.newFile(path, ''); | 174 resourceProvider.newFile(path, ''); |
| 177 resourceProvider.newFile( | 175 resourceProvider.newFile('/project/.analysis_options', r''' |
| 178 '/project/.analysis_options', | |
| 179 r''' | |
| 180 analyzer: | 176 analyzer: |
| 181 exclude: | 177 exclude: |
| 182 - 'samples/**' | 178 - 'samples/**' |
| 183 '''); | 179 '''); |
| 184 server.setAnalysisRoots('0', ['/project'], [], {}); | 180 server.setAnalysisRoots('0', ['/project'], [], {}); |
| 185 server.setAnalysisSubscriptions(<AnalysisService, Set<String>>{ | 181 server.setAnalysisSubscriptions(<AnalysisService, Set<String>>{ |
| 186 AnalysisService.NAVIGATION: new Set<String>.from([path]) | 182 AnalysisService.NAVIGATION: new Set<String>.from([path]) |
| 187 }); | 183 }); |
| 188 // the file is excluded, so no navigation notification | 184 // the file is excluded, so no navigation notification |
| 189 await server.onAnalysisComplete; | 185 await server.onAnalysisComplete; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 213 | 209 |
| 214 class EchoHandler implements RequestHandler { | 210 class EchoHandler implements RequestHandler { |
| 215 @override | 211 @override |
| 216 Response handleRequest(Request request) { | 212 Response handleRequest(Request request) { |
| 217 if (request.method == 'echo') { | 213 if (request.method == 'echo') { |
| 218 return new Response(request.id, result: {'echo': true}); | 214 return new Response(request.id, result: {'echo': true}); |
| 219 } | 215 } |
| 220 return null; | 216 return null; |
| 221 } | 217 } |
| 222 } | 218 } |
| OLD | NEW |