diff --git a/pkg/analysis_server/doc/api.html b/pkg/analysis_server/doc/api.html index bc2d1b1d455..9756879c7a5 100644 --- a/pkg/analysis_server/doc/api.html +++ b/pkg/analysis_server/doc/api.html @@ -143,9 +143,9 @@ a:focus, a:hover { To ease interoperability with Lisp-based clients (which may not be able to easily distinguish between empty lists, empty maps, and null), client-to-server communication is allowed to replace - any instance of "{}" or "[]" with null. The + any instance of “{}” or “[]” with null. The server will always properly represent empty lists as - "[]" and empty maps as "{}". + “[]” and empty maps as “{}”.

Communication Structure

@@ -2062,7 +2062,7 @@ a:focus, a:hover { structure of the data is dependent on the kind of refactoring being performed. The data that is expected is documented in the section titled Refactorings, labeled as - "Options". This field can be omitted if the refactoring + “Options”. This field can be omitted if the refactoring does not require any options or if the values of those options are not known.

@@ -2096,7 +2096,7 @@ a:focus, a:hover { of the data is dependent on the kind of refactoring being created. The data that is returned is documented in the section titled Refactorings, labeled as - "Feedback". + “Feedback”.

change (optional SourceChange)
@@ -2349,10 +2349,6 @@ a:focus, a:hover { "id": String "error": optional RequestError } -

- Deprecated: the analysis server no longer fires - LAUNCH_DATA events. -

Subscribe for services. All previous subscriptions are replaced by the given set of services. @@ -3314,8 +3310,8 @@ a:focus, a:hover {

A human-readable description of the kind of element being - referenced (such as "class" or "function type - alias"). This data is omitted if there is no referenced + referenced (such as “class” or “function type + alias”). This data is omitted if there is no referenced element.

isDeprecated (optional bool)
@@ -4509,8 +4505,8 @@ a:focus, a:hover {

The human-readable description of the kind of element being - renamed (such as "class" or "function type - alias"). + renamed (such as “class” or “function type + alias”).

oldName (String)
diff --git a/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart b/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart index f3c299d7035..59b76b03c14 100644 --- a/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart +++ b/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart @@ -6227,7 +6227,7 @@ class EditGetRefactoringParams implements HasToJson { * Data used to provide values provided by the user. The structure of the * data is dependent on the kind of refactoring being performed. The data * that is expected is documented in the section titled Refactorings, labeled - * as "Options". This field can be omitted if the refactoring does not + * as “Options”. This field can be omitted if the refactoring does not * require any options or if the values of those options are not known. */ RefactoringOptions get options => _options; @@ -6236,7 +6236,7 @@ class EditGetRefactoringParams implements HasToJson { * Data used to provide values provided by the user. The structure of the * data is dependent on the kind of refactoring being performed. The data * that is expected is documented in the section titled Refactorings, labeled - * as "Options". This field can be omitted if the refactoring does not + * as “Options”. This field can be omitted if the refactoring does not * require any options or if the values of those options are not known. */ void set options(RefactoringOptions value) { @@ -6432,7 +6432,7 @@ class EditGetRefactoringResult implements HasToJson { * Data used to provide feedback to the user. The structure of the data is * dependent on the kind of refactoring being created. The data that is * returned is documented in the section titled Refactorings, labeled as - * "Feedback". + * “Feedback”. */ RefactoringFeedback get feedback => _feedback; @@ -6440,7 +6440,7 @@ class EditGetRefactoringResult implements HasToJson { * Data used to provide feedback to the user. The structure of the data is * dependent on the kind of refactoring being created. The data that is * returned is documented in the section titled Refactorings, labeled as - * "Feedback". + * “Feedback”. */ void set feedback(RefactoringFeedback value) { this._feedback = value; @@ -11571,14 +11571,14 @@ class HoverInformation implements HasToJson { /** * A human-readable description of the kind of element being referenced (such - * as "class" or "function type alias"). This data is omitted if there is no + * as “class” or “function type alias”). This data is omitted if there is no * referenced element. */ String get elementKind => _elementKind; /** * A human-readable description of the kind of element being referenced (such - * as "class" or "function type alias"). This data is omitted if there is no + * as “class” or “function type alias”). This data is omitted if there is no * referenced element. */ void set elementKind(String value) { @@ -16976,13 +16976,13 @@ class RenameFeedback extends RefactoringFeedback { /** * The human-readable description of the kind of element being renamed (such - * as "class" or "function type alias"). + * as “class” or “function type alias”). */ String get elementKindName => _elementKindName; /** * The human-readable description of the kind of element being renamed (such - * as "class" or "function type alias"). + * as “class” or “function type alias”). */ void set elementKindName(String value) { assert(value != null); diff --git a/pkg/analysis_server/lib/src/domain_execution.dart b/pkg/analysis_server/lib/src/domain_execution.dart index 6b507c3a5f7..29449c5b3fa 100644 --- a/pkg/analysis_server/lib/src/domain_execution.dart +++ b/pkg/analysis_server/lib/src/domain_execution.dart @@ -159,24 +159,20 @@ class ExecutionDomainHandler implements RequestHandler { * Implement the 'execution.setSubscriptions' request. */ Response setSubscriptions(Request request) { - if (server.options.enableNewAnalysisDriver) { - return new ExecutionSetSubscriptionsResult().toResponse(request.id); - } else { - List subscriptions = - new ExecutionSetSubscriptionsParams.fromRequest(request).subscriptions; - if (subscriptions.contains(ExecutionService.LAUNCH_DATA)) { - if (onFileAnalyzed == null) { - onFileAnalyzed = server.onFileAnalyzed.listen(_fileAnalyzed); - _reportCurrentFileStatus(); - } - } else { - if (onFileAnalyzed != null) { - onFileAnalyzed.cancel(); - onFileAnalyzed = null; - } + List subscriptions = + new ExecutionSetSubscriptionsParams.fromRequest(request).subscriptions; + if (subscriptions.contains(ExecutionService.LAUNCH_DATA)) { + if (onFileAnalyzed == null) { + onFileAnalyzed = server.onFileAnalyzed.listen(_fileAnalyzed); + _reportCurrentFileStatus(); + } + } else { + if (onFileAnalyzed != null) { + onFileAnalyzed.cancel(); + onFileAnalyzed = null; } - return new ExecutionSetSubscriptionsResult().toResponse(request.id); } + return new ExecutionSetSubscriptionsResult().toResponse(request.id); } void _fileAnalyzed(ChangeNotice notice) { diff --git a/pkg/analysis_server/test/integration/execution/set_subscriptions_test.dart b/pkg/analysis_server/test/integration/execution/set_subscriptions_test.dart index fe7d3945e63..fcd4189926c 100644 --- a/pkg/analysis_server/test/integration/execution/set_subscriptions_test.dart +++ b/pkg/analysis_server/test/integration/execution/set_subscriptions_test.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'package:analysis_server/plugin/protocol/protocol.dart'; +import 'package:test/test.dart'; import 'package:test_reflective_loader/test_reflective_loader.dart'; import '../integration_tests.dart'; @@ -15,9 +16,23 @@ main() { @reflectiveTest class SetSubscriptionsTest extends AbstractAnalysisServerIntegrationTest { + // Bad state: Should not be used with the new analysis driver (#28806) + @failingTest test_subscribe() async { + writeFile(sourcePath('.packages'), 'foo:lib/'); standardAnalysisSetup(); await sendExecutionSetSubscriptions([ExecutionService.LAUNCH_DATA]); + + String contextId = + (await sendExecutionCreateContext(sourceDirectory.path)).id; + expect(contextId, isNotNull); + + String pathname = sourcePath('lib/main.dart'); + writeFile(pathname, 'void main() {}'); + + ExecutionLaunchDataParams data = await onExecutionLaunchData.first; + expect(data.kind, ExecutableKind.SERVER); + expect(data.file, pathname); } @override diff --git a/pkg/analysis_server/test/integration/integration_test_methods.dart b/pkg/analysis_server/test/integration/integration_test_methods.dart index 446d9d9664d..14251bba346 100644 --- a/pkg/analysis_server/test/integration/integration_test_methods.dart +++ b/pkg/analysis_server/test/integration/integration_test_methods.dart @@ -1348,7 +1348,7 @@ abstract class IntegrationTestMixin { * Data used to provide values provided by the user. The structure of the * data is dependent on the kind of refactoring being performed. The data * that is expected is documented in the section titled Refactorings, - * labeled as "Options". This field can be omitted if the refactoring does + * labeled as “Options”. This field can be omitted if the refactoring does * not require any options or if the values of those options are not known. * * Returns @@ -1376,7 +1376,7 @@ abstract class IntegrationTestMixin { * Data used to provide feedback to the user. The structure of the data is * dependent on the kind of refactoring being created. The data that is * returned is documented in the section titled Refactorings, labeled as - * "Feedback". + * “Feedback”. * * change (optional SourceChange) * @@ -1563,8 +1563,6 @@ abstract class IntegrationTestMixin { } /** - * Deprecated: the analysis server no longer fires LAUNCH_DATA events. - * * Subscribe for services. All previous subscriptions are replaced by the * given set of services. * diff --git a/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java b/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java index 67bce36ba9d..99e5ac09d34 100644 --- a/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java +++ b/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java @@ -378,7 +378,7 @@ public interface AnalysisServer { * validated and no change be generated. * @param options Data used to provide values provided by the user. The structure of the data is * dependent on the kind of refactoring being performed. The data that is expected is - * documented in the section titled Refactorings, labeled as "Options". This field can be + * documented in the section titled Refactorings, labeled as “Options”. This field can be * omitted if the refactoring does not require any options or if the values of those * options are not known. */ @@ -467,8 +467,6 @@ public interface AnalysisServer { /** * {@code execution.setSubscriptions} * - * Deprecated: the analysis server no longer fires LAUNCH_DATA events. - * * Subscribe for services. All previous subscriptions are replaced by the given set of services. * * It is an error if any of the elements in the list are not valid services. If there is an error, diff --git a/pkg/analysis_server/tool/spec/generated/java/types/HoverInformation.java b/pkg/analysis_server/tool/spec/generated/java/types/HoverInformation.java index b9ca9819825..d1dd58d24db 100644 --- a/pkg/analysis_server/tool/spec/generated/java/types/HoverInformation.java +++ b/pkg/analysis_server/tool/spec/generated/java/types/HoverInformation.java @@ -89,8 +89,8 @@ public class HoverInformation { private final String elementDescription; /** - * A human-readable description of the kind of element being referenced (such as "class" or - * "function type alias"). This data is omitted if there is no referenced element. + * A human-readable description of the kind of element being referenced (such as “class” or + * “function type alias”). This data is omitted if there is no referenced element. */ private final String elementKind; @@ -228,8 +228,8 @@ public class HoverInformation { } /** - * A human-readable description of the kind of element being referenced (such as "class" or - * "function type alias"). This data is omitted if there is no referenced element. + * A human-readable description of the kind of element being referenced (such as “class” or + * “function type alias”). This data is omitted if there is no referenced element. */ public String getElementKind() { return elementKind; diff --git a/pkg/analysis_server/tool/spec/generated/java/types/RenameFeedback.java b/pkg/analysis_server/tool/spec/generated/java/types/RenameFeedback.java index c10021ff74e..35dacffe8f2 100644 --- a/pkg/analysis_server/tool/spec/generated/java/types/RenameFeedback.java +++ b/pkg/analysis_server/tool/spec/generated/java/types/RenameFeedback.java @@ -52,8 +52,8 @@ public class RenameFeedback extends RefactoringFeedback { private final int length; /** - * The human-readable description of the kind of element being renamed (such as "class" or - * "function type alias"). + * The human-readable description of the kind of element being renamed (such as “class” or + * “function type alias”). */ private final String elementKindName; @@ -106,8 +106,8 @@ public class RenameFeedback extends RefactoringFeedback { } /** - * The human-readable description of the kind of element being renamed (such as "class" or - * "function type alias"). + * The human-readable description of the kind of element being renamed (such as “class” or + * “function type alias”). */ public String getElementKindName() { return elementKindName; diff --git a/pkg/analysis_server/tool/spec/spec_input.html b/pkg/analysis_server/tool/spec/spec_input.html index c88edaa6145..2297a33eafb 100644 --- a/pkg/analysis_server/tool/spec/spec_input.html +++ b/pkg/analysis_server/tool/spec/spec_input.html @@ -41,9 +41,9 @@ To ease interoperability with Lisp-based clients (which may not be able to easily distinguish between empty lists, empty maps, and null), client-to-server communication is allowed to replace - any instance of "{}" or "[]" with null. The + any instance of “{}” or “[]” with null. The server will always properly represent empty lists as - "[]" and empty maps as "{}". + “[]” and empty maps as “{}”.

Communication Structure

@@ -1733,7 +1733,7 @@ refactoring being performed. The data that is expected is documented in the section titled Refactorings, labeled as - "Options". This field can be omitted if the refactoring + “Options”. This field can be omitted if the refactoring does not require any options or if the values of those options are not known.

@@ -1774,7 +1774,7 @@ being created. The data that is returned is documented in the section titled Refactorings, labeled as - "Feedback". + “Feedback”.

@@ -1984,10 +1984,6 @@ -

- Deprecated: the analysis server no longer fires - LAUNCH_DATA events. -

Subscribe for services. All previous subscriptions are replaced by the given set of services. @@ -3131,8 +3127,8 @@ String

A human-readable description of the kind of element being - referenced (such as "class" or "function type - alias"). This data is omitted if there is no referenced + referenced (such as “class” or “function type + alias”). This data is omitted if there is no referenced element.

@@ -4560,8 +4556,8 @@ String

The human-readable description of the kind of element being - renamed (such as "class" or "function type - alias"). + renamed (such as “class” or “function type + alias”).

diff --git a/pkg/analyzer/lib/src/command_line/arguments.dart b/pkg/analyzer/lib/src/command_line/arguments.dart index 467b71f591f..f120ad0ea02 100644 --- a/pkg/analyzer/lib/src/command_line/arguments.dart +++ b/pkg/analyzer/lib/src/command_line/arguments.dart @@ -173,7 +173,7 @@ void defineAnalysisArguments(ArgParser parser, {bool hide: true, ddc: false}) { parser.addFlag(enableInitializingFormalAccessFlag, help: 'Enable support for allowing access to field formal parameters in a ' - 'constructor\'s initializer list.', + 'constructor\'s initializer list', defaultsTo: false, negatable: false, hide: hide || ddc); diff --git a/pkg/analyzer_cli/lib/src/options.dart b/pkg/analyzer_cli/lib/src/options.dart index 53cf041c5b9..d1550c30f5a 100644 --- a/pkg/analyzer_cli/lib/src/options.dart +++ b/pkg/analyzer_cli/lib/src/options.dart @@ -350,7 +350,7 @@ class CommandLineOptions { hide: hide) ..addOption('build-summary-input', help: 'Path to a summary file that contains information from a ' - 'previous analysis run; may be specified multiple times.', + 'previous analysis run. May be specified multiple times.', allowMultiple: true, hide: hide) ..addOption('build-summary-output', @@ -399,7 +399,7 @@ class CommandLineOptions { hide: hide) ..addOption('x-package-warnings-prefix', help: - 'Show warnings from package: imports that match the given prefix.', + 'Show warnings from package: imports that match the given prefix', hide: hide) ..addFlag('enable-conditional-directives', help: @@ -490,7 +490,7 @@ class CommandLineOptions { return null; // Only reachable in testing. } } else if (results['version']) { - outSink.writeln('$_binaryName version ${_getVersion()}'); + outSink.write('$_binaryName version ${_getVersion()}'); exitHandler(0); return null; // Only reachable in testing. } else {