| 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_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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 var overrides = new DartUnitOverridesComputer(dartUnit).compute(); | 243 var overrides = new DartUnitOverridesComputer(dartUnit).compute(); |
| 244 var params = new protocol.AnalysisOverridesParams(file, overrides); | 244 var params = new protocol.AnalysisOverridesParams(file, overrides); |
| 245 server.sendNotification(params.toNotification()); | 245 server.sendNotification(params.toNotification()); |
| 246 }); | 246 }); |
| 247 } | 247 } |
| 248 | 248 |
| 249 /** | 249 /** |
| 250 * Sets the cache size in the given [context] to the given value. | 250 * Sets the cache size in the given [context] to the given value. |
| 251 */ | 251 */ |
| 252 void setCacheSize(AnalysisContext context, int cacheSize) { | 252 void setCacheSize(AnalysisContext context, int cacheSize) { |
| 253 AnalysisOptionsImpl options = | 253 // TODO(scheglov) The cache size cannot be changed with task model. |
| 254 new AnalysisOptionsImpl.from(context.analysisOptions); | 254 // TODO(scheglov) Consider removing this function. |
| 255 options.cacheSize = cacheSize; | 255 // AnalysisOptionsImpl options = |
| 256 context.analysisOptions = options; | 256 // new AnalysisOptionsImpl.from(context.analysisOptions); |
| 257 // options.cacheSize = cacheSize; |
| 258 // context.analysisOptions = options; |
| 257 } | 259 } |
| 258 | 260 |
| 259 String _computeLibraryName(CompilationUnit unit) { | 261 String _computeLibraryName(CompilationUnit unit) { |
| 260 for (Directive directive in unit.directives) { | 262 for (Directive directive in unit.directives) { |
| 261 if (directive is LibraryDirective && directive.name != null) { | 263 if (directive is LibraryDirective && directive.name != null) { |
| 262 return directive.name.name; | 264 return directive.name.name; |
| 263 } | 265 } |
| 264 } | 266 } |
| 265 for (Directive directive in unit.directives) { | 267 for (Directive directive in unit.directives) { |
| 266 if (directive is PartOfDirective && directive.libraryName != null) { | 268 if (directive is PartOfDirective && directive.libraryName != null) { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 abstract class _SingleFileOperation extends SourceSensitiveOperation { | 541 abstract class _SingleFileOperation extends SourceSensitiveOperation { |
| 540 final String file; | 542 final String file; |
| 541 | 543 |
| 542 _SingleFileOperation(AnalysisContext context, this.file) : super(context); | 544 _SingleFileOperation(AnalysisContext context, this.file) : super(context); |
| 543 | 545 |
| 544 @override | 546 @override |
| 545 bool shouldBeDiscardedOnSourceChange(Source source) { | 547 bool shouldBeDiscardedOnSourceChange(Source source) { |
| 546 return source.fullName == file; | 548 return source.fullName == file; |
| 547 } | 549 } |
| 548 } | 550 } |
| OLD | NEW |