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

Unified Diff: pkg/analyzer/lib/src/generated/element.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 | « pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/element.dart
diff --git a/pkg/analyzer/lib/src/generated/element.dart b/pkg/analyzer/lib/src/generated/element.dart
index 596647c86f77b85941c35c9d5726408ae3ab643b..6c6040ddcbc7cb4a069e031c8f23cdb7a9fbd555 100644
--- a/pkg/analyzer/lib/src/generated/element.dart
+++ b/pkg/analyzer/lib/src/generated/element.dart
@@ -8691,6 +8691,12 @@ abstract class ParameterElement
*/
List<TypeParameterElement> get typeParameters;
+ /**
+ * Append the type, name and possibly the default value of this parameter to
+ * the given [buffer].
+ */
+ void appendToWithoutDelimiters(StringBuffer buffer);
+
@override
FormalParameter computeNode();
}
@@ -8699,7 +8705,7 @@ abstract class ParameterElement
* A concrete implementation of a [ParameterElement].
*/
class ParameterElementImpl extends VariableElementImpl
- with PotentiallyConstVariableElement
+ with ParameterElementMixin, PotentiallyConstVariableElement
implements ParameterElement {
/**
* An empty list of parameter elements.
@@ -8835,24 +8841,6 @@ class ParameterElementImpl extends VariableElementImpl
buffer.write(right);
}
- /**
- * Append the type and name of this parameter to the given [buffer].
- */
- void appendToWithoutDelimiters(StringBuffer buffer) {
- buffer.write(type);
- buffer.write(" ");
- buffer.write(displayName);
- if (_defaultValueCode != null) {
- if (parameterKind == ParameterKind.NAMED) {
- buffer.write(": ");
- }
- if (parameterKind == ParameterKind.POSITIONAL) {
- buffer.write(" = ");
- }
- buffer.write(_defaultValueCode);
- }
- }
-
@override
FormalParameter computeNode() =>
getNodeMatching((node) => node is FormalParameter);
@@ -8898,6 +8886,28 @@ class ParameterElementImpl extends VariableElementImpl
}
/**
+ * A mixin that provides a common implementation for methods defined in
+ * [ParameterElement].
+ */
+abstract class ParameterElementMixin implements ParameterElement {
+ @override
+ void appendToWithoutDelimiters(StringBuffer buffer) {
+ buffer.write(type);
+ buffer.write(" ");
+ buffer.write(displayName);
+ if (defaultValueCode != null) {
+ if (parameterKind == ParameterKind.NAMED) {
+ buffer.write(": ");
+ }
+ if (parameterKind == ParameterKind.POSITIONAL) {
+ buffer.write(" = ");
+ }
+ buffer.write(defaultValueCode);
+ }
+ }
+}
+
+/**
* A type with type parameters, such as a class or function type alias.
*/
abstract class ParameterizedType implements DartType {
@@ -8921,7 +8931,9 @@ abstract class ParameterizedType implements DartType {
* A parameter element defined in a parameterized type where the values of the
* type parameters are known.
*/
-class ParameterMember extends VariableMember implements ParameterElement {
+class ParameterMember extends VariableMember
+ with ParameterElementMixin
+ implements ParameterElement {
/**
* Initialize a newly created element to represent a constructor, based on the
* [baseElement], defined by the [definingType].
« no previous file with comments | « pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698