| 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 test.domain.analysis.abstract; | 5 library test.domain.analysis.abstract; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 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/domain_analysis.dart'; | 10 import 'package:analysis_server/src/domain_analysis.dart'; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 Index createIndex() { | 88 Index createIndex() { |
| 89 return null; | 89 return null; |
| 90 } | 90 } |
| 91 | 91 |
| 92 /** | 92 /** |
| 93 * Creates a project `/project`. | 93 * Creates a project `/project`. |
| 94 */ | 94 */ |
| 95 void createProject() { | 95 void createProject() { |
| 96 resourceProvider.newFolder(projectPath); | 96 resourceProvider.newFolder(projectPath); |
| 97 Request request = new AnalysisSetAnalysisRootsParams([projectPath], | 97 Request request = new AnalysisSetAnalysisRootsParams( |
| 98 []).toRequest('0'); | 98 included: [projectPath]).toRequest('0'); |
| 99 handleSuccessfulRequest(request); | 99 handleSuccessfulRequest(request); |
| 100 } | 100 } |
| 101 | 101 |
| 102 /** | 102 /** |
| 103 * Returns the offset of [search] in [testCode]. | 103 * Returns the offset of [search] in [testCode]. |
| 104 * Fails if not found. | 104 * Fails if not found. |
| 105 */ | 105 */ |
| 106 int findFileOffset(String path, String search) { | 106 int findFileOffset(String path, String search) { |
| 107 File file = resourceProvider.getResource(path) as File; | 107 File file = resourceProvider.getResource(path) as File; |
| 108 String code = file.createSource().contents.data; | 108 String code = file.createSource().contents.data; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 return waitForServerOperationsPerformed(server); | 251 return waitForServerOperationsPerformed(server); |
| 252 } | 252 } |
| 253 | 253 |
| 254 static String _getCodeString(code) { | 254 static String _getCodeString(code) { |
| 255 if (code is List<String>) { | 255 if (code is List<String>) { |
| 256 code = code.join('\n'); | 256 code = code.join('\n'); |
| 257 } | 257 } |
| 258 return code as String; | 258 return code as String; |
| 259 } | 259 } |
| 260 } | 260 } |
| OLD | NEW |