getValidElementKinds() {
- return validElementKinds;
- }
-
- @Override
- public int hashCode() {
- HashCodeBuilder builder = new HashCodeBuilder();
- builder.append(lexeme);
- builder.append(type);
- builder.append(validElementKinds);
- builder.append(offset);
- return builder.toHashCode();
- }
-
- public JsonObject toJson() {
- JsonObject jsonObject = new JsonObject();
- jsonObject.addProperty("lexeme", lexeme);
- if (type != null) {
- jsonObject.addProperty("type", type);
- }
- if (validElementKinds != null) {
- JsonArray jsonArrayValidElementKinds = new JsonArray();
- for (String elt : validElementKinds) {
- jsonArrayValidElementKinds.add(new JsonPrimitive(elt));
- }
- jsonObject.add("validElementKinds", jsonArrayValidElementKinds);
- }
- jsonObject.addProperty("offset", offset);
- return jsonObject;
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("[");
- builder.append("lexeme=");
- builder.append(lexeme + ", ");
- builder.append("type=");
- builder.append(type + ", ");
- builder.append("validElementKinds=");
- builder.append(StringUtils.join(validElementKinds, ", ") + ", ");
- builder.append("offset=");
- builder.append(offset);
- 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 7d118eccaf1..536cad83d33 100644
--- a/pkg/analysis_server/tool/spec/spec_input.html
+++ b/pkg/analysis_server/tool/spec/spec_input.html
@@ -7,7 +7,7 @@
Analysis Server API Specification
Version
- 1.32.2
+ 1.32.3
This document contains a specification of the API provided by the
@@ -134,13 +134,20 @@
ignoring the item or treating it with some default/fallback handling.
Changelog
+1.32.3
+
+ Removed the experimental completion.listTokenDetails request and
+ the associated data types.
+
1.32.2
- Added FoldingKind.COMMENT for folding regions for blocks of comments.
+ Added FoldingKind.COMMENT for folding regions for blocks of
+ comments.
1.32.1
- Added CompletionSuggestionKind.PACKAGE_NAME for Pub package name completions in pubspec.yaml .
+ Added CompletionSuggestionKind.PACKAGE_NAME for Pub package name
+ completions in pubspec.yaml .
Domains
@@ -1520,32 +1527,6 @@
-
-
- Inspect analysis server's knowledge about all of a file's tokens including
- their lexeme, type, and what element kinds would have been appropriate for
- the token's program location.
-
-
-
- [FilePath]
-
- The path to the file from which tokens should be returned.
-
-
-
-
-
-
- [TokenDetails]
-
-
- A list of the file's scanned tokens including analysis information
- about them.
-
-
-
-
Reports the completion suggestions that should be presented
@@ -4222,44 +4203,6 @@
INTERFACE
-
-
- A scanned token along with its inferred type information.
-
-
-
- [String]
-
- The token's lexeme.
-
-
-
- [String]
-
- A unique id for the type of the identifier.
- Omitted if the token is not an identifier in a reference position.
-
-
-
-
- [String]
-
-
- An indication of whether this token is in a declaration or reference
- position. (If no other purpose is found for this field then it should
- be renamed and converted to a boolean value.)
- Omitted if the token is not an identifier.
-
-
-
- [int]
-
- The offset of the first character of the token in the file which it
- originated from.
-
-
-
-
An enumeration of the services provided by the execution
diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart
index 68ea10f4aff..ff997f0613a 100644
--- a/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart
+++ b/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart
@@ -6,7 +6,7 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
-const String PROTOCOL_VERSION = '1.32.2';
+const String PROTOCOL_VERSION = '1.32.3';
const String ANALYSIS_NOTIFICATION_ANALYZED_FILES = 'analysis.analyzedFiles';
const String ANALYSIS_NOTIFICATION_ANALYZED_FILES_DIRECTORIES = 'directories';
@@ -145,9 +145,6 @@ const String COMPLETION_REQUEST_GET_SUGGESTION_DETAILS_FILE = 'file';
const String COMPLETION_REQUEST_GET_SUGGESTION_DETAILS_ID = 'id';
const String COMPLETION_REQUEST_GET_SUGGESTION_DETAILS_LABEL = 'label';
const String COMPLETION_REQUEST_GET_SUGGESTION_DETAILS_OFFSET = 'offset';
-const String COMPLETION_REQUEST_LIST_TOKEN_DETAILS =
- 'completion.listTokenDetails';
-const String COMPLETION_REQUEST_LIST_TOKEN_DETAILS_FILE = 'file';
const String COMPLETION_REQUEST_REGISTER_LIBRARY_PATHS =
'completion.registerLibraryPaths';
const String COMPLETION_REQUEST_REGISTER_LIBRARY_PATHS_PATHS = 'paths';
@@ -159,7 +156,6 @@ const String COMPLETION_RESPONSE_GET_SUGGESTIONS_ID = 'id';
const String COMPLETION_RESPONSE_GET_SUGGESTION_DETAILS_CHANGE = 'change';
const String COMPLETION_RESPONSE_GET_SUGGESTION_DETAILS_COMPLETION =
'completion';
-const String COMPLETION_RESPONSE_LIST_TOKEN_DETAILS_TOKENS = 'tokens';
const String DIAGNOSTIC_REQUEST_GET_DIAGNOSTICS = 'diagnostic.getDiagnostics';
const String DIAGNOSTIC_REQUEST_GET_SERVER_PORT = 'diagnostic.getServerPort';
const String DIAGNOSTIC_RESPONSE_GET_DIAGNOSTICS_CONTEXTS = 'contexts';
diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart
index ca40968872d..e5dd041d4f0 100644
--- a/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart
+++ b/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart
@@ -5886,168 +5886,6 @@ class CompletionGetSuggestionsResult implements ResponseResult {
}
}
-/// completion.listTokenDetails params
-///
-/// {
-/// "file": FilePath
-/// }
-///
-/// Clients may not extend, implement or mix-in this class.
-class CompletionListTokenDetailsParams implements RequestParams {
- String _file;
-
- /// The path to the file from which tokens should be returned.
- String get file => _file;
-
- /// The path to the file from which tokens should be returned.
- set file(String value) {
- assert(value != null);
- _file = value;
- }
-
- CompletionListTokenDetailsParams(String file) {
- this.file = file;
- }
-
- factory CompletionListTokenDetailsParams.fromJson(
- JsonDecoder jsonDecoder, String jsonPath, Object json) {
- json ??= {};
- if (json is Map) {
- String file;
- if (json.containsKey('file')) {
- file = jsonDecoder.decodeString(jsonPath + '.file', json['file']);
- } else {
- throw jsonDecoder.mismatch(jsonPath, 'file');
- }
- return CompletionListTokenDetailsParams(file);
- } else {
- throw jsonDecoder.mismatch(
- jsonPath, 'completion.listTokenDetails params', json);
- }
- }
-
- factory CompletionListTokenDetailsParams.fromRequest(Request request) {
- return CompletionListTokenDetailsParams.fromJson(
- RequestDecoder(request), 'params', request.params);
- }
-
- @override
- Map toJson() {
- var result = {};
- result['file'] = file;
- return result;
- }
-
- @override
- Request toRequest(String id) {
- return Request(id, 'completion.listTokenDetails', toJson());
- }
-
- @override
- String toString() => json.encode(toJson());
-
- @override
- bool operator ==(other) {
- if (other is CompletionListTokenDetailsParams) {
- return file == other.file;
- }
- return false;
- }
-
- @override
- int get hashCode {
- var hash = 0;
- hash = JenkinsSmiHash.combine(hash, file.hashCode);
- return JenkinsSmiHash.finish(hash);
- }
-}
-
-/// completion.listTokenDetails result
-///
-/// {
-/// "tokens": List
-/// }
-///
-/// Clients may not extend, implement or mix-in this class.
-class CompletionListTokenDetailsResult implements ResponseResult {
- List _tokens;
-
- /// A list of the file's scanned tokens including analysis information about
- /// them.
- List get tokens => _tokens;
-
- /// A list of the file's scanned tokens including analysis information about
- /// them.
- set tokens(List value) {
- assert(value != null);
- _tokens = value;
- }
-
- CompletionListTokenDetailsResult(List tokens) {
- this.tokens = tokens;
- }
-
- factory CompletionListTokenDetailsResult.fromJson(
- JsonDecoder jsonDecoder, String jsonPath, Object json) {
- json ??= {};
- if (json is Map) {
- List tokens;
- if (json.containsKey('tokens')) {
- tokens = jsonDecoder.decodeList(
- jsonPath + '.tokens',
- json['tokens'],
- (String jsonPath, Object json) =>
- TokenDetails.fromJson(jsonDecoder, jsonPath, json));
- } else {
- throw jsonDecoder.mismatch(jsonPath, 'tokens');
- }
- return CompletionListTokenDetailsResult(tokens);
- } else {
- throw jsonDecoder.mismatch(
- jsonPath, 'completion.listTokenDetails result', json);
- }
- }
-
- factory CompletionListTokenDetailsResult.fromResponse(Response response) {
- return CompletionListTokenDetailsResult.fromJson(
- ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
- 'result',
- response.result);
- }
-
- @override
- Map toJson() {
- var result = {};
- result['tokens'] =
- tokens.map((TokenDetails value) => value.toJson()).toList();
- return result;
- }
-
- @override
- Response toResponse(String id) {
- return Response(id, result: toJson());
- }
-
- @override
- String toString() => json.encode(toJson());
-
- @override
- bool operator ==(other) {
- if (other is CompletionListTokenDetailsResult) {
- return listEqual(
- tokens, other.tokens, (TokenDetails a, TokenDetails b) => a == b);
- }
- return false;
- }
-
- @override
- int get hashCode {
- var hash = 0;
- hash = JenkinsSmiHash.combine(hash, tokens.hashCode);
- return JenkinsSmiHash.finish(hash);
- }
-}
-
/// completion.registerLibraryPaths params
///
/// {
@@ -21345,151 +21183,6 @@ class ServerStatusParams implements HasToJson {
}
}
-/// TokenDetails
-///
-/// {
-/// "lexeme": String
-/// "type": optional String
-/// "validElementKinds": optional List
-/// "offset": int
-/// }
-///
-/// Clients may not extend, implement or mix-in this class.
-class TokenDetails implements HasToJson {
- String _lexeme;
-
- String _type;
-
- List _validElementKinds;
-
- int _offset;
-
- /// The token's lexeme.
- String get lexeme => _lexeme;
-
- /// The token's lexeme.
- set lexeme(String value) {
- assert(value != null);
- _lexeme = value;
- }
-
- /// A unique id for the type of the identifier. Omitted if the token is not
- /// an identifier in a reference position.
- String get type => _type;
-
- /// A unique id for the type of the identifier. Omitted if the token is not
- /// an identifier in a reference position.
- set type(String value) {
- _type = value;
- }
-
- /// An indication of whether this token is in a declaration or reference
- /// position. (If no other purpose is found for this field then it should be
- /// renamed and converted to a boolean value.) Omitted if the token is not an
- /// identifier.
- List get validElementKinds => _validElementKinds;
-
- /// An indication of whether this token is in a declaration or reference
- /// position. (If no other purpose is found for this field then it should be
- /// renamed and converted to a boolean value.) Omitted if the token is not an
- /// identifier.
- set validElementKinds(List value) {
- _validElementKinds = value;
- }
-
- /// The offset of the first character of the token in the file which it
- /// originated from.
- int get offset => _offset;
-
- /// The offset of the first character of the token in the file which it
- /// originated from.
- set offset(int value) {
- assert(value != null);
- _offset = value;
- }
-
- TokenDetails(String lexeme, int offset,
- {String type, List validElementKinds}) {
- this.lexeme = lexeme;
- this.type = type;
- this.validElementKinds = validElementKinds;
- this.offset = offset;
- }
-
- factory TokenDetails.fromJson(
- JsonDecoder jsonDecoder, String jsonPath, Object json) {
- json ??= {};
- if (json is Map) {
- String lexeme;
- if (json.containsKey('lexeme')) {
- lexeme = jsonDecoder.decodeString(jsonPath + '.lexeme', json['lexeme']);
- } else {
- throw jsonDecoder.mismatch(jsonPath, 'lexeme');
- }
- String type;
- if (json.containsKey('type')) {
- type = jsonDecoder.decodeString(jsonPath + '.type', json['type']);
- }
- List validElementKinds;
- if (json.containsKey('validElementKinds')) {
- validElementKinds = jsonDecoder.decodeList(
- jsonPath + '.validElementKinds',
- json['validElementKinds'],
- jsonDecoder.decodeString);
- }
- int offset;
- if (json.containsKey('offset')) {
- offset = jsonDecoder.decodeInt(jsonPath + '.offset', json['offset']);
- } else {
- throw jsonDecoder.mismatch(jsonPath, 'offset');
- }
- return TokenDetails(lexeme, offset,
- type: type, validElementKinds: validElementKinds);
- } else {
- throw jsonDecoder.mismatch(jsonPath, 'TokenDetails', json);
- }
- }
-
- @override
- Map toJson() {
- var result = {};
- result['lexeme'] = lexeme;
- if (type != null) {
- result['type'] = type;
- }
- if (validElementKinds != null) {
- result['validElementKinds'] = validElementKinds;
- }
- result['offset'] = offset;
- return result;
- }
-
- @override
- String toString() => json.encode(toJson());
-
- @override
- bool operator ==(other) {
- if (other is TokenDetails) {
- return lexeme == other.lexeme &&
- type == other.type &&
- listEqual(validElementKinds, other.validElementKinds,
- (String a, String b) => a == b) &&
- offset == other.offset;
- }
- return false;
- }
-
- @override
- int get hashCode {
- var hash = 0;
- hash = JenkinsSmiHash.combine(hash, lexeme.hashCode);
- hash = JenkinsSmiHash.combine(hash, type.hashCode);
- hash = JenkinsSmiHash.combine(hash, validElementKinds.hashCode);
- hash = JenkinsSmiHash.combine(hash, offset.hashCode);
- return JenkinsSmiHash.finish(hash);
- }
-}
-
/// TypeHierarchyItem
///
/// {