Skip to content

Commit

Permalink
Version 3.7.0-75.0.dev
Browse files Browse the repository at this point in the history
Merge 933d630 into dev
  • Loading branch information
Dart CI committed Oct 28, 2024
2 parents c9180e9 + 933d630 commit 6e55dfe
Show file tree
Hide file tree
Showing 39 changed files with 915 additions and 950 deletions.
40 changes: 20 additions & 20 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,17 @@ vars = {
# revision.

"args_rev": "09c0fca1785c9df39288a48f767994eed80bed40", #
"async_rev": "5f70a996f673d625e3502597084653686c3e754c",
"async_rev": "d6a6a4dbe0c636e42d6cf4ede88ed5a33e35a6ca",
"bazel_worker_rev": "aa3cc9e826350b960e0c5a67e6065bcedba8b0ac",
"benchmark_harness_rev": "44f125ae1d045aa3de09fe88a8dd70cb7352d563",
"browser_launcher_rev": "e5fc5d488eb5038bfec2a6690c72ab8dd353e101",
"characters_rev": "7633a16a22c626e19ca750223237396315268a06",
"cli_util_rev": "c36b3941e38092d6d6f87ac27d9e88f153d3ac38",
"clock_rev": "7956d60042f4ea979c4554d43eeb57d087627869",
"collection_rev": "887b826b50f48d6a9cd2c0684aa353e8e3a0fad0",
"convert_rev": "d361833e117cb2438d2a2a6d0b0acb28ff0910fb",
"core_rev": "2a436d5c21964c2658a3b669d9bdef802637dd81",
"crypto_rev": "3d26ef4cf22d4b218ba30e616544ad3cf52f64a1",
"clock_rev": "8dfee808c53302269c62954726d0db049f53bbc6",
"collection_rev": "96afcc2fce622ea7e75053af5b73f8db07491bc4",
"convert_rev": "836082a3a5e9c6bb890d7fe025098f38fd5b8a3e",
"core_rev": "9ad68884a10ad75bb859dcac9ab057e78b0d7df3",
"crypto_rev": "255edfb5ab8d01e7bb2302b97a7f5124ef82fd1b",
"csslib_rev": "a3700b05bbcc42782e8a7024790dbf019d89c249",
# Note: Updates to dart_style have to be coordinated with the infrastructure
# team so that the internal formatter `tools/sdks/dart-sdk/bin/dart format`
Expand All @@ -144,26 +144,26 @@ vars = {
#
# For more details, see https://github.com/dart-lang/sdk/issues/30164.
"dart_style_rev": "5d35f4d829ffb8532d345d95d3e9504ae6cd839e", # disable tools/rev_sdk_deps.dart
"dartdoc_rev": "73344a26b41a4c6c07c38b3232b6449d1b0e41f4",
"ecosystem_rev": "2d58550f9e3fd8ecbc3b2e4444095fcb204a66c6",
"fixnum_rev": "83293b8ed86ccd574a94fcf4a2da43f31c1b43e0",
"dartdoc_rev": "5168f81a7d774effd7f8520cd170ffcb180f7c39",
"ecosystem_rev": "66ddc4fce068084bc68fe0118ca238b2ab8da9b5",
"fixnum_rev": "854397228d1892e1b8374f97d172667c0c1ba9c7",
"flute_rev": "a531c96a8b43d015c6bfbbfe3ab54867b0763b8b",
"glob_rev": "00a9c82d31c01ae88ec9ae4021d842e9b832aa52",
"html_rev": "6d3bc86cf2ab530ef3fa5f84b5980dc318a02af4",
"http_rev": "5e2281edd25f9addbf26242a0658d8f2dfa1134b",
"http_rev": "f5ec11c07fa25e1a481d6939e51369ba97226a29",
"http_multi_server_rev": "e7515b5896b83d522189802a1e14e103e19426c0",
"intl_rev": "5d65e3808ce40e6282e40881492607df4e35669f",
"json_rpc_2_rev": "c9b616bded8cdb5bfdc836ba7648afa6aba40062",
"leak_tracker_rev": "f5620600a5ce1c44f65ddaa02001e200b096e14c", # manually rolled
"lints_rev": "5016d63c889936b2100520f999591d0492d9afe3",
"logging_rev": "6fa056098ceca03d399bff64592822b2ae5dee6e",
"markdown_rev": "d53feae0760a4f0aae5ffdfb12d8e6acccf14b40",
"lints_rev": "19d99bc64a03a6f32f05e71481edf151032ebf5b",
"logging_rev": "a41a5089d20f734a21c02739042bace5073cbed3",
"markdown_rev": "207bb4416f9ca3bb60086e56ed8581da929916ae",
"material_color_utilities_rev": "799b6ba2f3f1c28c67cc7e0b4f18e0c7d7f3c03e",
"mockito_rev": "57d484f9b8e7f6a504966a901174358a42fa932a",
# dart-native-interop-team@ is rolling breaking changes manually while the assets features are in experimental.
"native_rev": "659511886501bcce638c3966590df04984909ef0", # disable tools/rev_sdk_deps.dart
"package_config_rev": "bafff8e90be25e1985f7e3ee40ea1d22571a93e6",
"path_rev": "e969f42ed112dd702a9453beb9df6c12ae2d3805",
"path_rev": "7e3d5d87220133ad9cc99f82e85a826011a62859",
"pool_rev": "7bfc71b39742753a88688e56e55a828a2f5dc0bf",
"protobuf_rev": "ccf104dbc36929c0f8708285d5f3a8fae206343e",
"pub_rev": "1d7b0d9a35be9cff5d071f6cf17fcdcde2b7ecc5", # disable tools/rev_sdk_deps.dart
Expand All @@ -175,18 +175,18 @@ vars = {
"stack_trace_rev": "115bcd9591d251dab7a5ad518655c2124a1cc525",
"stream_channel_rev": "f4407168b275fcde9187baefd7dbce76d0992825",
"string_scanner_rev": "084b201c54b168aced178fff41fce71e3869ae42",
"sync_http_rev": "91c0dd5ef9a008f0277aadcfd83036f82e572d09",
"sync_http_rev": "44b5913b7b3368a29b3ad8ef6809a1d28ce4c1b4",
"tar_rev": "5a1ea943e70cdf3fa5e1102cdbb9418bd9b4b81a",
"term_glyph_rev": "19d8c08a4e81122639129c62049896021910c932",
"test_rev": "73e30fb9441878abed529e242ddd3c6d6826c0dc",
"test_rev": "fe38650453e200ae559134b581e0bddd3f5d4e99",
"test_descriptor_rev": "a3db1efe3dc725dcae9ee61647d3bfc19b3231ac",
"test_process_rev": "52ee3f5ab70ed965bb7122c1d499081fbccd0bde",
"test_reflective_loader_rev": "598af2f503955020af0eaa82558d574a03934078",
"tools_rev": "b1312b18df67b0be3101ca15c03dfd8d7c9383bb",
"typed_data_rev": "6abfafdcf661cd8a814619d7e2a3e99edb3a3862",
"vector_math_rev": "2cfbe2c115a57b368ccbc3c89ebd38a06764d3d1",
"tools_rev": "f7b2b53dee019834942b32278c3cfaf3e843bc6a",
"typed_data_rev": "b269d394681f4378d4147704a96148b3eabaa08c",
"vector_math_rev": "da9889f5859d7258772d6627abde2f5c530cae8d",
"watcher_rev": "3b850778ad0b62db3aa2cfe48832870c2461db30",
"web_rev": "8478cd27d574249eca3d41f9135458dfda2762c8",
"web_rev": "d3a61aa9b4e43cdaf949a69c159038cdecf5681a",
"web_socket_channel_rev": "40aa29f1d2167467f5934d755891a8beb62a1239",
"webdev_rev": "5f30c560dc4e3df341356c43ec1a766ee6b74a7c",
"webdriver_rev": "accfed557c005c87df56ffb626458f87da9f2125",
Expand Down
2 changes: 2 additions & 0 deletions pkg/analysis_server/analyzer_use_new_elements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ lib/src/computer/computer_color.dart
lib/src/computer/computer_folding.dart
lib/src/computer/computer_highlights.dart
lib/src/computer/computer_outline.dart
lib/src/computer/computer_overrides.dart
lib/src/computer/computer_selection_ranges.dart
lib/src/context_manager.dart
lib/src/domain_analysis_flags.dart
Expand Down Expand Up @@ -173,6 +174,7 @@ lib/src/lsp/semantic_tokens/legend.dart
lib/src/lsp/semantic_tokens/mapping.dart
lib/src/lsp/server_capabilities_computer.dart
lib/src/lsp/snippets.dart
lib/src/lsp/source_edits.dart
lib/src/lsp/temporary_overlay_operation.dart
lib/src/plugin/notification_manager.dart
lib/src/plugin/plugin_locator.dart
Expand Down
62 changes: 42 additions & 20 deletions pkg/analysis_server/lib/src/computer/computer_documentation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
// BSD-style license that can be found in the LICENSE file.

import 'package:analysis_server/src/computer/computer_overrides.dart';
import 'package:analysis_server/src/utilities/extensions/element.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/element2.dart';
import 'package:analyzer/src/dartdoc/dartdoc_directive_info.dart';
import 'package:analyzer/src/utilities/extensions/element.dart';

/// Computes documentation for an [Element].
class DartDocumentationComputer {
Expand All @@ -16,40 +19,49 @@ class DartDocumentationComputer {
Element elementBeingDocumented, {
bool includeSummary = false,
}) {
Element? element = elementBeingDocumented;
if (element is FieldFormalParameterElement) {
element = element.field;
}
if (element is ParameterElement) {
element = element.enclosingElement3;
}
// TODO(dantup): Remove this temporary implementation used to split
// migration of this class and callers into separate changes.
var element2 = elementBeingDocumented.asElement2;

return element2 != null
? compute2(element2, includeSummary: includeSummary)
: null;
}

Documentation? compute2(
Element2 elementBeingDocumented, {
bool includeSummary = false,
}) {
var element = switch (elementBeingDocumented) {
FieldFormalParameterElement2() => elementBeingDocumented.field2,
FormalParameterElement() => elementBeingDocumented.enclosingElement2,
_ => elementBeingDocumented,
};
if (element == null) {
// This can happen when the code is invalid, such as having a field formal
// parameter for a field that does not exist.
return null;
}

Element? documentedElement;
Element? documentedGetter;
Element2? documentedElement;
Element2? documentedGetter;

// Look for documentation comments of overridden members
var overridden = findOverriddenElements(element);
var candidates = [
element,
...overridden.superElements,
...overridden.interfaceElements,
if (element case PropertyAccessorElement(variable2: var variable?))
variable
if (element case GetterElement(variable3: var variable?)) variable,
if (element case SetterElement(variable3: var variable?)) variable
];
for (var candidate in candidates) {
if (candidate.documentationComment != null) {
if (candidate.documentationCommentOrNull != null) {
documentedElement = candidate;
break;
}
if (documentedGetter == null &&
candidate is PropertyAccessorElement &&
candidate.isSetter) {
var getter = candidate.correspondingGetter;
if (documentedGetter == null && candidate is SetterElement) {
var getter = candidate.correspondingGetter2;
if (getter != null && getter.documentationComment != null) {
documentedGetter = getter;
}
Expand All @@ -62,16 +74,16 @@ class DartDocumentationComputer {
return null;
}

var rawDoc = documentedElement.documentationComment;
var rawDoc = documentedElement.documentationCommentOrNull;
if (rawDoc == null) {
return null;
}
var result =
dartdocInfo.processDartdoc(rawDoc, includeSummary: includeSummary);

var documentedElementClass = documentedElement.enclosingElement3;
var documentedElementClass = documentedElement.enclosingElement2;
if (documentedElementClass != null &&
documentedElementClass != element.enclosingElement3) {
documentedElementClass != element.enclosingElement2) {
var documentedClass = documentedElementClass.displayName;
result.full = '${result.full}\n\nCopied from `$documentedClass`.';
}
Expand All @@ -83,11 +95,21 @@ class DartDocumentationComputer {
/// docs (or `null`) depending on `preference`.
String? computePreferred(
Element element, DocumentationPreference preference) {
// TODO(dantup): Remove this temporary implementation used to split
// migration of this class and callers into separate changes.
var element2 = element.asElement2;
return element2 != null ? computePreferred2(element2, preference) : null;
}

/// Compute documentation for [element] and return either the summary or full
/// docs (or `null`) depending on `preference`.
String? computePreferred2(
Element2 element, DocumentationPreference preference) {
if (preference == DocumentationPreference.none) {
return null;
}

var doc = compute(
var doc = compute2(
element,
includeSummary: preference == DocumentationPreference.summary,
);
Expand Down
Loading

0 comments on commit 6e55dfe

Please sign in to comment.