diff --git a/pkg/analysis_server/doc/api.html b/pkg/analysis_server/doc/api.html index b63c3f2749e..7ce4cd6e3ba 100644 --- a/pkg/analysis_server/doc/api.html +++ b/pkg/analysis_server/doc/api.html @@ -170,12 +170,12 @@ a:focus, a:hover {

Every request is required to have two fields and may have two - additional optional fields. The first required field is the ‘id’ + additional optional fields. The first required field is the 'id' field, which is only used by the server to associate a response with the request that generated the response. The second - required field is the ‘method’ field, which is used to determine + required field is the 'method' field, which is used to determine what the server is being requested to do. One optional field is - the ‘params’ field, whose structure is dependent on the method + the 'params' field, whose structure is dependent on the method being requested. The structure of this field is described with each request for which it is required. The other optional field is the 'clientRequestTime' field, which is a number indicating @@ -186,11 +186,11 @@ a:focus, a:hover {

Every response has up to three fields. The first field is the - ‘id’ field, which is always present and whose value is the + 'id' field, which is always present and whose value is the identifier that was passed to the request that generated the - response. The second field is the ‘error’ field, which is only + response. The second field is the 'error' field, which is only present if an error was encountered while processing the - request. The third field is the ‘result’ field, whose structure + request. The third field is the 'result' field, whose structure is dependent on the method being responded to, and is described with each request that will produce it.

@@ -209,9 +209,9 @@ a:focus, a:hover { errors can be returned together at a later time.

- Each notification has two fields. The first field is the ‘event’ + Each notification has two fields. The first field is the 'event' field, which identifies the kind of notification. The second - field is the ‘params’ field, whose structure is dependent on the + field is the 'params' field, whose structure is dependent on the kind of notification being sent. The structure of this field is described with each notification.

@@ -298,7 +298,7 @@ a:focus, a:hover {

Domains

For convenience, the API is divided into domains. Each domain is specified - in a separate section below. The specifications of the API’s refer to data + in a separate section below. The specifications of the API's refer to data structures beyond the standard JSON primitives. These data structures are documented in the section titled Types.

@@ -434,7 +434,7 @@ a:focus, a:hover {

Domains

server domain

- The server domain contains API’s related to the execution of + The server domain contains API's related to the execution of the server.

@@ -628,7 +628,7 @@ a:focus, a:hover {

analysis domain

- The analysis domain contains API’s related to the analysis of + The analysis domain contains API's related to the analysis of files.

@@ -962,7 +962,7 @@ a:focus, a:hover { file. If none is found, then the parents of the directory will be searched until such a file is found or the root of the file system is reached. If such a file is found, it will - be used to resolve package: URI’s within the file. + be used to resolve package: URI's within the file.

parameters:

included: List<FilePath>
@@ -3142,7 +3142,7 @@ a:focus, a:hover {

flutter domain

- The analysis domain contains API’s related to Flutter support. + The analysis domain contains API's related to Flutter support.

@@ -3230,7 +3230,7 @@ a:focus, a:hover {

Types

This section contains descriptions of the data types referenced - in the API’s of the various domains. + in the API's of the various domains.

@@ -4045,10 +4045,10 @@ a:focus, a:hover { 0x01 - set if the element is explicitly or implicitly abstract
  • - 0x02 - set if the element was declared to be ‘const’ + 0x02 - set if the element was declared to be 'const'
  • - 0x04 - set if the element was declared to be ‘final’ + 0x04 - set if the element was declared to be 'final'
  • 0x08 - set if the element is a static member of a class or is a 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 14d35b7ca57..cbc2ec6d232 100644 --- a/pkg/analysis_server/test/integration/support/integration_test_methods.dart +++ b/pkg/analysis_server/test/integration/support/integration_test_methods.dart @@ -483,7 +483,7 @@ abstract class IntegrationTestMixin { /// directory containing the file for a pubspec.yaml file. If none is found, /// then the parents of the directory will be searched until such a file is /// found or the root of the file system is reached. If such a file is found, - /// it will be used to resolve package: URI’s within the file. + /// it will be used to resolve package: URI's within the file. /// /// Parameters /// diff --git a/pkg/analysis_server/tool/spec/codegen_dart_notification_handler.dart b/pkg/analysis_server/tool/spec/codegen_dart_notification_handler.dart index 1122ceea673..8c8a4f4e150 100644 --- a/pkg/analysis_server/tool/spec/codegen_dart_notification_handler.dart +++ b/pkg/analysis_server/tool/spec/codegen_dart_notification_handler.dart @@ -24,7 +24,7 @@ String _capitalize(String name) => '${name.substring(0, 1).toUpperCase()}${name.substring(1)}'; List _generateDartDoc(Element html) => html.children - .where((Element elem) => elem.localName == 'p') + .where((Element elem) => elem.name == 'p') .map((Element elem) => innerText(elem).trim()) .toList(); diff --git a/pkg/analysis_server/tool/spec/from_html.dart b/pkg/analysis_server/tool/spec/from_html.dart index 0b6d2efd38a..5dee0bf0d54 100644 --- a/pkg/analysis_server/tool/spec/from_html.dart +++ b/pkg/analysis_server/tool/spec/from_html.dart @@ -109,24 +109,24 @@ class ApiReader { if (!requiredAttributes.contains(name) && !optionalAttributes.contains(name)) { throw Exception( - '$context: Unexpected attribute in ${element.localName}: $name'); + '$context: Unexpected attribute in ${element.name}: $name'); } attributesFound.add(name); }); for (var expectedAttribute in requiredAttributes) { if (!attributesFound.contains(expectedAttribute)) { throw Exception( - '$context: ${element.localName} must contain attribute $expectedAttribute'); + '$context: ${element.name} must contain attribute $expectedAttribute'); } } } /// Check that the given [element] has the given [expectedName]. void checkName(dom.Element element, String expectedName, [String? context]) { - if (element.localName != expectedName) { - context ??= element.localName; + if (element.name != expectedName) { + context ??= element.name; throw Exception( - '$context: Expected $expectedName, found ${element.localName}'); + '$context: Expected $expectedName, found ${element.name}'); } } @@ -165,13 +165,12 @@ class ApiReader { dom.Element getAncestor(dom.Element html, String name, String context) { var ancestor = html.parent; while (ancestor != null) { - if (ancestor.localName == name) { + if (ancestor.name == name) { return ancestor; } ancestor = ancestor.parent; } - throw Exception( - '$context: <${html.localName}> must be nested within <$name>'); + throw Exception('$context: <${html.name}> must be nested within <$name>'); } /// Create a [Notification] object from an HTML representation such as: @@ -316,7 +315,7 @@ class ApiReader { var htmlContents = file.readAsStringSync(); var document = dom.parse(htmlContents, file.uri); var htmlElement = document.children - .singleWhere((element) => element.localName!.toLowerCase() == 'html'); + .singleWhere((element) => element.name.toLowerCase() == 'html'); return apiFromHtml(htmlElement); } @@ -329,11 +328,11 @@ class ApiReader { } for (var node in parent.nodes) { if (node is dom.Element) { - var processor = elementProcessors[node.localName]; + var processor = elementProcessors[node.name]; if (processor != null) { processor(node); - } else if (specialElements.contains(node.localName)) { - throw Exception('$context: Unexpected use of <${node.localName}>'); + } else if (specialElements.contains(node.name)) { + throw Exception('$context: Unexpected use of <${node.name}>'); } else { recurse(node, context, elementProcessors); } diff --git a/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java b/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java index d8f6a6c9cde..63daf3e2595 100644 --- a/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java +++ b/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java @@ -209,19 +209,19 @@ public interface AnalysisServer { * If an included path represents a file, then server will look in the directory containing the * file for a pubspec.yaml file. If none is found, then the parents of the directory will be * searched until such a file is found or the root of the file system is reached. If such a file is - * found, it will be used to resolve package: URI’s within the file. + * found, it will be used to resolve package: URI's within the file. * * @param included A list of the files and directories that should be analyzed. * @param excluded A list of the files and directories within the included directories that should - * not be analyzed. + * not be analyzed. * @param packageRoots A mapping from source directories to package roots that should override the - * normal package: URI resolution mechanism. If a package root is a file, then the analyzer - * will behave as though that file is a ".dart_tool/package_config.json" file in the source - * directory. The effect is the same as specifying the file as a "--packages" parameter to - * the Dart VM when executing any Dart file inside the source directory. Files in any - * directories that are not overridden by this mapping have their package: URI's resolved - * using the normal pubspec.yaml mechanism. If this field is absent, or the empty map is - * specified, that indicates that the normal pubspec.yaml mechanism should always be used. + * normal package: URI resolution mechanism. If a package root is a file, then the analyzer + * will behave as though that file is a ".dart_tool/package_config.json" file in the source + * directory. The effect is the same as specifying the file as a "--packages" parameter to + * the Dart VM when executing any Dart file inside the source directory. Files in any + * directories that are not overridden by this mapping have their package: URI's resolved + * using the normal pubspec.yaml mechanism. If this field is absent, or the empty map is + * specified, that indicates that the normal pubspec.yaml mechanism should always be used. */ public void analysis_setAnalysisRoots(List included, List excluded, Map packageRoots); @@ -286,7 +286,7 @@ public interface AnalysisServer { * the existing subscriptions will remain unchanged. * * @param subscriptions A table mapping services to a list of the files being subscribed to the - * service. + * service. */ public void analysis_setSubscriptions(Map> subscriptions); @@ -300,7 +300,7 @@ public interface AnalysisServer { * path to a directory on the filesystem. * * @param files A table mapping the files whose content has changed to a description of the content - * change. + * change. */ public void analysis_updateContent(Map files, UpdateContentConsumer consumer); @@ -396,7 +396,7 @@ public interface AnalysisServer { * @param file The path of the file into which this completion is being inserted. * @param id The identifier of the AvailableSuggestionSet containing the selected label. * @param label The label from the AvailableSuggestionSet with the `id` for which insertion - * information is requested. + * information is requested. * @param offset The offset in the file where the completion will be inserted. */ public void completion_getSuggestionDetails(String file, int id, String label, int offset, GetSuggestionDetailsConsumer consumer); @@ -413,10 +413,10 @@ public interface AnalysisServer { * @param file The path of the file into which this completion is being inserted. * @param offset The offset in the file where the completion will be inserted. * @param completion The completion from the selected CompletionSuggestion. It could be a name of a - * class, or a name of a constructor in form "typeName.constructorName()", or an - * enumeration constant in form "enumName.constantName", etc. + * class, or a name of a constructor in form "typeName.constructorName()", or an enumeration + * constant in form "enumName.constantName", etc. * @param libraryUri The URI of the library to import, so that the element referenced in the - * completion becomes accessible. + * completion becomes accessible. */ public void completion_getSuggestionDetails2(String file, int offset, String completion, String libraryUri, GetSuggestionDetails2Consumer consumer); @@ -439,17 +439,17 @@ public interface AnalysisServer { * @param file The file containing the point at which suggestions are to be made. * @param offset The offset within the file at which suggestions are to be made. * @param maxResults The maximum number of suggestions to return. If the number of suggestions - * after filtering is greater than the maxResults, then isIncomplete is set to true. + * after filtering is greater than the maxResults, then isIncomplete is set to true. * @param completionCaseMatchingMode The mode of code completion being invoked. If no value is - * provided, MATCH_FIRST_CHAR will be assumed. + * provided, MATCH_FIRST_CHAR will be assumed. * @param completionMode The mode of code completion being invoked. If no value is provided, BASIC - * will be assumed. BASIC is also the only currently supported. + * will be assumed. BASIC is also the only currently supported. * @param invocationCount The number of times that the user has invoked code completion at the same - * code location, counting from 1. If no value is provided, 1 will be assumed. + * code location, counting from 1. If no value is provided, 1 will be assumed. * @param timeout The approximate time in milliseconds that the server should spend. The server - * will perform some steps anyway, even if it takes longer than the specified timeout. This - * field is intended to be used for benchmarking, and usually should not be provided, so - * that the default timeout is used. + * will perform some steps anyway, even if it takes longer than the specified timeout. This + * field is intended to be used for benchmarking, and usually should not be provided, so + * that the default timeout is used. */ public void completion_getSuggestions2(String file, int offset, int maxResults, String completionCaseMatchingMode, String completionMode, int invocationCount, int timeout, GetSuggestions2Consumer consumer); @@ -463,9 +463,9 @@ public interface AnalysisServer { * paths are replaced by the given set of paths. * * @param paths A list of objects each containing a path and the additional libraries from which - * the client is interested in receiving completion suggestions. If one configured path is - * beneath another, the descendent will override the ancestors' configured libraries of - * interest. + * the client is interested in receiving completion suggestions. If one configured path is + * beneath another, the descendent will override the ancestors' configured libraries of + * interest. * * @deprecated */ @@ -508,15 +508,15 @@ public interface AnalysisServer { * specified sources if a change in a specified source requires it. * * @param included A list of the files and directories for which edits should be suggested. If a - * request is made with a path that is invalid, e.g. is not absolute and normalized, an - * error of type INVALID_FILE_PATH_FORMAT will be generated. If a request is made for a - * file which does not exist, or which is not currently subject to analysis (e.g. because - * it is not associated with any analysis root specified to analysis.setAnalysisRoots), an - * error of type FILE_NOT_ANALYZED will be generated. + * request is made with a path that is invalid, e.g. is not absolute and normalized, an + * error of type INVALID_FILE_PATH_FORMAT will be generated. If a request is made for a file + * which does not exist, or which is not currently subject to analysis (e.g. because it is + * not associated with any analysis root specified to analysis.setAnalysisRoots), an error + * of type FILE_NOT_ANALYZED will be generated. * @param inTestMode A flag indicating whether the bulk fixes are being run in test mode. The only - * difference is that in test mode the fix processor will look for a configuration file - * that can modify the content of the data file used to compute the fixes when data-driven - * fixes are being considered. If this field is omitted the flag defaults to false. + * difference is that in test mode the fix processor will look for a configuration file that + * can modify the content of the data file used to compute the fixes when data-driven fixes + * are being considered. If this field is omitted the flag defaults to false. */ public void edit_bulkFixes(List included, boolean inTestMode, BulkFixesConsumer consumer); @@ -619,12 +619,12 @@ public interface AnalysisServer { * @param offset The offset of the region involved in the refactoring. * @param length The length of the region involved in the refactoring. * @param validateOnly True if the client is only requesting that the values of the options be - * validated and no change be generated. + * 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 - * omitted if the refactoring does not require any options or if the values of those - * options are not known. + * 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 require any options or if the values of those options + * are not known. */ public void edit_getRefactoring(String kind, String file, int offset, int length, boolean validateOnly, RefactoringOptions options, GetRefactoringConsumer consumer); @@ -655,9 +655,9 @@ public interface AnalysisServer { * @param file The file in which the specified elements are to be made accessible. * @param elements The elements to be made accessible in the specified file. * @param offset The offset at which the specified elements need to be made accessible. If - * provided, this is used to guard against adding imports for text that would be inserted - * into a comment, string literal, or other location where the imports would not be - * necessary. + * provided, this is used to guard against adding imports for text that would be inserted + * into a comment, string literal, or other location where the imports would not be + * necessary. */ public void edit_importElements(String file, List elements, int offset, ImportElementsConsumer consumer); @@ -719,7 +719,7 @@ public interface AnalysisServer { * responsible for managing the lifetime of execution contexts. * * @param contextRoot The path of the Dart or HTML file that will be launched, or the path of the - * directory containing the file. + * directory containing the file. */ public void execution_createContext(String contextRoot, CreateContextConsumer consumer); @@ -751,17 +751,17 @@ public interface AnalysisServer { * @param code The code to get suggestions in. * @param offset The offset within the code to get suggestions at. * @param contextFile The path of the context file, e.g. the file of the current debugger frame. - * The combination of the context file and context offset can be used to ensure that all - * variables of the context are available for completion (with their static types). + * The combination of the context file and context offset can be used to ensure that all + * variables of the context are available for completion (with their static types). * @param contextOffset The offset in the context file, e.g. the line offset in the current - * debugger frame. + * debugger frame. * @param variables The runtime context variables that are potentially referenced in the code. * @param expressions The list of sub-expressions in the code for which the client wants to provide - * runtime types. It does not have to be the full list of expressions requested by the - * server, for missing expressions their static types will be used. When this field is - * omitted, the server will return completion suggestions only when there are no - * interesting sub-expressions in the given code. The client may provide an empty list, in - * this case the server will return completion suggestions. + * runtime types. It does not have to be the full list of expressions requested by the + * server, for missing expressions their static types will be used. When this field is + * omitted, the server will return completion suggestions only when there are no interesting + * sub-expressions in the given code. The client may provide an empty list, in this case the + * server will return completion suggestions. */ public void execution_getSuggestions(String code, int offset, String contextFile, int contextOffset, List variables, List expressions, GetSuggestionsConsumer consumer); @@ -849,7 +849,7 @@ public interface AnalysisServer { * the existing subscriptions will remain unchanged. * * @param subscriptions A table mapping services to a list of the files being subscribed to the - * service. + * service. */ public void flutter_setSubscriptions(Map> subscriptions); @@ -864,14 +864,14 @@ public interface AnalysisServer { * intermediate widgets instantiated. * * @param id The identifier of the property, previously returned as a part of a - * FlutterWidgetProperty. An error of type FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_ID is - * generated if the identifier is not valid. + * FlutterWidgetProperty. An error of type FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_ID is + * generated if the identifier is not valid. * @param value The new value to set for the property. If absent, indicates that the property - * should be removed. If the property corresponds to an optional parameter, the - * corresponding named argument is removed. If the property isRequired is true, - * FLUTTER_SET_WIDGET_PROPERTY_VALUE_IS_REQUIRED error is generated. If the expression is - * not a syntactically valid Dart code, then - * FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_EXPRESSION is reported. + * should be removed. If the property corresponds to an optional parameter, the + * corresponding named argument is removed. If the property isRequired is true, + * FLUTTER_SET_WIDGET_PROPERTY_VALUE_IS_REQUIRED error is generated. If the expression is + * not a syntactically valid Dart code, then + * FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_EXPRESSION is reported. */ public void flutter_setWidgetPropertyValue(int id, FlutterWidgetPropertyValue value, SetWidgetPropertyValueConsumer consumer); @@ -928,7 +928,7 @@ public interface AnalysisServer { * search.results notification as they become available. * * @param file The file containing the declaration of or reference to the element used to define - * the search. + * the search. * @param offset The offset within the file of the declaration of or reference to the element. * @param includePotential True if potential matches are to be included in the results. */ @@ -979,11 +979,11 @@ public interface AnalysisServer { * Return top-level and class member declarations. * * @param file If this field is provided, return only declarations in this file. If this field is - * missing, return declarations in all files. + * missing, return declarations in all files. * @param pattern The regular expression used to match the names of declarations. If this field is - * missing, return all declarations. + * missing, return all declarations. * @param maxResults The maximum number of declarations to return. If this field is missing, return - * all matching declarations. + * all matching declarations. */ public void search_getElementDeclarations(String file, String pattern, int maxResults, GetElementDeclarationsConsumer consumer); @@ -993,7 +993,7 @@ public interface AnalysisServer { * Return the type hierarchy of the class declared or referenced at the given location. * * @param file The file containing the declaration or reference to the type for which a hierarchy - * is being requested. + * is being requested. * @param offset The offset of the name of the type within the file. * @param superOnly True if the client is only requesting superclasses and interfaces hierarchy. */ diff --git a/pkg/analysis_server/tool/spec/generated/java/types/Element.java b/pkg/analysis_server/tool/spec/generated/java/types/Element.java index 690f101cefb..2cab3852fee 100644 --- a/pkg/analysis_server/tool/spec/generated/java/types/Element.java +++ b/pkg/analysis_server/tool/spec/generated/java/types/Element.java @@ -66,8 +66,8 @@ public class Element { * A bit-map containing the following flags: * * - 0x01 - set if the element is explicitly or implicitly abstract - * - 0x02 - set if the element was declared to be ‘const’ - * - 0x04 - set if the element was declared to be ‘final’ + * - 0x02 - set if the element was declared to be 'const' + * - 0x04 - set if the element was declared to be 'final' * - 0x08 - set if the element is a static member of a class or is a top-level function or field * - 0x10 - set if the element is private * - 0x20 - set if the element is deprecated @@ -167,8 +167,8 @@ public class Element { * A bit-map containing the following flags: * * - 0x01 - set if the element is explicitly or implicitly abstract - * - 0x02 - set if the element was declared to be ‘const’ - * - 0x04 - set if the element was declared to be ‘final’ + * - 0x02 - set if the element was declared to be 'const' + * - 0x04 - set if the element was declared to be 'final' * - 0x08 - set if the element is a static member of a class or is a top-level function or field * - 0x10 - set if the element is private * - 0x20 - set if the element is deprecated diff --git a/pkg/analysis_server/tool/spec/spec_input.html b/pkg/analysis_server/tool/spec/spec_input.html index a368876e79e..0c14fe67329 100644 --- a/pkg/analysis_server/tool/spec/spec_input.html +++ b/pkg/analysis_server/tool/spec/spec_input.html @@ -67,12 +67,12 @@

    Every request is required to have two fields and may have two - additional optional fields. The first required field is the ‘id’ + additional optional fields. The first required field is the 'id' field, which is only used by the server to associate a response with the request that generated the response. The second - required field is the ‘method’ field, which is used to determine + required field is the 'method' field, which is used to determine what the server is being requested to do. One optional field is - the ‘params’ field, whose structure is dependent on the method + the 'params' field, whose structure is dependent on the method being requested. The structure of this field is described with each request for which it is required. The other optional field is the 'clientRequestTime' field, which is a number indicating @@ -83,11 +83,11 @@

    Every response has up to three fields. The first field is the - ‘id’ field, which is always present and whose value is the + 'id' field, which is always present and whose value is the identifier that was passed to the request that generated the - response. The second field is the ‘error’ field, which is only + response. The second field is the 'error' field, which is only present if an error was encountered while processing the - request. The third field is the ‘result’ field, whose structure + request. The third field is the 'result' field, whose structure is dependent on the method being responded to, and is described with each request that will produce it.

    @@ -106,9 +106,9 @@ errors can be returned together at a later time.

    - Each notification has two fields. The first field is the ‘event’ + Each notification has two fields. The first field is the 'event' field, which identifies the kind of notification. The second - field is the ‘params’ field, whose structure is dependent on the + field is the 'params' field, whose structure is dependent on the kind of notification being sent. The structure of this field is described with each notification.

    @@ -195,7 +195,7 @@

    Domains

    For convenience, the API is divided into domains. Each domain is specified - in a separate section below. The specifications of the API’s refer to data + in a separate section below. The specifications of the API's refer to data structures beyond the standard JSON primitives. These data structures are documented in the section titled Types.

    @@ -272,7 +272,7 @@

    - The server domain contains API’s related to the execution of + The server domain contains API's related to the execution of the server.

    @@ -441,7 +441,7 @@

    - The analysis domain contains API’s related to the analysis of + The analysis domain contains API's related to the analysis of files.

    @@ -843,7 +843,7 @@ file. If none is found, then the parents of the directory will be searched until such a file is found or the root of the file system is reached. If such a file is found, it will - be used to resolve package: URI’s within the file. + be used to resolve package: URI's within the file.

    @@ -3340,7 +3340,7 @@

    - The analysis domain contains API’s related to Flutter support. + The analysis domain contains API's related to Flutter support.

    @@ -3517,7 +3517,7 @@

    Types

    This section contains descriptions of the data types referenced - in the API’s of the various domains. + in the API's of the various domains.

    diff --git a/pkg/analysis_server/tool/spec/to_html.dart b/pkg/analysis_server/tool/spec/to_html.dart index d5f865dcf6b..ee72244c9fd 100644 --- a/pkg/analysis_server/tool/spec/to_html.dart +++ b/pkg/analysis_server/tool/spec/to_html.dart @@ -419,7 +419,7 @@ class ToHtmlVisitor extends HierarchicalApiVisitor } for (var node in html.nodes) { if (node is dom.Element) { - var localName = node.localName!; + var localName = node.name; if (squashParagraphs && localName == 'p') { translateHtml(node, squashParagraphs: squashParagraphs); continue; @@ -609,7 +609,7 @@ class ToHtmlVisitor extends HierarchicalApiVisitor void visitTypeEnumValue(TypeEnumValue typeEnumValue) { var isDocumented = false; for (var node in typeEnumValue.html.nodes) { - if ((node is dom.Element && node.localName != 'code') || + if ((node is dom.Element && node.name != 'code') || (node is dom.Text && node.text.trim().isNotEmpty)) { isDocumented = true; break; diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart index e9534c1397a..7dc20b7cd0a 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart @@ -1241,8 +1241,8 @@ class Element implements HasToJson { /// A bit-map containing the following flags: /// /// - 0x01 - set if the element is explicitly or implicitly abstract - /// - 0x02 - set if the element was declared to be ‘const’ - /// - 0x04 - set if the element was declared to be ‘final’ + /// - 0x02 - set if the element was declared to be 'const' + /// - 0x04 - set if the element was declared to be 'final' /// - 0x08 - set if the element is a static member of a class or is a /// top-level function or field /// - 0x10 - set if the element is private diff --git a/pkg/analyzer_plugin/doc/api.html b/pkg/analyzer_plugin/doc/api.html index 3427f3f8d3c..dde345f98eb 100644 --- a/pkg/analyzer_plugin/doc/api.html +++ b/pkg/analyzer_plugin/doc/api.html @@ -125,7 +125,7 @@ a:focus, a:hover {

    plugin domain

    - The plugin domain contains API’s related to the execution of a plugin. + The plugin domain contains API's related to the execution of a plugin.

    TODO: Provide notifications by which plugins can report instrumentation @@ -265,7 +265,7 @@ a:focus, a:hover {

  • analysis domain

    - The analysis domain contains API’s related to the analysis of files. + The analysis domain contains API's related to the analysis of files.

    @@ -829,7 +829,7 @@ a:focus, a:hover {

    Types

    - This section contains descriptions of the data types referenced in the API’s + This section contains descriptions of the data types referenced in the API's of the various domains.

    @@ -1308,10 +1308,10 @@ a:focus, a:hover { 0x01 - set if the element is explicitly or implicitly abstract
  • - 0x02 - set if the element was declared to be ‘const’ + 0x02 - set if the element was declared to be 'const'
  • - 0x04 - set if the element was declared to be ‘final’ + 0x04 - set if the element was declared to be 'final'
  • 0x08 - set if the element is a static member of a class or is a diff --git a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart index 80f2449fab7..2db1c2a31a0 100644 --- a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart +++ b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart @@ -1241,8 +1241,8 @@ class Element implements HasToJson { /// A bit-map containing the following flags: /// /// - 0x01 - set if the element is explicitly or implicitly abstract - /// - 0x02 - set if the element was declared to be ‘const’ - /// - 0x04 - set if the element was declared to be ‘final’ + /// - 0x02 - set if the element was declared to be 'const' + /// - 0x04 - set if the element was declared to be 'final' /// - 0x08 - set if the element is a static member of a class or is a /// top-level function or field /// - 0x10 - set if the element is private diff --git a/pkg/analyzer_plugin/tool/spec/common_types_spec.html b/pkg/analyzer_plugin/tool/spec/common_types_spec.html index 96bdae9808a..4dca7a69c0c 100644 --- a/pkg/analyzer_plugin/tool/spec/common_types_spec.html +++ b/pkg/analyzer_plugin/tool/spec/common_types_spec.html @@ -538,10 +538,10 @@ 0x01 - set if the element is explicitly or implicitly abstract
  • - 0x02 - set if the element was declared to be ‘const’ + 0x02 - set if the element was declared to be 'const'
  • - 0x04 - set if the element was declared to be ‘final’ + 0x04 - set if the element was declared to be 'final'
  • 0x08 - set if the element is a static member of a class or is a diff --git a/pkg/analyzer_plugin/tool/spec/from_html.dart b/pkg/analyzer_plugin/tool/spec/from_html.dart index d5351a2a2d6..11a80fe31c9 100644 --- a/pkg/analyzer_plugin/tool/spec/from_html.dart +++ b/pkg/analyzer_plugin/tool/spec/from_html.dart @@ -111,24 +111,24 @@ class ApiReader { if (!requiredAttributes.contains(name) && !optionalAttributes.contains(name)) { throw Exception( - '$context: Unexpected attribute in ${element.localName}: $name'); + '$context: Unexpected attribute in ${element.name}: $name'); } attributesFound.add(name); }); for (var expectedAttribute in requiredAttributes) { if (!attributesFound.contains(expectedAttribute)) { throw Exception( - '$context: ${element.localName} must contain attribute $expectedAttribute'); + '$context: ${element.name} must contain attribute $expectedAttribute'); } } } /// Check that the given [element] has the given [expectedName]. void checkName(dom.Element element, String expectedName, [String? context]) { - if (element.localName != expectedName) { - context ??= element.localName; + if (element.name != expectedName) { + context ??= element.name; throw Exception( - '$context: Expected $expectedName, found ${element.localName}'); + '$context: Expected $expectedName, found ${element.name}'); } } @@ -164,13 +164,12 @@ class ApiReader { dom.Element getAncestor(dom.Element html, String name, String context) { var ancestor = html.parent; while (ancestor != null) { - if (ancestor.localName == name) { + if (ancestor.name == name) { return ancestor; } ancestor = ancestor.parent; } - throw Exception( - '$context: <${html.localName}> must be nested within <$name>'); + throw Exception('$context: <${html.name}> must be nested within <$name>'); } /// Create a [Notification] object from an HTML representation such as: @@ -295,7 +294,7 @@ class ApiReader { var htmlContents = file.readAsStringSync(); var document = dom.parse(htmlContents, file.uri); var htmlElement = document.children - .singleWhere((element) => element.localName?.toLowerCase() == 'html'); + .singleWhere((element) => element.name.toLowerCase() == 'html'); return apiFromHtml(htmlElement); } @@ -308,10 +307,10 @@ class ApiReader { } for (var node in parent.nodes) { if (node is dom.Element) { - if (elementProcessors.containsKey(node.localName)) { - elementProcessors[node.localName]!(node); - } else if (specialElements.contains(node.localName)) { - throw Exception('$context: Unexpected use of <${node.localName}>'); + if (elementProcessors.containsKey(node.name)) { + elementProcessors[node.name]!(node); + } else if (specialElements.contains(node.name)) { + throw Exception('$context: Unexpected use of <${node.name}>'); } else { recurse(node, context, elementProcessors); } diff --git a/pkg/analyzer_plugin/tool/spec/plugin_spec.html b/pkg/analyzer_plugin/tool/spec/plugin_spec.html index d9b11a9eca7..e0e59278ab7 100644 --- a/pkg/analyzer_plugin/tool/spec/plugin_spec.html +++ b/pkg/analyzer_plugin/tool/spec/plugin_spec.html @@ -22,7 +22,7 @@

    - The plugin domain contains API’s related to the execution of a plugin. + The plugin domain contains API's related to the execution of a plugin.

    TODO: Provide notifications by which plugins can report instrumentation @@ -147,7 +147,7 @@

    - The analysis domain contains API’s related to the analysis of files. + The analysis domain contains API's related to the analysis of files.

    @@ -874,7 +874,7 @@

    Types

    - This section contains descriptions of the data types referenced in the API’s + This section contains descriptions of the data types referenced in the API's of the various domains.

    attributes = {}; @@ -26,9 +26,6 @@ class Element extends Node { Element.tag(this.name); - // This is for compatibility with the package:html DOM API. - String? get localName => name; - void append(Node child) { child.parent = this; nodes.add(child); diff --git a/pkg/analyzer_utilities/lib/text_formatter.dart b/pkg/analyzer_utilities/lib/text_formatter.dart index ce20d49d89e..e2efe8e46db 100644 --- a/pkg/analyzer_utilities/lib/text_formatter.dart +++ b/pkg/analyzer_utilities/lib/text_formatter.dart @@ -64,7 +64,7 @@ class _TextFormatter extends CodeGenerator { } } } else if (node is dom.Element) { - switch (node.localName) { + switch (node.name) { case 'br': lineBreak(false); break; @@ -83,8 +83,7 @@ class _TextFormatter extends CodeGenerator { lineBreak(false); if (node.classes.contains('hangingIndent')) { resolveVerticalSpace(); - // TODO(devoncarew): Remove a space here. - indentSpecial('', ' ', () { + indentSpecial('', ' ', () { addAll(node.nodes); lineBreak(false); }); @@ -144,7 +143,7 @@ class _TextFormatter extends CodeGenerator { case 'head': break; default: - throw Exception('Unexpected HTML element: ${node.localName}'); + throw Exception('Unexpected HTML element: ${node.name}'); } } else { throw Exception('Unexpected HTML: $node');