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

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

Issue 1057403003: fix keyword completion in class body (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comment 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/completion_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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 Keyword.WHILE 63 Keyword.WHILE
64 ]); 64 ]);
65 } 65 }
66 66
67 @override 67 @override
68 visitClassDeclaration(ClassDeclaration node) { 68 visitClassDeclaration(ClassDeclaration node) {
69 // Don't suggest class name 69 // Don't suggest class name
70 if (entity == node.name) { 70 if (entity == node.name) {
71 return; 71 return;
72 } 72 }
73 if (entity == node.rightBracket) { 73 if (entity == node.rightBracket || entity is ClassMember) {
74 _addSuggestions([ 74 _addSuggestions([
75 Keyword.CONST, 75 Keyword.CONST,
76 Keyword.DYNAMIC, 76 Keyword.DYNAMIC,
77 Keyword.FACTORY, 77 Keyword.FACTORY,
78 Keyword.FINAL, 78 Keyword.FINAL,
79 Keyword.GET, 79 Keyword.GET,
80 Keyword.OPERATOR, 80 Keyword.OPERATOR,
81 Keyword.SET, 81 Keyword.SET,
82 Keyword.STATIC, 82 Keyword.STATIC,
83 Keyword.VAR, 83 Keyword.VAR,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 return false; 161 return false;
162 } 162 }
163 AstNode parent = body.parent; 163 AstNode parent = body.parent;
164 if (parent is ConstructorDeclaration || parent is MethodDeclaration) { 164 if (parent is ConstructorDeclaration || parent is MethodDeclaration) {
165 return true; 165 return true;
166 } 166 }
167 node = parent; 167 node = parent;
168 } 168 }
169 } 169 }
170 } 170 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/completion_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698