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

Side by Side Diff: pkg/analysis_server/lib/src/services/completion/inherited_contributor.dart

Issue 1398333002: Extract protocol_dart.dart APIs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add new files. Created 5 years, 2 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library services.completion.computer.dart.invocation; 5 library services.completion.computer.dart.invocation;
6 6
7 import 'package:analysis_server/plugin/edit/utilities/change_builder_dart.dart'; 7 import 'package:analysis_server/plugin/edit/utilities/change_builder_dart.dart';
8 import 'package:analysis_server/src/protocol_server.dart' 8 import 'package:analysis_server/src/protocol_server.dart'
9 show CompletionSuggestion, CompletionSuggestionKind, SourceChange; 9 show CompletionSuggestion, CompletionSuggestionKind, SourceChange;
10 import 'package:analysis_server/src/protocol_server.dart' as protocol 10 import 'package:analysis_server/src/protocol_server.dart' as protocol
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 Source source, SimpleIdentifier identifier, Element element) { 71 Source source, SimpleIdentifier identifier, Element element) {
72 String completion = _buildRepacementText(source, identifier, element); 72 String completion = _buildRepacementText(source, identifier, element);
73 CompletionSuggestion suggestion = new CompletionSuggestion( 73 CompletionSuggestion suggestion = new CompletionSuggestion(
74 CompletionSuggestionKind.IDENTIFIER, 74 CompletionSuggestionKind.IDENTIFIER,
75 DART_RELEVANCE_HIGH, 75 DART_RELEVANCE_HIGH,
76 completion, 76 completion,
77 identifier.offset, 77 identifier.offset,
78 0, 78 0,
79 element.isDeprecated, 79 element.isDeprecated,
80 false); 80 false);
81 suggestion.element = protocol.newElement_fromEngine(element); 81 suggestion.element = protocol.convertElement(element);
82 return suggestion; 82 return suggestion;
83 } 83 }
84 84
85 /** 85 /**
86 * Return a list containing the names of all of the inherited by not 86 * Return a list containing the names of all of the inherited by not
87 * implemented members of the class represented by the given [element] that 87 * implemented members of the class represented by the given [element] that
88 * start with the given [prefix]. The [map] is used to find all of the members 88 * start with the given [prefix]. The [map] is used to find all of the members
89 * that are inherited. 89 * that are inherited.
90 */ 90 */
91 List<String> _computeMemberNames( 91 List<String> _computeMemberNames(
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 for (String memberName in memberNames) { 151 for (String memberName in memberNames) {
152 CompletionSuggestion suggestion = 152 CompletionSuggestion suggestion =
153 _buildSuggestion(request.source, identifier, map.get(memberName)); 153 _buildSuggestion(request.source, identifier, map.get(memberName));
154 if (suggestion != null) { 154 if (suggestion != null) {
155 suggestions.add(suggestion); 155 suggestions.add(suggestion);
156 } 156 }
157 } 157 }
158 return suggestions; 158 return suggestions;
159 } 159 }
160 } 160 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698