diff --git a/pkg/analysis_server/lib/protocol/protocol_constants.dart b/pkg/analysis_server/lib/protocol/protocol_constants.dart
index 8f94cb67d51..861f7a60b3d 100644
--- a/pkg/analysis_server/lib/protocol/protocol_constants.dart
+++ b/pkg/analysis_server/lib/protocol/protocol_constants.dart
@@ -173,6 +173,7 @@ const String EDIT_REQUEST_DARTFIX_INCLUDE_PEDANTIC_FIXES =
const String EDIT_REQUEST_DARTFIX_INCLUDE_REQUIRED_FIXES =
'includeRequiredFixes';
const String EDIT_REQUEST_DARTFIX_OUTPUT_DIR = 'outputDir';
+const String EDIT_REQUEST_DARTFIX_PORT = 'port';
const String EDIT_REQUEST_FORMAT = 'edit.format';
const String EDIT_REQUEST_FORMAT_FILE = 'file';
const String EDIT_REQUEST_FORMAT_LINE_LENGTH = 'lineLength';
diff --git a/pkg/analysis_server/lib/protocol/protocol_generated.dart b/pkg/analysis_server/lib/protocol/protocol_generated.dart
index cdfb6c987e6..9e8e3356261 100644
--- a/pkg/analysis_server/lib/protocol/protocol_generated.dart
+++ b/pkg/analysis_server/lib/protocol/protocol_generated.dart
@@ -7964,6 +7964,7 @@ class DiagnosticGetServerPortResult implements ResponseResult {
* "includePedanticFixes": optional bool
* "includeRequiredFixes": optional bool
* "excludedFixes": optional List
+ * "port": optional int
* "outputDir": optional FilePath
* }
*
@@ -7980,6 +7981,8 @@ class EditDartfixParams implements RequestParams {
List _excludedFixes;
+ int _port;
+
String _outputDir;
/**
@@ -8069,6 +8072,20 @@ class EditDartfixParams implements RequestParams {
this._excludedFixes = value;
}
+ /**
+ * The port to be used to listen for and respond to http requests for preview
+ * pages.
+ */
+ int get port => _port;
+
+ /**
+ * The port to be used to listen for and respond to http requests for preview
+ * pages.
+ */
+ void set port(int value) {
+ this._port = value;
+ }
+
/**
* The absolute and normalized path to a directory to which non-nullability
* migration output will be written. The output is only produced if the
@@ -8092,12 +8109,14 @@ class EditDartfixParams implements RequestParams {
bool includePedanticFixes,
bool includeRequiredFixes,
List excludedFixes,
+ int port,
String outputDir}) {
this.included = included;
this.includedFixes = includedFixes;
this.includePedanticFixes = includePedanticFixes;
this.includeRequiredFixes = includeRequiredFixes;
this.excludedFixes = excludedFixes;
+ this.port = port;
this.outputDir = outputDir;
}
@@ -8134,6 +8153,10 @@ class EditDartfixParams implements RequestParams {
excludedFixes = jsonDecoder.decodeList(jsonPath + ".excludedFixes",
json["excludedFixes"], jsonDecoder.decodeString);
}
+ int port;
+ if (json.containsKey("port")) {
+ port = jsonDecoder.decodeInt(jsonPath + ".port", json["port"]);
+ }
String outputDir;
if (json.containsKey("outputDir")) {
outputDir = jsonDecoder.decodeString(
@@ -8144,6 +8167,7 @@ class EditDartfixParams implements RequestParams {
includePedanticFixes: includePedanticFixes,
includeRequiredFixes: includeRequiredFixes,
excludedFixes: excludedFixes,
+ port: port,
outputDir: outputDir);
} else {
throw jsonDecoder.mismatch(jsonPath, "edit.dartfix params", json);
@@ -8171,6 +8195,9 @@ class EditDartfixParams implements RequestParams {
if (excludedFixes != null) {
result["excludedFixes"] = excludedFixes;
}
+ if (port != null) {
+ result["port"] = port;
+ }
if (outputDir != null) {
result["outputDir"] = outputDir;
}
@@ -8196,6 +8223,7 @@ class EditDartfixParams implements RequestParams {
includeRequiredFixes == other.includeRequiredFixes &&
listEqual(excludedFixes, other.excludedFixes,
(String a, String b) => a == b) &&
+ port == other.port &&
outputDir == other.outputDir;
}
return false;
@@ -8209,6 +8237,7 @@ class EditDartfixParams implements RequestParams {
hash = JenkinsSmiHash.combine(hash, includePedanticFixes.hashCode);
hash = JenkinsSmiHash.combine(hash, includeRequiredFixes.hashCode);
hash = JenkinsSmiHash.combine(hash, excludedFixes.hashCode);
+ hash = JenkinsSmiHash.combine(hash, port.hashCode);
hash = JenkinsSmiHash.combine(hash, outputDir.hashCode);
return JenkinsSmiHash.finish(hash);
}
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 4e7db0fb210..7213f72d6e4 100644
--- a/pkg/analysis_server/test/integration/support/integration_test_methods.dart
+++ b/pkg/analysis_server/test/integration/support/integration_test_methods.dart
@@ -1769,6 +1769,11 @@ abstract class IntegrationTestMixin {
* If a name is specified that does not match the name of a known fix, an
* error of type UNKNOWN_FIX will be generated.
*
+ * port: int (optional)
+ *
+ * The port to be used to listen for and respond to http requests for
+ * preview pages.
+ *
* outputDir: FilePath (optional)
*
* The absolute and normalized path to a directory to which non-nullability
@@ -1810,12 +1815,14 @@ abstract class IntegrationTestMixin {
bool includePedanticFixes,
bool includeRequiredFixes,
List excludedFixes,
+ int port,
String outputDir}) async {
var params = new EditDartfixParams(included,
includedFixes: includedFixes,
includePedanticFixes: includePedanticFixes,
includeRequiredFixes: includeRequiredFixes,
excludedFixes: excludedFixes,
+ port: port,
outputDir: outputDir)
.toJson();
var result = await server.send("edit.dartfix", params);
diff --git a/pkg/analysis_server/test/integration/support/protocol_matchers.dart b/pkg/analysis_server/test/integration/support/protocol_matchers.dart
index 3b4a50a7f58..8b5bbf477e5 100644
--- a/pkg/analysis_server/test/integration/support/protocol_matchers.dart
+++ b/pkg/analysis_server/test/integration/support/protocol_matchers.dart
@@ -2561,6 +2561,7 @@ final Matcher isDiagnosticGetServerPortResult = new LazyMatcher(() =>
* "includePedanticFixes": optional bool
* "includeRequiredFixes": optional bool
* "excludedFixes": optional List
+ * "port": optional int
* "outputDir": optional FilePath
* }
*/
@@ -2572,6 +2573,7 @@ final Matcher isEditDartfixParams =
"includePedanticFixes": isBool,
"includeRequiredFixes": isBool,
"excludedFixes": isListOf(isString),
+ "port": isInt,
"outputDir": isFilePath
}));
diff --git a/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java b/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java
index f4e31708938..e2df2d385d3 100644
--- a/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java
+++ b/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java
@@ -498,12 +498,13 @@ public interface AnalysisServer {
* @param excludedFixes A list of names indicating which fixes should not be applied. If a name is
* specified that does not match the name of a known fix, an error of type UNKNOWN_FIX will
* be generated.
+ * @param port The port to be used to listen for and respond to http requests for preview pages.
* @param outputDir The absolute and normalized path to a directory to which non-nullability
* migration output will be written. The output is only produced if the non-nullable fix is
* included. Files in the directory might be overwritten, but no previously existing files
* will be deleted.
*/
- public void edit_dartfix(List included, List includedFixes, boolean includePedanticFixes, boolean includeRequiredFixes, List excludedFixes, String outputDir, DartfixConsumer consumer);
+ public void edit_dartfix(List included, List includedFixes, boolean includePedanticFixes, boolean includeRequiredFixes, List excludedFixes, int port, String outputDir, DartfixConsumer consumer);
/**
* {@code edit.format}
diff --git a/pkg/analysis_server/tool/spec/spec_input.html b/pkg/analysis_server/tool/spec/spec_input.html
index 5aa7335cb9a..5c210a8774a 100644
--- a/pkg/analysis_server/tool/spec/spec_input.html
+++ b/pkg/analysis_server/tool/spec/spec_input.html
@@ -2231,6 +2231,13 @@
an error of type UNKNOWN_FIX will be generated.
+
+ [int]
+
+ The port to be used to listen for and respond to http requests for
+ preview pages.
+
+
[FilePath]
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 8f94cb67d51..861f7a60b3d 100644
--- a/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart
+++ b/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart
@@ -173,6 +173,7 @@ const String EDIT_REQUEST_DARTFIX_INCLUDE_PEDANTIC_FIXES =
const String EDIT_REQUEST_DARTFIX_INCLUDE_REQUIRED_FIXES =
'includeRequiredFixes';
const String EDIT_REQUEST_DARTFIX_OUTPUT_DIR = 'outputDir';
+const String EDIT_REQUEST_DARTFIX_PORT = 'port';
const String EDIT_REQUEST_FORMAT = 'edit.format';
const String EDIT_REQUEST_FORMAT_FILE = 'file';
const String EDIT_REQUEST_FORMAT_LINE_LENGTH = 'lineLength';
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 7fd85967007..6431008e5ca 100644
--- a/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart
+++ b/pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart
@@ -7964,6 +7964,7 @@ class DiagnosticGetServerPortResult implements ResponseResult {
* "includePedanticFixes": optional bool
* "includeRequiredFixes": optional bool
* "excludedFixes": optional List
+ * "port": optional int
* "outputDir": optional FilePath
* }
*
@@ -7980,6 +7981,8 @@ class EditDartfixParams implements RequestParams {
List _excludedFixes;
+ int _port;
+
String _outputDir;
/**
@@ -8069,6 +8072,20 @@ class EditDartfixParams implements RequestParams {
this._excludedFixes = value;
}
+ /**
+ * The port to be used to listen for and respond to http requests for preview
+ * pages.
+ */
+ int get port => _port;
+
+ /**
+ * The port to be used to listen for and respond to http requests for preview
+ * pages.
+ */
+ void set port(int value) {
+ this._port = value;
+ }
+
/**
* The absolute and normalized path to a directory to which non-nullability
* migration output will be written. The output is only produced if the
@@ -8092,12 +8109,14 @@ class EditDartfixParams implements RequestParams {
bool includePedanticFixes,
bool includeRequiredFixes,
List excludedFixes,
+ int port,
String outputDir}) {
this.included = included;
this.includedFixes = includedFixes;
this.includePedanticFixes = includePedanticFixes;
this.includeRequiredFixes = includeRequiredFixes;
this.excludedFixes = excludedFixes;
+ this.port = port;
this.outputDir = outputDir;
}
@@ -8134,6 +8153,10 @@ class EditDartfixParams implements RequestParams {
excludedFixes = jsonDecoder.decodeList(jsonPath + ".excludedFixes",
json["excludedFixes"], jsonDecoder.decodeString);
}
+ int port;
+ if (json.containsKey("port")) {
+ port = jsonDecoder.decodeInt(jsonPath + ".port", json["port"]);
+ }
String outputDir;
if (json.containsKey("outputDir")) {
outputDir = jsonDecoder.decodeString(
@@ -8144,6 +8167,7 @@ class EditDartfixParams implements RequestParams {
includePedanticFixes: includePedanticFixes,
includeRequiredFixes: includeRequiredFixes,
excludedFixes: excludedFixes,
+ port: port,
outputDir: outputDir);
} else {
throw jsonDecoder.mismatch(jsonPath, "edit.dartfix params", json);
@@ -8171,6 +8195,9 @@ class EditDartfixParams implements RequestParams {
if (excludedFixes != null) {
result["excludedFixes"] = excludedFixes;
}
+ if (port != null) {
+ result["port"] = port;
+ }
if (outputDir != null) {
result["outputDir"] = outputDir;
}
@@ -8196,6 +8223,7 @@ class EditDartfixParams implements RequestParams {
includeRequiredFixes == other.includeRequiredFixes &&
listEqual(excludedFixes, other.excludedFixes,
(String a, String b) => a == b) &&
+ port == other.port &&
outputDir == other.outputDir;
}
return false;
@@ -8209,6 +8237,7 @@ class EditDartfixParams implements RequestParams {
hash = JenkinsSmiHash.combine(hash, includePedanticFixes.hashCode);
hash = JenkinsSmiHash.combine(hash, includeRequiredFixes.hashCode);
hash = JenkinsSmiHash.combine(hash, excludedFixes.hashCode);
+ hash = JenkinsSmiHash.combine(hash, port.hashCode);
hash = JenkinsSmiHash.combine(hash, outputDir.hashCode);
return JenkinsSmiHash.finish(hash);
}