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

Unified Diff: pkg/analysis_server/lib/src/protocol_server.dart

Issue 1313113002: Fix display of parameter lists in servers Element structure (issue 24194) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: formatted Created 5 years, 4 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
« no previous file with comments | « no previous file | pkg/analysis_server/test/protocol_server_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/protocol_server.dart
diff --git a/pkg/analysis_server/lib/src/protocol_server.dart b/pkg/analysis_server/lib/src/protocol_server.dart
index 4f0b4905016e27bab1ca7380f4db1177745db30b..ea9445767efccfe185694744cd8ba839d5918563 100644
--- a/pkg/analysis_server/lib/src/protocol_server.dart
+++ b/pkg/analysis_server/lib/src/protocol_server.dart
@@ -105,7 +105,10 @@ Element newElement_fromEngine(engine.Element element) {
String elementParameters = _getParametersString(element);
String elementReturnType = getReturnTypeString(element);
ElementKind kind = newElementKind_fromEngineElement(element);
- return new Element(kind, name, Element.makeFlags(
+ return new Element(
+ kind,
+ name,
+ Element.makeFlags(
isPrivate: element.isPrivate,
isDeprecated: element.isDeprecated,
isAbstract: _isAbstract(element),
@@ -184,7 +187,8 @@ ElementKind newElementKind_fromEngineElement(engine.Element element) {
if (element is engine.ClassElement && element.isEnum) {
return ElementKind.ENUM;
}
- if (element is engine.FieldElement && element.isEnumConstant &&
+ if (element is engine.FieldElement &&
+ element.isEnumConstant &&
// MyEnum.values and MyEnum.one.index return isEnumConstant = true
// so these additional checks are necessary.
// TODO(danrubel) MyEnum.values is constant, but is a list
@@ -353,16 +357,17 @@ String _getParametersString(engine.Element element) {
sb.write(', ');
}
if (closeOptionalString.isEmpty) {
- if (parameter.kind == engine.ParameterKind.NAMED) {
+ engine.ParameterKind kind = parameter.parameterKind;
+ if (kind == engine.ParameterKind.NAMED) {
sb.write('{');
closeOptionalString = '}';
}
- if (parameter.kind == engine.ParameterKind.POSITIONAL) {
+ if (kind == engine.ParameterKind.POSITIONAL) {
sb.write('[');
closeOptionalString = ']';
}
}
- sb.write(parameter.toString());
+ parameter.appendToWithoutDelimiters(sb);
}
sb.write(closeOptionalString);
return '(' + sb.toString() + ')';
« no previous file with comments | « no previous file | pkg/analysis_server/test/protocol_server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698