Remove an unused request and the associated type

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2964113003 .
This commit is contained in:
Brian Wilkerson 2017-06-30 09:44:58 -07:00
parent 10fa170d66
commit 4749014b06
8 changed files with 2 additions and 578 deletions

File diff suppressed because one or more lines are too long

View file

@ -256,14 +256,6 @@ abstract class ServerPlugin {
}
}
/**
* Handle an 'analysis.setContextBuilderOptions' request.
*/
Future<AnalysisSetContextBuilderOptionsResult>
handleAnalysisSetContextBuilderOptions(
AnalysisSetContextBuilderOptionsParams parameters) async =>
null;
/**
* Handle an 'analysis.setContextRoots' request.
*/
@ -508,11 +500,6 @@ abstract class ServerPlugin {
var params = new AnalysisReanalyzeParams.fromRequest(request);
result = await handleAnalysisReanalyze(params);
break;
case ANALYSIS_REQUEST_SET_CONTEXT_BUILDER_OPTIONS:
var params =
new AnalysisSetContextBuilderOptionsParams.fromRequest(request);
result = await handleAnalysisSetContextBuilderOptions(params);
break;
case ANALYSIS_REQUEST_SET_CONTEXT_ROOTS:
var params = new AnalysisSetContextRootsParams.fromRequest(request);
result = await handleAnalysisSetContextRoots(params);

View file

@ -35,9 +35,6 @@ const String ANALYSIS_REQUEST_HANDLE_WATCH_EVENTS =
const String ANALYSIS_REQUEST_HANDLE_WATCH_EVENTS_EVENTS = 'events';
const String ANALYSIS_REQUEST_REANALYZE = 'analysis.reanalyze';
const String ANALYSIS_REQUEST_REANALYZE_ROOTS = 'roots';
const String ANALYSIS_REQUEST_SET_CONTEXT_BUILDER_OPTIONS =
'analysis.setContextBuilderOptions';
const String ANALYSIS_REQUEST_SET_CONTEXT_BUILDER_OPTIONS_OPTIONS = 'options';
const String ANALYSIS_REQUEST_SET_CONTEXT_ROOTS = 'analysis.setContextRoots';
const String ANALYSIS_REQUEST_SET_CONTEXT_ROOTS_ROOTS = 'roots';
const String ANALYSIS_REQUEST_SET_PRIORITY_FILES = 'analysis.setPriorityFiles';

View file

@ -1480,119 +1480,6 @@ class AnalysisService implements Enum {
String toJson() => name;
}
/**
* analysis.setContextBuilderOptions params
*
* {
* "options": ContextBuilderOptions
* }
*
* Clients may not extend, implement or mix-in this class.
*/
class AnalysisSetContextBuilderOptionsParams implements RequestParams {
ContextBuilderOptions _options;
/**
* The options used to build the analysis contexts.
*/
ContextBuilderOptions get options => _options;
/**
* The options used to build the analysis contexts.
*/
void set options(ContextBuilderOptions value) {
assert(value != null);
this._options = value;
}
AnalysisSetContextBuilderOptionsParams(ContextBuilderOptions options) {
this.options = options;
}
factory AnalysisSetContextBuilderOptionsParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
json = {};
}
if (json is Map) {
ContextBuilderOptions options;
if (json.containsKey("options")) {
options = new ContextBuilderOptions.fromJson(
jsonDecoder, jsonPath + ".options", json["options"]);
} else {
throw jsonDecoder.mismatch(jsonPath, "options");
}
return new AnalysisSetContextBuilderOptionsParams(options);
} else {
throw jsonDecoder.mismatch(
jsonPath, "analysis.setContextBuilderOptions params", json);
}
}
factory AnalysisSetContextBuilderOptionsParams.fromRequest(Request request) {
return new AnalysisSetContextBuilderOptionsParams.fromJson(
new RequestDecoder(request), "params", request.params);
}
@override
Map<String, dynamic> toJson() {
Map<String, dynamic> result = {};
result["options"] = options.toJson();
return result;
}
@override
Request toRequest(String id) {
return new Request(id, "analysis.setContextBuilderOptions", toJson());
}
@override
String toString() => JSON.encode(toJson());
@override
bool operator ==(other) {
if (other is AnalysisSetContextBuilderOptionsParams) {
return options == other.options;
}
return false;
}
@override
int get hashCode {
int hash = 0;
hash = JenkinsSmiHash.combine(hash, options.hashCode);
return JenkinsSmiHash.finish(hash);
}
}
/**
* analysis.setContextBuilderOptions result
*
* Clients may not extend, implement or mix-in this class.
*/
class AnalysisSetContextBuilderOptionsResult implements ResponseResult {
@override
Map<String, dynamic> toJson() => <String, dynamic>{};
@override
Response toResponse(String id, int requestTime) {
return new Response(id, requestTime, result: null);
}
@override
bool operator ==(other) {
if (other is AnalysisSetContextBuilderOptionsResult) {
return true;
}
return false;
}
@override
int get hashCode {
return 645412314;
}
}
/**
* analysis.setContextRoots params
*
@ -2350,231 +2237,6 @@ class CompletionGetSuggestionsResult implements ResponseResult {
}
}
/**
* ContextBuilderOptions
*
* {
* "dartSdkSummaryPath": optional FilePath
* "defaultAnalysisOptionsFilePath": optional List<FilePath>
* "declaredVariables": optional Map<String, String>
* "defaultPackageFilePath": optional List<FilePath>
* "defaultPackagesDirectoryPath": optional List<FilePath>
* }
*
* Clients may not extend, implement or mix-in this class.
*/
class ContextBuilderOptions implements HasToJson {
String _dartSdkSummaryPath;
List<String> _defaultAnalysisOptionsFilePath;
Map<String, String> _declaredVariables;
List<String> _defaultPackageFilePath;
List<String> _defaultPackagesDirectoryPath;
/**
* The file path of the file containing the summary of the SDK that should be
* used to "analyze" the SDK. The field will be omitted if the summary should
* be found in the SDK.
*/
String get dartSdkSummaryPath => _dartSdkSummaryPath;
/**
* The file path of the file containing the summary of the SDK that should be
* used to "analyze" the SDK. The field will be omitted if the summary should
* be found in the SDK.
*/
void set dartSdkSummaryPath(String value) {
this._dartSdkSummaryPath = value;
}
/**
* The file path of the analysis options file that should be used in place of
* any file in the root directory or a parent of the root directory. The
* field will be omitted if the normal lookup mechanism should be used.
*/
List<String> get defaultAnalysisOptionsFilePath =>
_defaultAnalysisOptionsFilePath;
/**
* The file path of the analysis options file that should be used in place of
* any file in the root directory or a parent of the root directory. The
* field will be omitted if the normal lookup mechanism should be used.
*/
void set defaultAnalysisOptionsFilePath(List<String> value) {
this._defaultAnalysisOptionsFilePath = value;
}
/**
* A table mapping variable names to values for the declared variables. The
* field will be omitted if no additional variables need to be declared.
*/
Map<String, String> get declaredVariables => _declaredVariables;
/**
* A table mapping variable names to values for the declared variables. The
* field will be omitted if no additional variables need to be declared.
*/
void set declaredVariables(Map<String, String> value) {
this._declaredVariables = value;
}
/**
* The file path of the .packages file that should be used in place of any
* file found using the normal (Package Specification DEP) lookup mechanism.
* The field will be omitted if the normal lookup mechanism should be used.
*/
List<String> get defaultPackageFilePath => _defaultPackageFilePath;
/**
* The file path of the .packages file that should be used in place of any
* file found using the normal (Package Specification DEP) lookup mechanism.
* The field will be omitted if the normal lookup mechanism should be used.
*/
void set defaultPackageFilePath(List<String> value) {
this._defaultPackageFilePath = value;
}
/**
* The file path of the packages directory that should be used in place of
* any file found using the normal (Package Specification DEP) lookup
* mechanism. The field will be omitted if the normal lookup mechanism should
* be used.
*/
List<String> get defaultPackagesDirectoryPath =>
_defaultPackagesDirectoryPath;
/**
* The file path of the packages directory that should be used in place of
* any file found using the normal (Package Specification DEP) lookup
* mechanism. The field will be omitted if the normal lookup mechanism should
* be used.
*/
void set defaultPackagesDirectoryPath(List<String> value) {
this._defaultPackagesDirectoryPath = value;
}
ContextBuilderOptions(
{String dartSdkSummaryPath,
List<String> defaultAnalysisOptionsFilePath,
Map<String, String> declaredVariables,
List<String> defaultPackageFilePath,
List<String> defaultPackagesDirectoryPath}) {
this.dartSdkSummaryPath = dartSdkSummaryPath;
this.defaultAnalysisOptionsFilePath = defaultAnalysisOptionsFilePath;
this.declaredVariables = declaredVariables;
this.defaultPackageFilePath = defaultPackageFilePath;
this.defaultPackagesDirectoryPath = defaultPackagesDirectoryPath;
}
factory ContextBuilderOptions.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object json) {
if (json == null) {
json = {};
}
if (json is Map) {
String dartSdkSummaryPath;
if (json.containsKey("dartSdkSummaryPath")) {
dartSdkSummaryPath = jsonDecoder.decodeString(
jsonPath + ".dartSdkSummaryPath", json["dartSdkSummaryPath"]);
}
List<String> defaultAnalysisOptionsFilePath;
if (json.containsKey("defaultAnalysisOptionsFilePath")) {
defaultAnalysisOptionsFilePath = jsonDecoder.decodeList(
jsonPath + ".defaultAnalysisOptionsFilePath",
json["defaultAnalysisOptionsFilePath"],
jsonDecoder.decodeString);
}
Map<String, String> declaredVariables;
if (json.containsKey("declaredVariables")) {
declaredVariables = jsonDecoder.decodeMap(
jsonPath + ".declaredVariables", json["declaredVariables"],
valueDecoder: jsonDecoder.decodeString);
}
List<String> defaultPackageFilePath;
if (json.containsKey("defaultPackageFilePath")) {
defaultPackageFilePath = jsonDecoder.decodeList(
jsonPath + ".defaultPackageFilePath",
json["defaultPackageFilePath"],
jsonDecoder.decodeString);
}
List<String> defaultPackagesDirectoryPath;
if (json.containsKey("defaultPackagesDirectoryPath")) {
defaultPackagesDirectoryPath = jsonDecoder.decodeList(
jsonPath + ".defaultPackagesDirectoryPath",
json["defaultPackagesDirectoryPath"],
jsonDecoder.decodeString);
}
return new ContextBuilderOptions(
dartSdkSummaryPath: dartSdkSummaryPath,
defaultAnalysisOptionsFilePath: defaultAnalysisOptionsFilePath,
declaredVariables: declaredVariables,
defaultPackageFilePath: defaultPackageFilePath,
defaultPackagesDirectoryPath: defaultPackagesDirectoryPath);
} else {
throw jsonDecoder.mismatch(jsonPath, "ContextBuilderOptions", json);
}
}
@override
Map<String, dynamic> toJson() {
Map<String, dynamic> result = {};
if (dartSdkSummaryPath != null) {
result["dartSdkSummaryPath"] = dartSdkSummaryPath;
}
if (defaultAnalysisOptionsFilePath != null) {
result["defaultAnalysisOptionsFilePath"] = defaultAnalysisOptionsFilePath;
}
if (declaredVariables != null) {
result["declaredVariables"] = declaredVariables;
}
if (defaultPackageFilePath != null) {
result["defaultPackageFilePath"] = defaultPackageFilePath;
}
if (defaultPackagesDirectoryPath != null) {
result["defaultPackagesDirectoryPath"] = defaultPackagesDirectoryPath;
}
return result;
}
@override
String toString() => JSON.encode(toJson());
@override
bool operator ==(other) {
if (other is ContextBuilderOptions) {
return dartSdkSummaryPath == other.dartSdkSummaryPath &&
listEqual(
defaultAnalysisOptionsFilePath,
other.defaultAnalysisOptionsFilePath,
(String a, String b) => a == b) &&
mapEqual(declaredVariables, other.declaredVariables,
(String a, String b) => a == b) &&
listEqual(defaultPackageFilePath, other.defaultPackageFilePath,
(String a, String b) => a == b) &&
listEqual(
defaultPackagesDirectoryPath,
other.defaultPackagesDirectoryPath,
(String a, String b) => a == b);
}
return false;
}
@override
int get hashCode {
int hash = 0;
hash = JenkinsSmiHash.combine(hash, dartSdkSummaryPath.hashCode);
hash =
JenkinsSmiHash.combine(hash, defaultAnalysisOptionsFilePath.hashCode);
hash = JenkinsSmiHash.combine(hash, declaredVariables.hashCode);
hash = JenkinsSmiHash.combine(hash, defaultPackageFilePath.hashCode);
hash = JenkinsSmiHash.combine(hash, defaultPackagesDirectoryPath.hashCode);
return JenkinsSmiHash.finish(hash);
}
}
/**
* ContextRoot
*

View file

@ -225,24 +225,6 @@ abstract class IntegrationTestMixin {
return null;
}
/**
* Used to set the options used to build analysis contexts. This request will
* be sent exactly once before any context roots have been specified.
*
* Parameters
*
* options: ContextBuilderOptions
*
* The options used to build the analysis contexts.
*/
Future sendAnalysisSetContextBuilderOptions(
ContextBuilderOptions options) async {
var params = new AnalysisSetContextBuilderOptionsParams(options).toJson();
var result = await server.send("analysis.setContextBuilderOptions", params);
outOfTestExpect(result, isNull);
return null;
}
/**
* Set the list of context roots that should be analyzed.
*

View file

@ -205,26 +205,6 @@ final Matcher isCompletionSuggestionKind =
"PARAMETER"
]);
/**
* ContextBuilderOptions
*
* {
* "dartSdkSummaryPath": optional FilePath
* "defaultAnalysisOptionsFilePath": optional List<FilePath>
* "declaredVariables": optional Map<String, String>
* "defaultPackageFilePath": optional List<FilePath>
* "defaultPackagesDirectoryPath": optional List<FilePath>
* }
*/
final Matcher isContextBuilderOptions = new LazyMatcher(
() => new MatchesJsonObject("ContextBuilderOptions", null, optionalFields: {
"dartSdkSummaryPath": isFilePath,
"defaultAnalysisOptionsFilePath": isListOf(isFilePath),
"declaredVariables": isMapOf(isString, isString),
"defaultPackageFilePath": isListOf(isFilePath),
"defaultPackagesDirectoryPath": isListOf(isFilePath)
}));
/**
* ContextRoot
*
@ -1024,22 +1004,6 @@ final Matcher isAnalysisReanalyzeParams = new LazyMatcher(() =>
*/
final Matcher isAnalysisReanalyzeResult = isNull;
/**
* analysis.setContextBuilderOptions params
*
* {
* "options": ContextBuilderOptions
* }
*/
final Matcher isAnalysisSetContextBuilderOptionsParams = new LazyMatcher(() =>
new MatchesJsonObject("analysis.setContextBuilderOptions params",
{"options": isContextBuilderOptions}));
/**
* analysis.setContextBuilderOptions result
*/
final Matcher isAnalysisSetContextBuilderOptionsResult = isNull;
/**
* analysis.setContextRoots params
*

View file

@ -100,14 +100,6 @@ class ServerPluginTest {
expect(result, isNotNull);
}
@failingTest
test_handleAnalysisSetContextBuilderOptions() async {
var result = await plugin.handleAnalysisSetContextBuilderOptions(
new AnalysisSetContextBuilderOptionsParams(
new ContextBuilderOptions()));
expect(result, isNotNull);
}
test_handleAnalysisSetContextRoots() async {
var result = await plugin.handleAnalysisSetContextRoots(
new AnalysisSetContextRootsParams([contextRoot1]));
@ -295,13 +287,6 @@ class ServerPluginTest {
expect(result, isNotNull);
}
test_onRequest_analysisSetContextBuilderOptions() async {
var result = await channel.sendRequest(
new AnalysisSetContextBuilderOptionsParams(
new ContextBuilderOptions()));
expect(result, isNotNull);
}
test_onRequest_analysisSetContextRoots() async {
var result = await channel
.sendRequest(new AnalysisSetContextRootsParams([contextRoot1]));

View file

@ -259,20 +259,6 @@
</field>
</params>
</request>
<request method="setContextBuilderOptions">
<p>
Used to set the options used to build analysis contexts. This request will
be sent exactly once before any context roots have been specified.
</p>
<params>
<field name="options">
<ref>ContextBuilderOptions</ref>
<p>
The options used to build the analysis contexts.
</p>
</field>
</params>
</request>
<request method="setContextRoots">
<p>
Set the list of context roots that should be analyzed.
@ -907,80 +893,6 @@
<value><code>OUTLINE</code></value>
</enum>
</type>
<type name="ContextBuilderOptions">
<p>
The options used to build an analysis context.
</p>
<object>
<field name="dartSdkSummaryPath" optional="true">
<ref>FilePath</ref>
<p>
The file path of the file containing the summary of the SDK that
should be used to "analyze" the SDK. The field will be omitted if the
summary should be found in the SDK.
</p>
</field>
<field name="defaultAnalysisOptionsFilePath" optional="true">
<list>
<ref>FilePath</ref>
</list>
<p>
The file path of the analysis options file that should be used in
place of any file in the root directory or a parent of the root
directory. The field will be omitted if the normal lookup mechanism
should be used.
</p>
</field>
<field name="declaredVariables" optional="true">
<map>
<key>
<ref>String</ref>
</key>
<value>
<ref>String</ref>
</value>
</map>
<p>
A table mapping variable names to values for the declared variables.
The field will be omitted if no additional variables need to be
declared.
</p>
</field>
<!--
TODO(brianwilkerson) Figure out how to handle analysis options.
<field name="defaultOptions" optional="true">
<ref>AnalysisOptions</ref>
<p>
The default analysis options that should be used unless some or all of
them are overridden in the analysis options file. The field will be
omitted if the default defaults should be used.
</p>
</field>
-->
<field name="defaultPackageFilePath" optional="true">
<list>
<ref>FilePath</ref>
</list>
<p>
The file path of the .packages file that should be used in place of
any file found using the normal (Package Specification DEP) lookup
mechanism. The field will be omitted if the normal lookup mechanism
should be used.
</p>
</field>
<field name="defaultPackagesDirectoryPath" optional="true">
<list>
<ref>FilePath</ref>
</list>
<p>
The file path of the packages directory that should be used in place
of any file found using the normal (Package Specification DEP) lookup
mechanism. The field will be omitted if the normal lookup mechanism
should be used.
</p>
</field>
</object>
</type>
<type name="ContextRoot">
<p>
A description of an analysis context.