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

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

Issue 901253002: move relevance computation from client to server (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix test Created 5 years, 10 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.dart; 5 library services.completion.dart;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart'; 9 import 'package:analysis_server/src/protocol.dart';
10 import 'package:analysis_server/src/services/completion/arglist_computer.dart'; 10 import 'package:analysis_server/src/services/completion/arglist_computer.dart';
(...skipping 12 matching lines...) Expand all
23 import 'package:analyzer/src/generated/source.dart'; 23 import 'package:analyzer/src/generated/source.dart';
24 import 'package:analyzer/src/generated/scanner.dart'; 24 import 'package:analyzer/src/generated/scanner.dart';
25 25
26 // TODO (danrubel) these are temporary constants as we transition completion 26 // TODO (danrubel) these are temporary constants as we transition completion
27 // relevance from CompletionRelevance.LOW/DEFAULT/HIGH to int. 27 // relevance from CompletionRelevance.LOW/DEFAULT/HIGH to int.
28 // These should be removed in a subsequent CL 28 // These should be removed in a subsequent CL
29 const int COMPLETION_RELEVANCE_LOW = 500; 29 const int COMPLETION_RELEVANCE_LOW = 500;
30 const int COMPLETION_RELEVANCE_DEFAULT = 1000; 30 const int COMPLETION_RELEVANCE_DEFAULT = 1000;
31 const int COMPLETION_RELEVANCE_HIGH = 2000; 31 const int COMPLETION_RELEVANCE_HIGH = 2000;
32 32
33 // Relevance highest to lowest
34 const int DART_RELEVANCE_LOCAL_VARIABLE = 1059;
35 const int DART_RELEVANCE_PARAMETER = 1059;
36 const int DART_RELEVANCE_INHERITED_FIELD = 1058;
37 const int DART_RELEVANCE_LOCAL_FIELD = 1058;
38 const int DART_RELEVANCE_INHERITED_ACCESSOR = 1057;
39 const int DART_RELEVANCE_INHERITED_METHOD = 1057;
40 const int DART_RELEVANCE_LOCAL_ACCESSOR = 1057;
41 const int DART_RELEVANCE_LOCAL_METHOD = 1057;
42 const int DART_RELEVANCE_LOCAL_FUNCTION = 1056;
43 const int DART_RELEVANCE_LOCAL_TOP_LEVEL_VARIABLE = 1056;
44 const int DART_RELEVANCE_KEYWORD = 1055;
45
33 /** 46 /**
34 * The base class for computing code completion suggestions. 47 * The base class for computing code completion suggestions.
35 */ 48 */
36 abstract class DartCompletionComputer { 49 abstract class DartCompletionComputer {
37 /** 50 /**
38 * Computes the initial set of [CompletionSuggestion]s based on 51 * Computes the initial set of [CompletionSuggestion]s based on
39 * the given completion context. The compilation unit and completion node 52 * the given completion context. The compilation unit and completion node
40 * in the given completion context may not be resolved. 53 * in the given completion context may not be resolved.
41 * This method should execute quickly and not block waiting for any analysis. 54 * This method should execute quickly and not block waiting for any analysis.
42 * Returns `true` if the computer's work is complete 55 * Returns `true` if the computer's work is complete
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 * Information about the types of suggestions that should be included. 337 * Information about the types of suggestions that should be included.
325 * The [target] must be set first. 338 * The [target] must be set first.
326 */ 339 */
327 OpType get optype { 340 OpType get optype {
328 if (_optype == null) { 341 if (_optype == null) {
329 _optype = new OpType.forCompletion(target, offset); 342 _optype = new OpType.forCompletion(target, offset);
330 } 343 }
331 return _optype; 344 return _optype;
332 } 345 }
333 } 346 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698