From 8fa5567edba2d2fe8bfed2d2e63d7e3548b37cd4 Mon Sep 17 00:00:00 2001 From: Konstantin Shcheglov Date: Sat, 17 Feb 2018 04:27:52 +0000 Subject: [PATCH] API for search.getElementDeclarations. The goal is to provide clients (specifically VS Code) with API that is fast, and can search top-level and class member declarations. I'm not sure whether we want ElementKind, it has kinds that we will not use, e.g. I don't think we will return local variables or parameters. It would be probably still a lot of information, maybe we should use single string table in response? R=brianwilkerson@google.com Bug: https://github.com/dart-lang/sdk/issues/29510 Change-Id: Ie31bb398a08d462c1cb08c7d82c4443c0c09932a Reviewed-on: https://dart-review.googlesource.com/42105 Commit-Queue: Konstantin Shcheglov Reviewed-by: Brian Wilkerson --- pkg/analysis_server/doc/api.html | 46 ++- .../lib/protocol/protocol_constants.dart | 5 + .../lib/protocol/protocol_generated.dart | 384 ++++++++++++++++++ .../test/integration/coverage.md | 1 + .../support/integration_test_methods.dart | 21 + .../support/protocol_matchers.dart | 44 ++ .../spec/generated/java/AnalysisServer.java | 7 + .../java/types/ElementDeclaration.java | 225 ++++++++++ pkg/analysis_server/tool/spec/spec_input.html | 74 ++++ 9 files changed, 806 insertions(+), 1 deletion(-) create mode 100644 pkg/analysis_server/tool/spec/generated/java/types/ElementDeclaration.java diff --git a/pkg/analysis_server/doc/api.html b/pkg/analysis_server/doc/api.html index a459c82b9f8..cf6afc5ad67 100644 --- a/pkg/analysis_server/doc/api.html +++ b/pkg/analysis_server/doc/api.html @@ -1563,6 +1563,7 @@ a:focus, a:hover { +

Requests

search.findElementReferences
request: {
   "id": String
   "method": "search.findElementReferences"
@@ -2539,6 +2540,7 @@ a:focus, a:hover {
   
   
   
+  
   
   
 
AddContentOverlay: object
@@ -3078,6 +3080,48 @@ a:focus, a:hover { The type parameter list for the element. If the element doesn't have type parameters, this field will not be defined.

+
ElementDeclaration: object
+

+ A declaration - top-level (class, field, etc) or a class member (method, + field, etc). +

+ +
name: String
+ +

+ The name of the declaration. +

+
kind: ElementKind
+ +

+ The kind of the element that corresponds to the declaration. +

+
fileIndex: int
+ +

+ The index of the file (in the enclosing response). +

+
offset: int
+ +

+ The offset of the declaration name in the file. +

+
line: int
+ +

+ The one-based index of the line containing the declaration name. +

+
column: int
+ +

+ The one-based index of the column containing the declaration name. +

+
className: String (optional)
+ +

+ The name of the class enclosing this declaration. If the declaration + is not a class member, this field will be absent. +

ElementKind: String

An enumeration of the kinds of elements. @@ -4742,7 +4786,7 @@ a:focus, a:hover { TODO: TBD

Index

-

Domains

server ()

analysis ()

completion ()

Requests
Notifications

search ()

edit ()

execution ()

diagnostic ()

Types ()

Refactorings ()

+

Domains

server ()

analysis ()

completion ()

Requests
Notifications

search ()

edit ()

execution ()

diagnostic ()

Types ()

Refactorings ()

\ No newline at end of file diff --git a/pkg/analysis_server/lib/protocol/protocol_constants.dart b/pkg/analysis_server/lib/protocol/protocol_constants.dart index 2a33b0825ae..e061b39bf76 100644 --- a/pkg/analysis_server/lib/protocol/protocol_constants.dart +++ b/pkg/analysis_server/lib/protocol/protocol_constants.dart @@ -234,6 +234,8 @@ const String SEARCH_REQUEST_FIND_MEMBER_REFERENCES_NAME = 'name'; const String SEARCH_REQUEST_FIND_TOP_LEVEL_DECLARATIONS = 'search.findTopLevelDeclarations'; const String SEARCH_REQUEST_FIND_TOP_LEVEL_DECLARATIONS_PATTERN = 'pattern'; +const String SEARCH_REQUEST_GET_ELEMENT_DECLARATIONS = + 'search.getElementDeclarations'; const String SEARCH_REQUEST_GET_TYPE_HIERARCHY = 'search.getTypeHierarchy'; const String SEARCH_REQUEST_GET_TYPE_HIERARCHY_FILE = 'file'; const String SEARCH_REQUEST_GET_TYPE_HIERARCHY_OFFSET = 'offset'; @@ -243,6 +245,9 @@ const String SEARCH_RESPONSE_FIND_ELEMENT_REFERENCES_ID = 'id'; const String SEARCH_RESPONSE_FIND_MEMBER_DECLARATIONS_ID = 'id'; const String SEARCH_RESPONSE_FIND_MEMBER_REFERENCES_ID = 'id'; const String SEARCH_RESPONSE_FIND_TOP_LEVEL_DECLARATIONS_ID = 'id'; +const String SEARCH_RESPONSE_GET_ELEMENT_DECLARATIONS_DECLARATIONS = + 'declarations'; +const String SEARCH_RESPONSE_GET_ELEMENT_DECLARATIONS_FILES = 'files'; const String SEARCH_RESPONSE_GET_TYPE_HIERARCHY_HIERARCHY_ITEMS = 'hierarchyItems'; const String SERVER_NOTIFICATION_CONNECTED = 'server.connected'; diff --git a/pkg/analysis_server/lib/protocol/protocol_generated.dart b/pkg/analysis_server/lib/protocol/protocol_generated.dart index b78ce282c3b..3c54e206cb0 100644 --- a/pkg/analysis_server/lib/protocol/protocol_generated.dart +++ b/pkg/analysis_server/lib/protocol/protocol_generated.dart @@ -8723,6 +8723,242 @@ class EditSortMembersResult implements ResponseResult { } } +/** + * ElementDeclaration + * + * { + * "name": String + * "kind": ElementKind + * "fileIndex": int + * "offset": int + * "line": int + * "column": int + * "className": optional String + * } + * + * Clients may not extend, implement or mix-in this class. + */ +class ElementDeclaration implements HasToJson { + String _name; + + ElementKind _kind; + + int _fileIndex; + + int _offset; + + int _line; + + int _column; + + String _className; + + /** + * The name of the declaration. + */ + String get name => _name; + + /** + * The name of the declaration. + */ + void set name(String value) { + assert(value != null); + this._name = value; + } + + /** + * The kind of the element that corresponds to the declaration. + */ + ElementKind get kind => _kind; + + /** + * The kind of the element that corresponds to the declaration. + */ + void set kind(ElementKind value) { + assert(value != null); + this._kind = value; + } + + /** + * The index of the file (in the enclosing response). + */ + int get fileIndex => _fileIndex; + + /** + * The index of the file (in the enclosing response). + */ + void set fileIndex(int value) { + assert(value != null); + this._fileIndex = value; + } + + /** + * The offset of the declaration name in the file. + */ + int get offset => _offset; + + /** + * The offset of the declaration name in the file. + */ + void set offset(int value) { + assert(value != null); + this._offset = value; + } + + /** + * The one-based index of the line containing the declaration name. + */ + int get line => _line; + + /** + * The one-based index of the line containing the declaration name. + */ + void set line(int value) { + assert(value != null); + this._line = value; + } + + /** + * The one-based index of the column containing the declaration name. + */ + int get column => _column; + + /** + * The one-based index of the column containing the declaration name. + */ + void set column(int value) { + assert(value != null); + this._column = value; + } + + /** + * The name of the class enclosing this declaration. If the declaration is + * not a class member, this field will be absent. + */ + String get className => _className; + + /** + * The name of the class enclosing this declaration. If the declaration is + * not a class member, this field will be absent. + */ + void set className(String value) { + this._className = value; + } + + ElementDeclaration(String name, ElementKind kind, int fileIndex, int offset, + int line, int column, + {String className}) { + this.name = name; + this.kind = kind; + this.fileIndex = fileIndex; + this.offset = offset; + this.line = line; + this.column = column; + this.className = className; + } + + factory ElementDeclaration.fromJson( + JsonDecoder jsonDecoder, String jsonPath, Object json) { + if (json == null) { + json = {}; + } + if (json is Map) { + String name; + if (json.containsKey("name")) { + name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]); + } else { + throw jsonDecoder.mismatch(jsonPath, "name"); + } + ElementKind kind; + if (json.containsKey("kind")) { + kind = new ElementKind.fromJson( + jsonDecoder, jsonPath + ".kind", json["kind"]); + } else { + throw jsonDecoder.mismatch(jsonPath, "kind"); + } + int fileIndex; + if (json.containsKey("fileIndex")) { + fileIndex = + jsonDecoder.decodeInt(jsonPath + ".fileIndex", json["fileIndex"]); + } else { + throw jsonDecoder.mismatch(jsonPath, "fileIndex"); + } + int offset; + if (json.containsKey("offset")) { + offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]); + } else { + throw jsonDecoder.mismatch(jsonPath, "offset"); + } + int line; + if (json.containsKey("line")) { + line = jsonDecoder.decodeInt(jsonPath + ".line", json["line"]); + } else { + throw jsonDecoder.mismatch(jsonPath, "line"); + } + int column; + if (json.containsKey("column")) { + column = jsonDecoder.decodeInt(jsonPath + ".column", json["column"]); + } else { + throw jsonDecoder.mismatch(jsonPath, "column"); + } + String className; + if (json.containsKey("className")) { + className = jsonDecoder.decodeString( + jsonPath + ".className", json["className"]); + } + return new ElementDeclaration(name, kind, fileIndex, offset, line, column, + className: className); + } else { + throw jsonDecoder.mismatch(jsonPath, "ElementDeclaration", json); + } + } + + @override + Map toJson() { + Map result = {}; + result["name"] = name; + result["kind"] = kind.toJson(); + result["fileIndex"] = fileIndex; + result["offset"] = offset; + result["line"] = line; + result["column"] = column; + if (className != null) { + result["className"] = className; + } + return result; + } + + @override + String toString() => JSON.encode(toJson()); + + @override + bool operator ==(other) { + if (other is ElementDeclaration) { + return name == other.name && + kind == other.kind && + fileIndex == other.fileIndex && + offset == other.offset && + line == other.line && + column == other.column && + className == other.className; + } + return false; + } + + @override + int get hashCode { + int hash = 0; + hash = JenkinsSmiHash.combine(hash, name.hashCode); + hash = JenkinsSmiHash.combine(hash, kind.hashCode); + hash = JenkinsSmiHash.combine(hash, fileIndex.hashCode); + hash = JenkinsSmiHash.combine(hash, offset.hashCode); + hash = JenkinsSmiHash.combine(hash, line.hashCode); + hash = JenkinsSmiHash.combine(hash, column.hashCode); + hash = JenkinsSmiHash.combine(hash, className.hashCode); + return JenkinsSmiHash.finish(hash); + } +} + /** * ExecutableFile * @@ -15062,6 +15298,154 @@ class SearchFindTopLevelDeclarationsResult implements ResponseResult { } } +/** + * search.getElementDeclarations params + * + * Clients may not extend, implement or mix-in this class. + */ +class SearchGetElementDeclarationsParams implements RequestParams { + @override + Map toJson() => {}; + + @override + Request toRequest(String id) { + return new Request(id, "search.getElementDeclarations", null); + } + + @override + bool operator ==(other) { + if (other is SearchGetElementDeclarationsParams) { + return true; + } + return false; + } + + @override + int get hashCode { + return 653510116; + } +} + +/** + * search.getElementDeclarations result + * + * { + * "declarations": List + * "files": List + * } + * + * Clients may not extend, implement or mix-in this class. + */ +class SearchGetElementDeclarationsResult implements ResponseResult { + List _declarations; + + List _files; + + /** + * The list of declarations. + */ + List get declarations => _declarations; + + /** + * The list of declarations. + */ + void set declarations(List value) { + assert(value != null); + this._declarations = value; + } + + /** + * The list of the paths of files with declarations. + */ + List get files => _files; + + /** + * The list of the paths of files with declarations. + */ + void set files(List value) { + assert(value != null); + this._files = value; + } + + SearchGetElementDeclarationsResult( + List declarations, List files) { + this.declarations = declarations; + this.files = files; + } + + factory SearchGetElementDeclarationsResult.fromJson( + JsonDecoder jsonDecoder, String jsonPath, Object json) { + if (json == null) { + json = {}; + } + if (json is Map) { + List declarations; + if (json.containsKey("declarations")) { + declarations = jsonDecoder.decodeList( + jsonPath + ".declarations", + json["declarations"], + (String jsonPath, Object json) => + new ElementDeclaration.fromJson(jsonDecoder, jsonPath, json)); + } else { + throw jsonDecoder.mismatch(jsonPath, "declarations"); + } + List files; + if (json.containsKey("files")) { + files = jsonDecoder.decodeList( + jsonPath + ".files", json["files"], jsonDecoder.decodeString); + } else { + throw jsonDecoder.mismatch(jsonPath, "files"); + } + return new SearchGetElementDeclarationsResult(declarations, files); + } else { + throw jsonDecoder.mismatch( + jsonPath, "search.getElementDeclarations result", json); + } + } + + factory SearchGetElementDeclarationsResult.fromResponse(Response response) { + return new SearchGetElementDeclarationsResult.fromJson( + new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), + "result", + response.result); + } + + @override + Map toJson() { + Map result = {}; + result["declarations"] = + declarations.map((ElementDeclaration value) => value.toJson()).toList(); + result["files"] = files; + return result; + } + + @override + Response toResponse(String id) { + return new Response(id, result: toJson()); + } + + @override + String toString() => JSON.encode(toJson()); + + @override + bool operator ==(other) { + if (other is SearchGetElementDeclarationsResult) { + return listEqual(declarations, other.declarations, + (ElementDeclaration a, ElementDeclaration b) => a == b) && + listEqual(files, other.files, (String a, String b) => a == b); + } + return false; + } + + @override + int get hashCode { + int hash = 0; + hash = JenkinsSmiHash.combine(hash, declarations.hashCode); + hash = JenkinsSmiHash.combine(hash, files.hashCode); + return JenkinsSmiHash.finish(hash); + } +} + /** * search.getTypeHierarchy params * diff --git a/pkg/analysis_server/test/integration/coverage.md b/pkg/analysis_server/test/integration/coverage.md index 108ef381a0a..8ab1806e16a 100644 --- a/pkg/analysis_server/test/integration/coverage.md +++ b/pkg/analysis_server/test/integration/coverage.md @@ -62,6 +62,7 @@ server calls. This file is validated by `coverage_test.dart`. - [x] search.findMemberDeclarations - [x] search.findMemberReferences - [x] search.findTopLevelDeclarations +- [ ] search.getElementDeclarations - [x] search.getTypeHierarchy - [ ] search.results diff --git a/pkg/analysis_server/test/integration/support/integration_test_methods.dart b/pkg/analysis_server/test/integration/support/integration_test_methods.dart index 46763b562f8..35eca2f1261 100644 --- a/pkg/analysis_server/test/integration/support/integration_test_methods.dart +++ b/pkg/analysis_server/test/integration/support/integration_test_methods.dart @@ -1196,6 +1196,27 @@ abstract class IntegrationTestMixin { decoder, 'result', result); } + /** + * Return top-level and class member declarations. + * + * Returns + * + * declarations: List + * + * The list of declarations. + * + * files: List + * + * The list of the paths of files with declarations. + */ + Future + sendSearchGetElementDeclarations() async { + var result = await server.send("search.getElementDeclarations", null); + ResponseDecoder decoder = new ResponseDecoder(null); + return new SearchGetElementDeclarationsResult.fromJson( + decoder, 'result', result); + } + /** * Return the type hierarchy of the class declared or referenced at the given * location. diff --git a/pkg/analysis_server/test/integration/support/protocol_matchers.dart b/pkg/analysis_server/test/integration/support/protocol_matchers.dart index 91b0f0da31e..38017870ccc 100644 --- a/pkg/analysis_server/test/integration/support/protocol_matchers.dart +++ b/pkg/analysis_server/test/integration/support/protocol_matchers.dart @@ -322,6 +322,31 @@ final Matcher isElement = "typeParameters": isString })); +/** + * ElementDeclaration + * + * { + * "name": String + * "kind": ElementKind + * "fileIndex": int + * "offset": int + * "line": int + * "column": int + * "className": optional String + * } + */ +final Matcher isElementDeclaration = + new LazyMatcher(() => new MatchesJsonObject("ElementDeclaration", { + "name": isString, + "kind": isElementKind, + "fileIndex": isInt, + "offset": isInt, + "line": isInt, + "column": isInt + }, optionalFields: { + "className": isString + })); + /** * ElementKind * @@ -2638,6 +2663,25 @@ final Matcher isSearchFindTopLevelDeclarationsResult = new LazyMatcher(() => new MatchesJsonObject( "search.findTopLevelDeclarations result", {"id": isSearchId})); +/** + * search.getElementDeclarations params + */ +final Matcher isSearchGetElementDeclarationsParams = isNull; + +/** + * search.getElementDeclarations result + * + * { + * "declarations": List + * "files": List + * } + */ +final Matcher isSearchGetElementDeclarationsResult = new LazyMatcher(() => + new MatchesJsonObject("search.getElementDeclarations result", { + "declarations": isListOf(isElementDeclaration), + "files": isListOf(isFilePath) + })); + /** * search.getTypeHierarchy params * diff --git a/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java b/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java index 7b4f4413ce6..1c3bc3bd1de 100644 --- a/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java +++ b/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java @@ -729,6 +729,13 @@ public interface AnalysisServer { */ public void search_findTopLevelDeclarations(String pattern, FindTopLevelDeclarationsConsumer consumer); + /** + * {@code search.getElementDeclarations} + * + * Return top-level and class member declarations. + */ + public void search_getElementDeclarations(GetElementDeclarationsConsumer consumer); + /** * {@code search.getTypeHierarchy} * diff --git a/pkg/analysis_server/tool/spec/generated/java/types/ElementDeclaration.java b/pkg/analysis_server/tool/spec/generated/java/types/ElementDeclaration.java new file mode 100644 index 00000000000..da38ec3e6cd --- /dev/null +++ b/pkg/analysis_server/tool/spec/generated/java/types/ElementDeclaration.java @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file + * for details. All rights reserved. Use of this source code is governed by a + * BSD-style license that can be found in the LICENSE file. + * + * This file has been automatically generated. Please do not edit it manually. + * To regenerate the file, use the script "pkg/analysis_server/tool/spec/generate_files". + */ +package org.dartlang.analysis.server.protocol; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import com.google.common.collect.Lists; +import com.google.dart.server.utilities.general.JsonUtilities; +import com.google.dart.server.utilities.general.ObjectUtilities; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.ArrayList; +import java.util.Iterator; +import org.apache.commons.lang3.StringUtils; + +/** + * A declaration - top-level (class, field, etc) or a class member (method, field, etc). + * + * @coverage dart.server.generated.types + */ +@SuppressWarnings("unused") +public class ElementDeclaration { + + public static final ElementDeclaration[] EMPTY_ARRAY = new ElementDeclaration[0]; + + public static final List EMPTY_LIST = Lists.newArrayList(); + + /** + * The name of the declaration. + */ + private final String name; + + /** + * The kind of the element that corresponds to the declaration. + */ + private final String kind; + + /** + * The index of the file (in the enclosing response). + */ + private final int fileIndex; + + /** + * The offset of the declaration name in the file. + */ + private final int offset; + + /** + * The one-based index of the line containing the declaration name. + */ + private final int line; + + /** + * The one-based index of the column containing the declaration name. + */ + private final int column; + + /** + * The name of the class enclosing this declaration. If the declaration is not a class member, this + * field will be absent. + */ + private final String className; + + /** + * Constructor for {@link ElementDeclaration}. + */ + public ElementDeclaration(String name, String kind, int fileIndex, int offset, int line, int column, String className) { + this.name = name; + this.kind = kind; + this.fileIndex = fileIndex; + this.offset = offset; + this.line = line; + this.column = column; + this.className = className; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof ElementDeclaration) { + ElementDeclaration other = (ElementDeclaration) obj; + return + ObjectUtilities.equals(other.name, name) && + ObjectUtilities.equals(other.kind, kind) && + other.fileIndex == fileIndex && + other.offset == offset && + other.line == line && + other.column == column && + ObjectUtilities.equals(other.className, className); + } + return false; + } + + public static ElementDeclaration fromJson(JsonObject jsonObject) { + String name = jsonObject.get("name").getAsString(); + String kind = jsonObject.get("kind").getAsString(); + int fileIndex = jsonObject.get("fileIndex").getAsInt(); + int offset = jsonObject.get("offset").getAsInt(); + int line = jsonObject.get("line").getAsInt(); + int column = jsonObject.get("column").getAsInt(); + String className = jsonObject.get("className") == null ? null : jsonObject.get("className").getAsString(); + return new ElementDeclaration(name, kind, fileIndex, offset, line, column, className); + } + + public static List fromJsonArray(JsonArray jsonArray) { + if (jsonArray == null) { + return EMPTY_LIST; + } + ArrayList list = new ArrayList(jsonArray.size()); + Iterator iterator = jsonArray.iterator(); + while (iterator.hasNext()) { + list.add(fromJson(iterator.next().getAsJsonObject())); + } + return list; + } + + /** + * The name of the class enclosing this declaration. If the declaration is not a class member, this + * field will be absent. + */ + public String getClassName() { + return className; + } + + /** + * The one-based index of the column containing the declaration name. + */ + public int getColumn() { + return column; + } + + /** + * The index of the file (in the enclosing response). + */ + public int getFileIndex() { + return fileIndex; + } + + /** + * The kind of the element that corresponds to the declaration. + */ + public String getKind() { + return kind; + } + + /** + * The one-based index of the line containing the declaration name. + */ + public int getLine() { + return line; + } + + /** + * The name of the declaration. + */ + public String getName() { + return name; + } + + /** + * The offset of the declaration name in the file. + */ + public int getOffset() { + return offset; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + builder.append(name); + builder.append(kind); + builder.append(fileIndex); + builder.append(offset); + builder.append(line); + builder.append(column); + builder.append(className); + return builder.toHashCode(); + } + + public JsonObject toJson() { + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty("name", name); + jsonObject.addProperty("kind", kind); + jsonObject.addProperty("fileIndex", fileIndex); + jsonObject.addProperty("offset", offset); + jsonObject.addProperty("line", line); + jsonObject.addProperty("column", column); + if (className != null) { + jsonObject.addProperty("className", className); + } + return jsonObject; + } + + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("["); + builder.append("name="); + builder.append(name + ", "); + builder.append("kind="); + builder.append(kind + ", "); + builder.append("fileIndex="); + builder.append(fileIndex + ", "); + builder.append("offset="); + builder.append(offset + ", "); + builder.append("line="); + builder.append(line + ", "); + builder.append("column="); + builder.append(column + ", "); + builder.append("className="); + builder.append(className); + builder.append("]"); + return builder.toString(); + } + +} diff --git a/pkg/analysis_server/tool/spec/spec_input.html b/pkg/analysis_server/tool/spec/spec_input.html index 09fcb67263b..e448ad210d4 100644 --- a/pkg/analysis_server/tool/spec/spec_input.html +++ b/pkg/analysis_server/tool/spec/spec_input.html @@ -1574,6 +1574,29 @@ + +

+ Return top-level and class member declarations. +

+ + + + ElementDeclaration + +

+ The list of declarations. +

+
+ + + FilePath + +

+ The list of the paths of files with declarations. +

+
+
+

Return the type hierarchy of the class declared or @@ -2880,6 +2903,57 @@ + +

+ A declaration - top-level (class, field, etc) or a class member (method, + field, etc). +

+ + + String +

+ The name of the declaration. +

+
+ + ElementKind +

+ The kind of the element that corresponds to the declaration. +

+
+ + int +

+ The index of the file (in the enclosing response). +

+
+ + int +

+ The offset of the declaration name in the file. +

+
+ + int +

+ The one-based index of the line containing the declaration name. +

+
+ + int +

+ The one-based index of the column containing the declaration name. +

+
+ + String +

+ The name of the class enclosing this declaration. If the declaration + is not a class member, this field will be absent. +

+
+
+

A description of an executable file.