Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 || node.members.contains(entity)) { |
|
Paul Berry
2015/04/03 21:20:51
Nit: since request.target.containingNode is always
danrubel
2015/04/03 22:10:40
Good suggestion. Done.
| |
| 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 Loading... | |
| 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 } |
| OLD | NEW |