| 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..d6b7f1dad8fda755143f695d88ad80c0d6e7ba8f 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,32 @@ 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();
|
| + }
|
| + Index index = createLocalFileSplitIndex(indexDirectory);
|
| + index.run();
|
| + return index;
|
| +}
|
| +
|
|
|
| /**
|
| * Instances of the class [SocketServer] implement the common parts of
|
| @@ -46,6 +71,7 @@ class SocketServer {
|
| serverChannel,
|
| resourceProvider,
|
| new PubPackageMapProvider(resourceProvider),
|
| + _createIndex(),
|
| rethrowExceptions: false);
|
| _initializeHandlers(analysisServer);
|
| }
|
| @@ -62,5 +88,4 @@ class SocketServer {
|
| new CompletionDomainHandler(server),
|
| ];
|
| }
|
| -
|
| }
|
|
|