Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Side by Side Diff: pkg/analysis_server/lib/src/operation/operation_analysis.dart

Issue 2965533002: Use AnalysisDriver.getCachedResult() for 'implemented' notification. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 23 matching lines...) Expand all
34 } 34 }
35 } 35 }
36 36
37 Future<Null> scheduleImplementedNotification( 37 Future<Null> scheduleImplementedNotification(
38 AnalysisServer server, Iterable<String> files) async { 38 AnalysisServer server, Iterable<String> files) async {
39 SearchEngine searchEngine = server.searchEngine; 39 SearchEngine searchEngine = server.searchEngine;
40 if (searchEngine == null) { 40 if (searchEngine == null) {
41 return; 41 return;
42 } 42 }
43 for (String file in files) { 43 for (String file in files) {
44 CompilationUnit unit = await server.getResolvedCompilationUnit(file); 44 CompilationUnit unit = server.getCachedAnalysisResult(file)?.unit;
45 CompilationUnitElement unitElement = unit?.element; 45 CompilationUnitElement unitElement = unit?.element;
46 if (unitElement != null) { 46 if (unitElement != null) {
47 try { 47 try {
48 ImplementedComputer computer = 48 ImplementedComputer computer =
49 new ImplementedComputer(searchEngine, unitElement); 49 new ImplementedComputer(searchEngine, unitElement);
50 await computer.compute(); 50 await computer.compute();
51 var params = new protocol.AnalysisImplementedParams( 51 var params = new protocol.AnalysisImplementedParams(
52 file, computer.classes, computer.members); 52 file, computer.classes, computer.members);
53 server.sendNotification(params.toNotification()); 53 server.sendNotification(params.toNotification());
54 } catch (exception, stackTrace) { 54 } catch (exception, stackTrace) {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 void _sendNotification(AnalysisServer server, f()) { 157 void _sendNotification(AnalysisServer server, f()) {
158 ServerPerformanceStatistics.notices.makeCurrentWhile(() { 158 ServerPerformanceStatistics.notices.makeCurrentWhile(() {
159 try { 159 try {
160 f(); 160 f();
161 } catch (exception, stackTrace) { 161 } catch (exception, stackTrace) {
162 server.sendServerErrorNotification( 162 server.sendServerErrorNotification(
163 'Failed to send notification', exception, stackTrace); 163 'Failed to send notification', exception, stackTrace);
164 } 164 }
165 }); 165 });
166 } 166 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/test/analysis/notification_implemented_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698