| 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 library operation.analysis; | 5 library operation.analysis; |
| 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_navigation.dart'; | 9 import 'package:analysis_server/src/computer/computer_navigation.dart'; |
| 10 import 'package:analysis_server/src/computer/computer_occurrences.dart'; | 10 import 'package:analysis_server/src/computer/computer_occurrences.dart'; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // performAnalysisTask that will be called when the task has been computed | 88 // performAnalysisTask that will be called when the task has been computed |
| 89 // but before it is performed and send notification in the function: | 89 // but before it is performed and send notification in the function: |
| 90 // | 90 // |
| 91 // AnalysisResult result = context.performAnalysisTask((taskDescription) { | 91 // AnalysisResult result = context.performAnalysisTask((taskDescription) { |
| 92 // sendStatusNotification(context.toString(), taskDescription); | 92 // sendStatusNotification(context.toString(), taskDescription); |
| 93 // }); | 93 // }); |
| 94 // prepare results | 94 // prepare results |
| 95 AnalysisResult result = context.performAnalysisTask(); | 95 AnalysisResult result = context.performAnalysisTask(); |
| 96 List<ChangeNotice> notices = result.changeNotices; | 96 List<ChangeNotice> notices = result.changeNotices; |
| 97 if (notices == null) { | 97 if (notices == null) { |
| 98 server.sendContextAnalysisDoneNotifications(context); | 98 server.sendContextAnalysisDoneNotifications(context, |
| 99 AnalysisDoneReason.COMPLETE); |
| 99 return; | 100 return; |
| 100 } | 101 } |
| 101 // process results | 102 // process results |
| 102 sendNotices(server, notices); | 103 sendNotices(server, notices); |
| 103 updateIndex(server.index, notices); | 104 updateIndex(server.index, notices); |
| 104 // continue analysis | 105 // continue analysis |
| 105 server.addOperation(new PerformAnalysisOperation(context, true)); | 106 server.addOperation(new PerformAnalysisOperation(context, true)); |
| 106 } | 107 } |
| 107 | 108 |
| 108 /** | 109 /** |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 // HTML | 158 // HTML |
| 158 { | 159 { |
| 159 HtmlUnit htmlUnit = notice.htmlUnit; | 160 HtmlUnit htmlUnit = notice.htmlUnit; |
| 160 if (htmlUnit != null) { | 161 if (htmlUnit != null) { |
| 161 index.indexHtmlUnit(context, htmlUnit); | 162 index.indexHtmlUnit(context, htmlUnit); |
| 162 } | 163 } |
| 163 } | 164 } |
| 164 } | 165 } |
| 165 } | 166 } |
| 166 } | 167 } |
| OLD | NEW |