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

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

Issue 1048303003: suggest dynamic and void when defining new compilation unit members (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/keyword_computer_test.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) 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.computer.dart.keyword; 5 library services.completion.computer.dart.keyword;
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/dart_completion_manager. dart'; 10 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart';
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 _addSuggestions([Keyword.LIBRARY], DART_RELEVANCE_HIGH); 112 _addSuggestions([Keyword.LIBRARY], DART_RELEVANCE_HIGH);
113 } 113 }
114 _addSuggestions( 114 _addSuggestions(
115 [Keyword.EXPORT, Keyword.IMPORT, Keyword.PART], DART_RELEVANCE_HIGH); 115 [Keyword.EXPORT, Keyword.IMPORT, Keyword.PART], DART_RELEVANCE_HIGH);
116 } 116 }
117 if (entity == null || entity is Declaration) { 117 if (entity == null || entity is Declaration) {
118 _addSuggestions([ 118 _addSuggestions([
119 Keyword.ABSTRACT, 119 Keyword.ABSTRACT,
120 Keyword.CLASS, 120 Keyword.CLASS,
121 Keyword.CONST, 121 Keyword.CONST,
122 Keyword.DYNAMIC,
122 Keyword.FINAL, 123 Keyword.FINAL,
123 Keyword.TYPEDEF, 124 Keyword.TYPEDEF,
124 Keyword.VAR 125 Keyword.VAR,
126 Keyword.VOID
125 ], DART_RELEVANCE_HIGH); 127 ], DART_RELEVANCE_HIGH);
126 } 128 }
127 } 129 }
128 130
129 void _addClassDeclarationKeywords(ClassDeclaration node) { 131 void _addClassDeclarationKeywords(ClassDeclaration node) {
130 // Very simplistic suggestion because analyzer will warn if 132 // Very simplistic suggestion because analyzer will warn if
131 // the extends / with / implements keywords are out of order 133 // the extends / with / implements keywords are out of order
132 if (node.extendsClause == null) { 134 if (node.extendsClause == null) {
133 _addSuggestion(Keyword.EXTENDS, DART_RELEVANCE_HIGH); 135 _addSuggestion(Keyword.EXTENDS, DART_RELEVANCE_HIGH);
134 } else if (node.withClause == null) { 136 } else if (node.withClause == null) {
(...skipping 26 matching lines...) Expand all
161 return false; 163 return false;
162 } 164 }
163 AstNode parent = body.parent; 165 AstNode parent = body.parent;
164 if (parent is ConstructorDeclaration || parent is MethodDeclaration) { 166 if (parent is ConstructorDeclaration || parent is MethodDeclaration) {
165 return true; 167 return true;
166 } 168 }
167 node = parent; 169 node = parent;
168 } 170 }
169 } 171 }
170 } 172 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/keyword_computer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698