Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: pkg/analysis_server/lib/src/socket_server.dart

Issue 346963006: Index Dart/HTML units after analysis. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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),
];
}
-
}

Powered by Google App Engine
This is Rietveld 408576698