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

Unified Diff: pkg/analysis_server/lib/src/status/get_handler.dart

Issue 1801883002: Remove old index and search implementations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/status/get_handler.dart
diff --git a/pkg/analysis_server/lib/src/status/get_handler.dart b/pkg/analysis_server/lib/src/status/get_handler.dart
index 55bec7a5fc98ba63ac732992c2bea481d5e58525..c466669211332277a20f5a11a2e9cfa10896d9ee 100644
--- a/pkg/analysis_server/lib/src/status/get_handler.dart
+++ b/pkg/analysis_server/lib/src/status/get_handler.dart
@@ -4,7 +4,6 @@
library analysis_server.src.status.get_handler;
-import 'dart:async';
import 'dart:collection';
import 'dart:convert';
import 'dart:io';
@@ -19,9 +18,6 @@ import 'package:analysis_server/src/operation/operation.dart';
import 'package:analysis_server/src/operation/operation_analysis.dart';
import 'package:analysis_server/src/operation/operation_queue.dart';
import 'package:analysis_server/src/services/completion/completion_performance.dart';
-import 'package:analysis_server/src/services/index/index.dart';
-import 'package:analysis_server/src/services/index/local_index.dart';
-import 'package:analysis_server/src/services/index/store/split_store.dart';
import 'package:analysis_server/src/socket_server.dart';
import 'package:analysis_server/src/status/ast_writer.dart';
import 'package:analysis_server/src/status/element_writer.dart';
@@ -258,11 +254,6 @@ class GetHandler {
static const String ELEMENT_PATH = '/element';
/**
- * The path used to request information about elements with the given name.
- */
- static const String INDEX_ELEMENT_BY_NAME = '/index/element-by-name';
-
- /**
* The path used to request an overlay contents.
*/
static const String OVERLAY_PATH = '/overlay';
@@ -395,8 +386,6 @@ class GetHandler {
_returnDiagnosticInfo(request);
} else if (path == ELEMENT_PATH) {
_returnElement(request);
- } else if (path == INDEX_ELEMENT_BY_NAME) {
- _returnIndexElementByName(request);
} else if (path == OVERLAY_PATH) {
_returnOverlayContents(request);
} else if (path == OVERLAYS_PATH) {
@@ -1506,51 +1495,6 @@ class GetHandler {
});
}
- /**
- * Return a response containing information about elements with the given
- * name.
- */
- Future _returnIndexElementByName(HttpRequest request) async {
- AnalysisServer analysisServer = _server.analysisServer;
- if (analysisServer == null) {
- return _returnFailure(request, 'Analysis server not running');
- }
- Index index = analysisServer.index;
- if (index == null) {
- return _returnFailure(request, 'Indexing is disabled');
- }
- String name = request.uri.queryParameters[INDEX_ELEMENT_NAME];
- if (name == null) {
- return _returnFailure(
- request, 'Query parameter $INDEX_ELEMENT_NAME required');
- }
- if (index is LocalIndex) {
- Map<List<String>, List<InspectLocation>> relations =
- await index.findElementsByName(name);
- _writeResponse(request, (StringBuffer buffer) {
- _writePage(buffer, 'Analysis Server - Index Elements', ['Name: $name'],
- (StringBuffer buffer) {
- buffer.write('<table border="1">');
- _writeRow(buffer, ['Element', 'Relationship', 'Location'],
- header: true);
- relations.forEach(
- (List<String> elementPath, List<InspectLocation> relations) {
- String elementLocation = elementPath.join(' ');
- relations.forEach((InspectLocation location) {
- var relString = location.relationship.identifier;
- var locString = '${location.path} offset=${location.offset} '
- 'length=${location.length} flags=${location.flags}';
- _writeRow(buffer, [elementLocation, relString, locString]);
- });
- });
- buffer.write('</table>');
- });
- });
- } else {
- return _returnFailure(request, 'LocalIndex expected, but $index found.');
- }
- }
-
void _returnOverlayContents(HttpRequest request) {
String path = request.requestedUri.queryParameters[PATH_PARAM];
if (path == null) {

Powered by Google App Engine
This is Rietveld 408576698