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

Unified Diff: pkg/analysis_services/lib/completion/completion_manager.dart

Issue 467233003: refactor and cleanup code completion (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 4 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_services/lib/completion/completion_manager.dart
diff --git a/pkg/analysis_services/lib/completion/completion_computer.dart b/pkg/analysis_services/lib/completion/completion_manager.dart
similarity index 70%
rename from pkg/analysis_services/lib/completion/completion_computer.dart
rename to pkg/analysis_services/lib/completion/completion_manager.dart
index 6d06232790cf6925e7b4157308284d4117a00692..c9546056e1129f7e2c3e95551d552ad78e71af67 100644
--- a/pkg/analysis_services/lib/completion/completion_computer.dart
+++ b/pkg/analysis_services/lib/completion/completion_manager.dart
@@ -9,42 +9,10 @@ import 'dart:async';
import 'package:analysis_services/completion/completion_suggestion.dart';
import 'package:analysis_services/search/search_engine.dart';
import 'package:analysis_services/src/completion/dart_completion_manager.dart';
-import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
/**
- * The base class for computing code completion suggestions.
- */
-abstract class CompletionComputer {
- AnalysisContext context;
- Source source;
- int offset;
- SearchEngine searchEngine;
-
- /**
- * Computes the initial set of [CompletionSuggestion]s based on
- * the compilation [unit], the AST [node] in which the completion occurred,
- * and information already cached in the analysis context.
- * The supplied [unit] and [node] may not be resolved.
- * This method should execute quickly and not block waiting for any analysis.
- * Returns `true` if the computer's work is complete
- * or `false` if [computeFull] should be called to complete the work.
- */
- bool computeFast(CompilationUnit unit, AstNode node,
- List<CompletionSuggestion> suggestions);
-
- /**
- * Computes the complete set of [CompletionSuggestion]s based on
- * the resolved compilation [unit] and the resolved AST [node] in which the
- * completion occurred.
- * Returns `true` if the receiver modified the list of suggestions.
- */
- Future<bool> computeFull(CompilationUnit unit, AstNode node,
- List<CompletionSuggestion> suggestions);
-}
-
-/**
* Manages `CompletionComputer`s for a given completion request.
*/
abstract class CompletionManager {
@@ -77,7 +45,11 @@ abstract class CompletionManager {
int offset, SearchEngine searchEngine) {
if (context != null) {
if (AnalysisEngine.isDartFileName(source.shortName)) {
- return new DartCompletionManager(context, source, offset, searchEngine);
+ return new DartCompletionManager(context, searchEngine, source, offset);
+ }
+ if (AnalysisEngine.isHtmlFileName(source.shortName)) {
+ //TODO (danrubel) implement
+// return new HtmlCompletionManager(context, searchEngine, source, offset);
}
}
return new NoOpCompletionManager(source, offset);
@@ -119,7 +91,6 @@ class CompletionResult {
this.suggestions, this.last);
}
-
class NoOpCompletionManager extends CompletionManager {
final Source source;
final int offset;

Powered by Google App Engine
This is Rietveld 408576698