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

Side by Side Diff: pkg/analyzer_plugin/lib/utilities/completion/inherited_reference_contributor.dart

Issue 2953093002: Update the plugin API (Closed)
Patch Set: Update FixesRequest Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; 8 import 'package:analyzer/dart/ast/standard_resolution_map.dart';
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/dart/element/type.dart'; 10 import 'package:analyzer/dart/element/type.dart';
(...skipping 23 matching lines...) Expand all
34 ResourceProvider resourceProvider; 34 ResourceProvider resourceProvider;
35 35
36 /** 36 /**
37 * Plugin contributors should primarily overload this function. 37 * Plugin contributors should primarily overload this function.
38 * Should more parameters be needed for autocompletion needs, the 38 * Should more parameters be needed for autocompletion needs, the
39 * overloaded function should define those parameters and 39 * overloaded function should define those parameters and
40 * call on `computeSuggestionsForClass`. 40 * call on `computeSuggestionsForClass`.
41 */ 41 */
42 @override 42 @override
43 Future<Null> computeSuggestions( 43 Future<Null> computeSuggestions(
44 CompletionRequest request, CompletionCollector collector) async { 44 DartCompletionRequest request, CompletionCollector collector) async {
45 CompletionTarget target = 45 CompletionTarget target =
46 new CompletionTarget.forOffset(request.result.unit, request.offset); 46 new CompletionTarget.forOffset(request.result.unit, request.offset);
47 OpType optype = new OpType.forCompletion(target, request.offset); 47 OpType optype = new OpType.forCompletion(target, request.offset);
48 if (!optype.includeIdentifiers) { 48 if (!optype.includeIdentifiers) {
49 return; 49 return;
50 } 50 }
51 ClassDeclaration classDecl = _enclosingClass(target); 51 ClassDeclaration classDecl = _enclosingClass(target);
52 if (classDecl == null || classDecl.element == null) { 52 if (classDecl == null || classDecl.element == null) {
53 return; 53 return;
54 } 54 }
55 containingLibrary = request.result.libraryElement; 55 containingLibrary = request.result.libraryElement;
56 _computeSuggestionsForClass2(collector, target, 56 _computeSuggestionsForClass2(collector, target,
57 resolutionMap.elementDeclaredByClassDeclaration(classDecl), optype); 57 resolutionMap.elementDeclaredByClassDeclaration(classDecl), optype);
58 } 58 }
59 59
60 /** 60 /**
61 * Clients should not overload this function. 61 * Clients should not overload this function.
62 */ 62 */
63 Future<Null> computeSuggestionsForClass( 63 Future<Null> computeSuggestionsForClass(
64 CompletionRequest request, 64 DartCompletionRequest request,
65 CompletionCollector collector, 65 CompletionCollector collector,
66 ClassElement classElement, { 66 ClassElement classElement, {
67 AstNode entryPoint, 67 AstNode entryPoint,
68 bool skipChildClass, 68 bool skipChildClass,
69 CompletionTarget target, 69 CompletionTarget target,
70 OpType optype, 70 OpType optype,
71 }) async { 71 }) async {
72 target ??= new CompletionTarget.forOffset( 72 target ??= new CompletionTarget.forOffset(
73 request.result.unit, request.offset, 73 request.result.unit, request.offset,
74 entryPoint: entryPoint); 74 entryPoint: entryPoint);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 if (node is FieldDeclaration) { 159 if (node is FieldDeclaration) {
160 if (node.isStatic) { 160 if (node.isStatic) {
161 return null; 161 return null;
162 } 162 }
163 } 163 }
164 node = node.parent; 164 node = node.parent;
165 } 165 }
166 return null; 166 return null;
167 } 167 }
168 } 168 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698