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

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

Issue 1241193002: Add '--useAnalysisHighlight2' option to generate version 2 of semantic highlight. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 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_highlights2.dart';
9 import 'package:analysis_server/src/computer/computer_navigation.dart'; 10 import 'package:analysis_server/src/computer/computer_navigation.dart';
10 import 'package:analysis_server/src/computer/computer_occurrences.dart'; 11 import 'package:analysis_server/src/computer/computer_occurrences.dart';
11 import 'package:analysis_server/src/computer/computer_outline.dart'; 12 import 'package:analysis_server/src/computer/computer_outline.dart';
12 import 'package:analysis_server/src/computer/computer_overrides.dart'; 13 import 'package:analysis_server/src/computer/computer_overrides.dart';
13 import 'package:analysis_server/src/operation/operation.dart'; 14 import 'package:analysis_server/src/operation/operation.dart';
14 import 'package:analysis_server/src/protocol_server.dart' as protocol; 15 import 'package:analysis_server/src/protocol_server.dart' as protocol;
15 import 'package:analysis_server/src/services/dependencies/library_dependencies.d art'; 16 import 'package:analysis_server/src/services/dependencies/library_dependencies.d art';
16 import 'package:analysis_server/src/services/index/index.dart'; 17 import 'package:analysis_server/src/services/index/index.dart';
17 import 'package:analyzer/src/generated/ast.dart'; 18 import 'package:analyzer/src/generated/ast.dart';
18 import 'package:analyzer/src/generated/engine.dart'; 19 import 'package:analyzer/src/generated/engine.dart';
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 if (files != null && files.isNotEmpty) { 143 if (files != null && files.isNotEmpty) {
143 var params = new protocol.AnalysisFlushResultsParams(files); 144 var params = new protocol.AnalysisFlushResultsParams(files);
144 server.sendNotification(params.toNotification()); 145 server.sendNotification(params.toNotification());
145 } 146 }
146 }); 147 });
147 } 148 }
148 149
149 void sendAnalysisNotificationHighlights( 150 void sendAnalysisNotificationHighlights(
150 AnalysisServer server, String file, CompilationUnit dartUnit) { 151 AnalysisServer server, String file, CompilationUnit dartUnit) {
151 _sendNotification(server, () { 152 _sendNotification(server, () {
152 var regions = new DartUnitHighlightsComputer(dartUnit).compute(); 153 List<protocol.HighlightRegion> regions;
154 if (server.options.useAnalysisHighlight2) {
155 regions = new DartUnitHighlightsComputer2(dartUnit).compute();
156 } else {
157 regions = new DartUnitHighlightsComputer(dartUnit).compute();
158 }
153 var params = new protocol.AnalysisHighlightsParams(file, regions); 159 var params = new protocol.AnalysisHighlightsParams(file, regions);
154 server.sendNotification(params.toNotification()); 160 server.sendNotification(params.toNotification());
155 }); 161 });
156 } 162 }
157 163
158 void sendAnalysisNotificationNavigation( 164 void sendAnalysisNotificationNavigation(
159 AnalysisServer server, String file, CompilationUnit dartUnit) { 165 AnalysisServer server, String file, CompilationUnit dartUnit) {
160 _sendNotification(server, () { 166 _sendNotification(server, () {
161 var computer = new DartUnitNavigationComputer(); 167 var computer = new DartUnitNavigationComputer();
162 computer.compute(dartUnit); 168 computer.compute(dartUnit);
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 abstract class _SingleFileOperation extends SourceSensitiveOperation { 472 abstract class _SingleFileOperation extends SourceSensitiveOperation {
467 final String file; 473 final String file;
468 474
469 _SingleFileOperation(AnalysisContext context, this.file) : super(context); 475 _SingleFileOperation(AnalysisContext context, this.file) : super(context);
470 476
471 @override 477 @override
472 bool shouldBeDiscardedOnSourceChange(Source source) { 478 bool shouldBeDiscardedOnSourceChange(Source source) {
473 return source.fullName == file; 479 return source.fullName == file;
474 } 480 }
475 } 481 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/generated_protocol.dart ('k') | pkg/analysis_server/lib/src/server/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698