| 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 domain.analysis; | 5 library domain.analysis; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
| 10 import 'package:analysis_server/src/constants.dart'; | 10 import 'package:analysis_server/src/constants.dart'; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 AnalysisDomainHandler(this.server); | 30 AnalysisDomainHandler(this.server); |
| 31 | 31 |
| 32 /** | 32 /** |
| 33 * Implement the `analysis.getHover` request. | 33 * Implement the `analysis.getHover` request. |
| 34 */ | 34 */ |
| 35 Response getAnalysisHover(Request request) { | 35 Response getAnalysisHover(Request request) { |
| 36 // prepare parameters | 36 // prepare parameters |
| 37 String file = request.getRequiredParameter(FILE).asString(); | 37 String file = request.getRequiredParameter(FILE).asString(); |
| 38 int offset = request.getRequiredParameter(OFFSET).asInt(); | 38 int offset = request.getRequiredParameter(OFFSET).asInt(); |
| 39 // prepare hovers | 39 // prepare hovers |
| 40 List<Map<String, Object>> hovers = <Map<String, Object>>[]; | 40 List<Hover> hovers = <Hover>[]; |
| 41 { | 41 { |
| 42 Source source = server.getSource(file); | 42 Source source = server.getSource(file); |
| 43 AnalysisContext context = server.getAnalysisContext(file); | 43 AnalysisContext context = server.getAnalysisContext(file); |
| 44 List<Source> librarySources = context.getLibrariesContaining(source); | 44 List<Source> librarySources = context.getLibrariesContaining(source); |
| 45 for (Source librarySource in librarySources) { | 45 for (Source librarySource in librarySources) { |
| 46 CompilationUnit unit = context.resolveCompilationUnit2(source, | 46 CompilationUnit unit = context.resolveCompilationUnit2(source, |
| 47 librarySource); | 47 librarySource); |
| 48 hovers.add(new DartUnitHoverComputer(unit, offset).compute()); | 48 hovers.add(new DartUnitHoverComputer(unit, offset).compute()); |
| 49 } | 49 } |
| 50 } | 50 } |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 225 |
| 226 /** | 226 /** |
| 227 * A description of the change to the content of a file. | 227 * A description of the change to the content of a file. |
| 228 */ | 228 */ |
| 229 class ContentChange { | 229 class ContentChange { |
| 230 String content; | 230 String content; |
| 231 int offset; | 231 int offset; |
| 232 int oldLength; | 232 int oldLength; |
| 233 int newLength; | 233 int newLength; |
| 234 } | 234 } |
| OLD | NEW |