Chromium Code Reviews| Index: pkg/analysis_server/lib/src/socket_server.dart |
| diff --git a/pkg/analysis_server/lib/src/socket_server.dart b/pkg/analysis_server/lib/src/socket_server.dart |
| index 3eb1405520efa2b30973f423d9c55449712a55bc..437df728dc44257f0e5e8cb645d83d61bf71f80c 100644 |
| --- a/pkg/analysis_server/lib/src/socket_server.dart |
| +++ b/pkg/analysis_server/lib/src/socket_server.dart |
| @@ -4,6 +4,8 @@ |
| library socket.server; |
| +import 'dart:io' as io; |
| + |
| import 'package:analysis_server/src/analysis_server.dart'; |
| import 'package:analysis_server/src/channel.dart'; |
| import 'package:analysis_server/src/domain_analysis.dart'; |
| @@ -11,9 +13,33 @@ import 'package:analysis_server/src/domain_completion.dart'; |
| import 'package:analysis_server/src/domain_edit.dart'; |
| import 'package:analysis_server/src/domain_search.dart'; |
| import 'package:analysis_server/src/domain_server.dart'; |
| +import 'package:analysis_server/src/index/index.dart'; |
| import 'package:analysis_server/src/package_map_provider.dart'; |
| import 'package:analysis_server/src/protocol.dart'; |
| import 'package:analysis_server/src/resource.dart'; |
| +import 'package:analyzer/src/generated/index.dart'; |
| +import 'package:path/path.dart' as pathos; |
| + |
| + |
| +/** |
| + * Creates and runs an [Index]. |
| + */ |
| +Index _createIndex() { |
| + String tempPath = io.Directory.systemTemp.path; |
| + String indexPath = pathos.join(tempPath, 'AnalysisServer_index'); |
| + io.Directory indexDirectory = new io.Directory(indexPath); |
| + if (indexDirectory.existsSync()) { |
| + indexDirectory.deleteSync(recursive: true); |
| + } |
| + if (!indexDirectory.existsSync()) { |
| + indexDirectory.createSync(); |
| + } |
| + print('indexDirectory: $indexDirectory'); |
|
Brian Wilkerson
2014/06/25 20:57:18
Debugging code?
scheglov
2014/06/25 21:13:38
Removed.
|
| + Index index = createLocalFileSplitIndex(indexDirectory); |
| + index.run(); |
| + return index; |
| +} |
| + |
| /** |
| * Instances of the class [SocketServer] implement the common parts of |
| @@ -46,6 +72,7 @@ class SocketServer { |
| serverChannel, |
| resourceProvider, |
| new PubPackageMapProvider(resourceProvider), |
| + _createIndex(), |
| rethrowExceptions: false); |
| _initializeHandlers(analysisServer); |
| } |
| @@ -62,5 +89,4 @@ class SocketServer { |
| new CompletionDomainHandler(server), |
| ]; |
| } |
| - |
| } |