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

Unified Diff: pkg/analysis_server/test/edit/assists_test.dart

Issue 2832643005: Add plugin support for getAssists (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « pkg/analysis_server/test/analysis_abstract.dart ('k') | pkg/analysis_server/test/edit/fixes_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/edit/assists_test.dart
diff --git a/pkg/analysis_server/test/edit/assists_test.dart b/pkg/analysis_server/test/edit/assists_test.dart
index 0181c878275d993d7e60c0071ec6a5b529f46dda..7e6092f063dd1cd77db3dc079c076f9d51e3a612 100644
--- a/pkg/analysis_server/test/edit/assists_test.dart
+++ b/pkg/analysis_server/test/edit/assists_test.dart
@@ -2,10 +2,14 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library test.edit.assists;
+import 'dart:async';
import 'package:analysis_server/plugin/protocol/protocol.dart';
import 'package:analysis_server/src/edit/edit_domain.dart';
+import 'package:analysis_server/src/plugin/plugin_manager.dart';
+import 'package:analyzer_plugin/protocol/protocol.dart' as plugin;
+import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
+import 'package:analyzer_plugin/src/protocol/protocol_internal.dart' as plugin;
import 'package:plugin/manager.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -37,6 +41,7 @@ class AssistsTest extends AbstractAnalysisTest {
@override
void setUp() {
+ enableNewAnalysisDriver = true;
super.setUp();
createProject();
ExtensionManager manager = new ExtensionManager();
@@ -44,6 +49,27 @@ class AssistsTest extends AbstractAnalysisTest {
handler = new EditDomainHandler(server);
}
+ test_fromPlugins() async {
+ PluginInfo info = new PluginInfo('a', 'b', 'c', null, null);
+ String message = 'From a plugin';
+ plugin.PrioritizedSourceChange change = new plugin.PrioritizedSourceChange(
+ 5,
+ new plugin.SourceChange(message, edits: <plugin.SourceFileEdit>[
+ new plugin.SourceFileEdit('', 0,
+ edits: <plugin.SourceEdit>[new plugin.SourceEdit(0, 0, 'x')])
+ ]));
+ plugin.EditGetAssistsResult result = new plugin.EditGetAssistsResult(
+ <plugin.PrioritizedSourceChange>[change]);
+ pluginManager.broadcastResults = <PluginInfo, Future<plugin.Response>>{
+ info: new Future.value(result.toResponse('-'))
+ };
+
+ addTestFile('main() {}');
+ await waitForTasksFinished();
+ await prepareAssists('in(');
+ _assertHasChange(message, 'xmain() {}');
+ }
+
test_removeTypeAnnotation() async {
addTestFile('''
main() {
« no previous file with comments | « pkg/analysis_server/test/analysis_abstract.dart ('k') | pkg/analysis_server/test/edit/fixes_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698