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

Unified Diff: pkg/analysis_server/lib/src/services/search/search_engine_internal.dart

Issue 2869083002: Convert server to use RangeFactory (Closed)
Patch Set: Created 3 years, 7 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/services/search/search_engine_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart b/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart
index 83d968f77f39fba3b8cf86874a9c1e59703bf743..d35ae142eef8bcbd5a1ca2a5fb9fa610ced4495d 100644
--- a/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart
+++ b/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart
@@ -6,7 +6,6 @@ library analysis_server.src.services.search.search_engine_internal;
import 'dart:async';
-import 'package:analysis_server/src/services/correction/source_range.dart';
import 'package:analysis_server/src/services/index/index.dart';
import 'package:analysis_server/src/services/search/search_engine.dart';
import 'package:analyzer/dart/ast/ast.dart';
@@ -21,6 +20,7 @@ import 'package:analyzer/src/generated/resolver.dart' show NamespaceBuilder;
import 'package:analyzer/src/generated/source.dart' show Source, SourceRange;
import 'package:analyzer/src/generated/utilities_general.dart';
import 'package:analyzer/src/summary/idl.dart';
+import 'package:analyzer_plugin/utilities/range_factory.dart';
/**
* The type of a function that returns the [AstProvider] managing the [file].
@@ -249,7 +249,7 @@ class SearchEngineImpl implements SearchEngine {
librarySource.uri.toString(),
unitSource.uri.toString(),
MatchKind.REFERENCE,
- rangeNode(directive.libraryName),
+ range.node(directive.libraryName),
true,
false));
}
@@ -517,15 +517,13 @@ class _ImportElementReferencesVisitor extends RecursiveAstVisitor {
}
} else {
if (importedElements.contains(node.staticElement)) {
- SourceRange range = rangeStartLength(node, 0);
- _addMatchForRange(range);
+ _addMatchForRange(range.startLength(node, 0));
}
}
}
void _addMatchForPrefix(SimpleIdentifier prefixNode, AstNode nextNode) {
- SourceRange range = rangeStartStart(prefixNode, nextNode);
- _addMatchForRange(range);
+ _addMatchForRange(range.startStart(prefixNode, nextNode));
}
void _addMatchForRange(SourceRange range) {
@@ -587,6 +585,6 @@ class _LocalReferencesVisitor extends RecursiveAstVisitor {
void _addMatch(AstNode node, MatchKind kind) {
bool isQualified = node.parent is Label;
matches.add(new SearchMatchImpl(context, libraryUri, unitUri, kind,
- rangeNode(node), true, isQualified));
+ range.node(node), true, isQualified));
}
}

Powered by Google App Engine
This is Rietveld 408576698