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

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

Issue 923103004: Return RequestErrorCode.NO_INDEX_GENERATED for search/refactoring requests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 cdc873aad80ed310cd81c415c012cebea1a529ce..e665f06f210309c770ad7fdbed3d689d21777424 100644
--- a/pkg/analysis_server/lib/src/socket_server.dart
+++ b/pkg/analysis_server/lib/src/socket_server.dart
@@ -17,16 +17,6 @@ import 'package:analyzer/src/generated/sdk_io.dart';
/**
- * Creates and runs an [Index].
- */
-Index _createIndex() {
- Index index = createLocalFileIndex();
- index.run();
- return index;
-}
-
-
-/**
* Instances of the class [SocketServer] implement the common parts of
* http-based and stdio-based analysis servers. The primary responsibility of
* the SocketServer is to manage the lifetime of the AnalysisServer and to
@@ -62,6 +52,7 @@ class SocketServer {
});
return;
}
+
PhysicalResourceProvider resourceProvider;
if (analysisServerOptions.fileReadMode == 'as-is') {
resourceProvider = PhysicalResourceProvider.INSTANCE;
@@ -73,11 +64,17 @@ class SocketServer {
'File read mode was set to the unknown mode: $analysisServerOptions.fileReadMode');
}
+ Index index = null;
+ if (!analysisServerOptions.noIndex) {
+ index = createLocalFileIndex();
+ index.run();
+ }
+
analysisServer = new AnalysisServer(
serverChannel,
resourceProvider,
new PubPackageMapProvider(resourceProvider, defaultSdk),
- _createIndex(),
+ index,
analysisServerOptions,
defaultSdk,
instrumentationService,

Powered by Google App Engine
This is Rietveld 408576698