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

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

Issue 968283003: Static SPPM-n1 model for Dart Core API usage (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/common_usage_generated.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.relevance; 5 library services.completion.computer.dart.relevance;
6 6
7 import 'package:analysis_server/src/protocol_server.dart' as protocol; 7 import 'package:analysis_server/src/protocol_server.dart' as protocol;
8 import 'package:analysis_server/src/protocol_server.dart' 8 import 'package:analysis_server/src/protocol_server.dart'
9 show CompletionSuggestion, CompletionSuggestionKind; 9 show CompletionSuggestion, CompletionSuggestionKind;
10 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart'; 10 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart';
11 import 'package:analyzer/src/generated/ast.dart'; 11 import 'package:analyzer/src/generated/ast.dart';
12 import 'package:analyzer/src/generated/element.dart'; 12 import 'package:analyzer/src/generated/element.dart';
13 13
14 /** 14 part 'common_usage_generated.dart';
15 * A map of <library>.<classname> to an ordered list of method names,
16 * field names, getter names, and named constructors.
17 * The names are ordered from most relevant to least relevant.
18 * Names not listed are considered equally less relevant than those listed.
19 */
20 const Map<String, List<String>> defaultSelectorRelevance = const {
21 //
22 // Sample implementation which updates the relevance of the following
23 // new Random().nextInt(...)
24 // new Random().nextDouble(...)
25 // new Random().nextBool() - not commonly used thus omitted from list
26 // Entries should look something like this
27 // 'dart.math.Random': const ['nextInt', 'nextDouble'],
28 // 'dart.async.Future': const ['value', 'wait'],
29 };
30 15
31 /** 16 /**
32 * A computer for adjusting the relevance of completions computed by others 17 * A computer for adjusting the relevance of completions computed by others
33 * based upon common Dart usage patterns. 18 * based upon common Dart usage patterns.
34 */ 19 */
35 class CommonUsageComputer { 20 class CommonUsageComputer {
36 /** 21 /**
37 * A map of <library>.<classname> to an ordered list of method names, 22 * A map of <library>.<classname> to an ordered list of method names,
38 * field names, getter names, and named constructors. 23 * field names, getter names, and named constructors.
39 * The names are ordered from most relevant to least relevant. 24 * The names are ordered from most relevant to least relevant.
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 DartType visitPropertyAccess(PropertyAccess node) { 137 DartType visitPropertyAccess(PropertyAccess node) {
153 if (node.propertyName == entity) { 138 if (node.propertyName == entity) {
154 Expression target = node.realTarget; 139 Expression target = node.realTarget;
155 if (target != null) { 140 if (target != null) {
156 return target.bestType; 141 return target.bestType;
157 } 142 }
158 } 143 }
159 return null; 144 return null;
160 } 145 }
161 } 146 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/common_usage_generated.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698