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/src/analysis_server.dart'; | 7 import 'package:analysis_server/src/analysis_server.dart'; |
8 import 'package:analysis_server/src/computer/computer_highlights.dart'; | 8 import 'package:analysis_server/src/computer/computer_highlights.dart'; |
9 import 'package:analysis_server/src/computer/computer_highlights2.dart'; | 9 import 'package:analysis_server/src/computer/computer_highlights2.dart'; |
10 import 'package:analysis_server/src/computer/computer_outline.dart'; | 10 import 'package:analysis_server/src/computer/computer_outline.dart'; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 } | 60 } |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 void sendAnalysisNotificationAnalyzedFiles(AnalysisServer server) { | 64 void sendAnalysisNotificationAnalyzedFiles(AnalysisServer server) { |
65 _sendNotification(server, () { | 65 _sendNotification(server, () { |
66 Set<String> analyzedFiles = server.driverMap.values | 66 Set<String> analyzedFiles = server.driverMap.values |
67 .map((driver) => driver.knownFiles) | 67 .map((driver) => driver.knownFiles) |
68 .expand((files) => files) | 68 .expand((files) => files) |
69 .toSet(); | 69 .toSet(); |
| 70 |
| 71 // Exclude *.yaml files because IDEA Dart plugin attempts to index |
| 72 // all the files in folders which contain analyzed files. |
| 73 analyzedFiles.removeWhere((file) => file.endsWith('.yaml')); |
| 74 |
70 Set<String> prevAnalyzedFiles = server.prevAnalyzedFiles; | 75 Set<String> prevAnalyzedFiles = server.prevAnalyzedFiles; |
71 if (prevAnalyzedFiles != null && | 76 if (prevAnalyzedFiles != null && |
72 prevAnalyzedFiles.length == analyzedFiles.length && | 77 prevAnalyzedFiles.length == analyzedFiles.length && |
73 prevAnalyzedFiles.difference(analyzedFiles).isEmpty) { | 78 prevAnalyzedFiles.difference(analyzedFiles).isEmpty) { |
74 // No change to the set of analyzed files. No need to send another | 79 // No change to the set of analyzed files. No need to send another |
75 // notification. | 80 // notification. |
76 return; | 81 return; |
77 } | 82 } |
78 server.prevAnalyzedFiles = analyzedFiles; | 83 server.prevAnalyzedFiles = analyzedFiles; |
79 protocol.AnalysisAnalyzedFilesParams params = | 84 protocol.AnalysisAnalyzedFilesParams params = |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 void _sendNotification(AnalysisServer server, f()) { | 162 void _sendNotification(AnalysisServer server, f()) { |
158 ServerPerformanceStatistics.notices.makeCurrentWhile(() { | 163 ServerPerformanceStatistics.notices.makeCurrentWhile(() { |
159 try { | 164 try { |
160 f(); | 165 f(); |
161 } catch (exception, stackTrace) { | 166 } catch (exception, stackTrace) { |
162 server.sendServerErrorNotification( | 167 server.sendServerErrorNotification( |
163 'Failed to send notification', exception, stackTrace); | 168 'Failed to send notification', exception, stackTrace); |
164 } | 169 } |
165 }); | 170 }); |
166 } | 171 } |
OLD | NEW |