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

Unified Diff: pkg/analysis_server/lib/src/services/completion/local_computer.dart

Issue 962243003: fix constructor suggestion element names (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/services/completion/local_computer.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/local_computer.dart b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
index 7fc7ce6b4bc7df47171794a57f6c6b5abecfd01b..fdbb38c8bda717f8ebafa96edddb9e2aa91eb00a 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
@@ -196,9 +196,10 @@ class _ConstructorVisitor extends LocalDeclarationVisitor {
*/
CompletionSuggestion _addSuggestion(
ClassDeclaration classDecl, ConstructorDeclaration constructorDecl) {
+ SimpleIdentifier elemId;
String completion = classDecl.name.name;
if (constructorDecl != null) {
- SimpleIdentifier elemId = constructorDecl.name;
+ elemId = constructorDecl.name;
if (elemId != null) {
String name = elemId.name;
if (name != null && name.length > 0) {
@@ -250,9 +251,8 @@ class _ConstructorVisitor extends LocalDeclarationVisitor {
}
paramBuf.write(')');
protocol.Element element = _createElement(
- protocol.ElementKind.CONSTRUCTOR, null,
+ protocol.ElementKind.CONSTRUCTOR, elemId,
parameters: paramBuf.toString());
- element.name = completion;
element.returnType = classDecl.name.name;
CompletionSuggestion suggestion = new CompletionSuggestion(
CompletionSuggestionKind.INVOCATION,

Powered by Google App Engine
This is Rietveld 408576698