From 47a861ca85275da9358443fcab10c48ab780ada9 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Wed, 18 Oct 2017 19:02:47 +0000 Subject: [PATCH] Add two new element types to the protocol. Bug: Change-Id: I5a60081d7c8500590bbabb9ee6dce74fa611b0a3 Reviewed-on: https://dart-review.googlesource.com/14883 Reviewed-by: Brian Wilkerson --- pkg/analysis_server/doc/api.html | 2 +- .../integration/support/protocol_matchers.dart | 4 ++++ .../spec/generated/java/types/ElementKind.java | 4 ++++ pkg/analyzer_plugin/doc/api.html | 8 +------- .../lib/protocol/protocol_common.dart | 14 ++++++++++++++ .../integration/support/protocol_matchers.dart | 4 ++++ .../tool/spec/common_types_spec.html | 2 ++ 7 files changed, 30 insertions(+), 8 deletions(-) diff --git a/pkg/analysis_server/doc/api.html b/pkg/analysis_server/doc/api.html index 80fc87b522c..6528f6d2a99 100644 --- a/pkg/analysis_server/doc/api.html +++ b/pkg/analysis_server/doc/api.html @@ -3066,7 +3066,7 @@ a:focus, a:hover { An enumeration of the kinds of elements.

-
CLASS
CLASS_TYPE_ALIAS
COMPILATION_UNIT
CONSTRUCTOR
ENUM
ENUM_CONSTANT
FIELD
FILE
FUNCTION
FUNCTION_TYPE_ALIAS
GETTER
LABEL
LIBRARY
LOCAL_VARIABLE
METHOD
PARAMETER
PREFIX
SETTER
TOP_LEVEL_VARIABLE
TYPE_PARAMETER
UNIT_TEST_GROUP
UNIT_TEST_TEST
UNKNOWN
ExecutableFile: object
+
CLASS
CLASS_TYPE_ALIAS
COMPILATION_UNIT
CONSTRUCTOR
CONSTRUCTOR_INVOCATION
ENUM
ENUM_CONSTANT
FIELD
FILE
FUNCTION
FUNCTION_INVOCATION
FUNCTION_TYPE_ALIAS
GETTER
LABEL
LIBRARY
LOCAL_VARIABLE
METHOD
PARAMETER
PREFIX
SETTER
TOP_LEVEL_VARIABLE
TYPE_PARAMETER
UNIT_TEST_GROUP
UNIT_TEST_TEST
UNKNOWN
ExecutableFile: object

A description of an executable file.

diff --git a/pkg/analysis_server/test/integration/support/protocol_matchers.dart b/pkg/analysis_server/test/integration/support/protocol_matchers.dart index 1429149aa2c..53e4f7c0ae6 100644 --- a/pkg/analysis_server/test/integration/support/protocol_matchers.dart +++ b/pkg/analysis_server/test/integration/support/protocol_matchers.dart @@ -326,11 +326,13 @@ final Matcher isElement = * CLASS_TYPE_ALIAS * COMPILATION_UNIT * CONSTRUCTOR + * CONSTRUCTOR_INVOCATION * ENUM * ENUM_CONSTANT * FIELD * FILE * FUNCTION + * FUNCTION_INVOCATION * FUNCTION_TYPE_ALIAS * GETTER * LABEL @@ -352,11 +354,13 @@ final Matcher isElementKind = new MatchesEnum("ElementKind", [ "CLASS_TYPE_ALIAS", "COMPILATION_UNIT", "CONSTRUCTOR", + "CONSTRUCTOR_INVOCATION", "ENUM", "ENUM_CONSTANT", "FIELD", "FILE", "FUNCTION", + "FUNCTION_INVOCATION", "FUNCTION_TYPE_ALIAS", "GETTER", "LABEL", diff --git a/pkg/analysis_server/tool/spec/generated/java/types/ElementKind.java b/pkg/analysis_server/tool/spec/generated/java/types/ElementKind.java index 14783c3314c..0b9f43894e2 100644 --- a/pkg/analysis_server/tool/spec/generated/java/types/ElementKind.java +++ b/pkg/analysis_server/tool/spec/generated/java/types/ElementKind.java @@ -31,6 +31,8 @@ public class ElementKind { public static final String CONSTRUCTOR = "CONSTRUCTOR"; + public static final String CONSTRUCTOR_INVOCATION = "CONSTRUCTOR_INVOCATION"; + public static final String ENUM = "ENUM"; public static final String ENUM_CONSTANT = "ENUM_CONSTANT"; @@ -41,6 +43,8 @@ public class ElementKind { public static final String FUNCTION = "FUNCTION"; + public static final String FUNCTION_INVOCATION = "FUNCTION_INVOCATION"; + public static final String FUNCTION_TYPE_ALIAS = "FUNCTION_TYPE_ALIAS"; public static final String GETTER = "GETTER"; diff --git a/pkg/analyzer_plugin/doc/api.html b/pkg/analyzer_plugin/doc/api.html index cb83db633c9..7917358ef66 100644 --- a/pkg/analyzer_plugin/doc/api.html +++ b/pkg/analyzer_plugin/doc/api.html @@ -1253,13 +1253,7 @@ a:focus, a:hover { An enumeration of the kinds of elements.

-
CLASS
CLASS_TYPE_ALIAS
COMPILATION_UNIT
CONSTRUCTOR
ENUM
ENUM_CONSTANT
FIELD
FILE
FUNCTION
FUNCTION_TYPE_ALIAS
GETTER
LABEL
LIBRARY
LOCAL_VARIABLE
METHOD
PARAMETER
PREFIX
SETTER
TOP_LEVEL_VARIABLE
TYPE_PARAMETER
UNIT_TEST_GROUP
- -

Deprecated: support for tests was removed.

-
UNIT_TEST_TEST
- -

Deprecated: support for tests was removed.

-
UNKNOWN
FilePath: String
+
CLASS
CLASS_TYPE_ALIAS
COMPILATION_UNIT
CONSTRUCTOR
CONSTRUCTOR_INVOCATION
ENUM
ENUM_CONSTANT
FIELD
FILE
FUNCTION
FUNCTION_INVOCATION
FUNCTION_TYPE_ALIAS
GETTER
LABEL
LIBRARY
LOCAL_VARIABLE
METHOD
PARAMETER
PREFIX
SETTER
TOP_LEVEL_VARIABLE
TYPE_PARAMETER
UNIT_TEST_GROUP
UNIT_TEST_TEST
UNKNOWN
FilePath: String

The absolute, normalized path of a file. diff --git a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart index de2ec8e0cc3..d622ae233a5 100644 --- a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart +++ b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart @@ -1721,11 +1721,13 @@ class Element implements HasToJson { * CLASS_TYPE_ALIAS * COMPILATION_UNIT * CONSTRUCTOR + * CONSTRUCTOR_INVOCATION * ENUM * ENUM_CONSTANT * FIELD * FILE * FUNCTION + * FUNCTION_INVOCATION * FUNCTION_TYPE_ALIAS * GETTER * LABEL @@ -1755,6 +1757,9 @@ class ElementKind implements Enum { static const ElementKind CONSTRUCTOR = const ElementKind._("CONSTRUCTOR"); + static const ElementKind CONSTRUCTOR_INVOCATION = + const ElementKind._("CONSTRUCTOR_INVOCATION"); + static const ElementKind ENUM = const ElementKind._("ENUM"); static const ElementKind ENUM_CONSTANT = const ElementKind._("ENUM_CONSTANT"); @@ -1765,6 +1770,9 @@ class ElementKind implements Enum { static const ElementKind FUNCTION = const ElementKind._("FUNCTION"); + static const ElementKind FUNCTION_INVOCATION = + const ElementKind._("FUNCTION_INVOCATION"); + static const ElementKind FUNCTION_TYPE_ALIAS = const ElementKind._("FUNCTION_TYPE_ALIAS"); @@ -1807,11 +1815,13 @@ class ElementKind implements Enum { CLASS_TYPE_ALIAS, COMPILATION_UNIT, CONSTRUCTOR, + CONSTRUCTOR_INVOCATION, ENUM, ENUM_CONSTANT, FIELD, FILE, FUNCTION, + FUNCTION_INVOCATION, FUNCTION_TYPE_ALIAS, GETTER, LABEL, @@ -1843,6 +1853,8 @@ class ElementKind implements Enum { return COMPILATION_UNIT; case "CONSTRUCTOR": return CONSTRUCTOR; + case "CONSTRUCTOR_INVOCATION": + return CONSTRUCTOR_INVOCATION; case "ENUM": return ENUM; case "ENUM_CONSTANT": @@ -1853,6 +1865,8 @@ class ElementKind implements Enum { return FILE; case "FUNCTION": return FUNCTION; + case "FUNCTION_INVOCATION": + return FUNCTION_INVOCATION; case "FUNCTION_TYPE_ALIAS": return FUNCTION_TYPE_ALIAS; case "GETTER": diff --git a/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart b/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart index f5af9272b54..5953c1c5a1f 100644 --- a/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart +++ b/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart @@ -251,11 +251,13 @@ final Matcher isElement = * CLASS_TYPE_ALIAS * COMPILATION_UNIT * CONSTRUCTOR + * CONSTRUCTOR_INVOCATION * ENUM * ENUM_CONSTANT * FIELD * FILE * FUNCTION + * FUNCTION_INVOCATION * FUNCTION_TYPE_ALIAS * GETTER * LABEL @@ -277,11 +279,13 @@ final Matcher isElementKind = new MatchesEnum("ElementKind", [ "CLASS_TYPE_ALIAS", "COMPILATION_UNIT", "CONSTRUCTOR", + "CONSTRUCTOR_INVOCATION", "ENUM", "ENUM_CONSTANT", "FIELD", "FILE", "FUNCTION", + "FUNCTION_INVOCATION", "FUNCTION_TYPE_ALIAS", "GETTER", "LABEL", diff --git a/pkg/analyzer_plugin/tool/spec/common_types_spec.html b/pkg/analyzer_plugin/tool/spec/common_types_spec.html index 7319804c819..1047f8dde91 100644 --- a/pkg/analyzer_plugin/tool/spec/common_types_spec.html +++ b/pkg/analyzer_plugin/tool/spec/common_types_spec.html @@ -480,11 +480,13 @@ CLASS_TYPE_ALIAS COMPILATION_UNIT CONSTRUCTOR + CONSTRUCTOR_INVOCATION ENUM ENUM_CONSTANT FIELD FILE FUNCTION + FUNCTION_INVOCATION FUNCTION_TYPE_ALIAS GETTER LABEL