Version 2.18.0-157.0.dev
Merge commit 'b6fd6e05933a063e8e7b6f331dd53dc551bcb9ff' into 'dev'
diff --git a/pkg/analysis_server/lib/src/lsp/snippets.dart b/pkg/analysis_server/lib/src/lsp/snippets.dart
index afc2155..48d7511 100644
--- a/pkg/analysis_server/lib/src/lsp/snippets.dart
+++ b/pkg/analysis_server/lib/src/lsp/snippets.dart
@@ -87,11 +87,13 @@
// Use the index as an ID to keep all related positions together (so
// the remain "linked").
linkedGroupId: index,
- // If there is no selection, no tabstops, and only a single edit group
- // allow it to be the final tabstop.
+ // If there is no selection, no tabstops, only a single edit group and
+ // not multiple suggestions (which map to a choice), allow this to be
+ // the final tabstop.
isFinal: selectionOffset == null &&
(tabStopOffsetLengthPairs?.isEmpty ?? false) &&
- editGroups?.length == 1,
+ editGroups?.length == 1 &&
+ editGroup.suggestions.length <= 1,
),
);
}
@@ -168,6 +170,7 @@
/// Appends a placeholder with a set of choices to choose from.
///
/// If there are 0 or 1 choices, a placeholder will be inserted instead.
+ /// If there are multiple choices, [placeholderNumber] must not be 0.
///
/// Returns the placeholder number used.
int appendChoice(Set<String> uniqueChoices, {int? placeholderNumber}) {
@@ -179,6 +182,17 @@
);
}
+ // Otherwise, we will use a choice. In a choice it'snot valid to be the
+ // final (0th) tabstop.
+ assert(placeholderNumber == null || placeholderNumber > 0);
+
+ // To avoid producing broken choice snippets in release builds (if the
+ // assert above didn't catch issues at dev time), map any final tabstops to
+ // use the next available tabstop to produce a valid snippet.
+ if (placeholderNumber == 0) {
+ placeholderNumber = null;
+ }
+
placeholderNumber = _usePlaceholerNumber(placeholderNumber);
final escapedChoices = uniqueChoices.map(escapeSnippetChoiceText).join(',');
@@ -229,7 +243,7 @@
/// Generates the current and next placeholder numbers.
int _usePlaceholerNumber(int? placeholderNumber) {
- // If a number was not supplied, use thenext available one.
+ // If a number was not supplied, use the next available one.
placeholderNumber ??= _nextPlaceholder;
// If the number we used was the highest seen, set the next one after it.
_nextPlaceholder = math.max(_nextPlaceholder, placeholderNumber + 1);
diff --git a/pkg/analysis_server/test/lsp/snippets_test.dart b/pkg/analysis_server/test/lsp/snippets_test.dart
index 6ca43a2..8c3ad83 100644
--- a/pkg/analysis_server/test/lsp/snippets_test.dart
+++ b/pkg/analysis_server/test/lsp/snippets_test.dart
@@ -155,8 +155,9 @@
),
],
);
+ // Choices are never 0th placeholders, so this is `$1`.
expect(result, equals(r'''
-var ${0|a,aaa,bbb\${\}\,\|,ccc|} = 1;
+var ${1|a,aaa,bbb\${\}\,\|,ccc|} = 1;
'''));
}
diff --git a/pkg/native_stack_traces/CHANGELOG.md b/pkg/native_stack_traces/CHANGELOG.md
index 5ad01eb..b96e965 100644
--- a/pkg/native_stack_traces/CHANGELOG.md
+++ b/pkg/native_stack_traces/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 0.4.6
+
+- Upgrade to `package:lints` 2.0.
+- Populate the pubspec `repository` field.
+
## 0.4.5
- Handle stack traces larger than 100 entries.
diff --git a/pkg/native_stack_traces/README.md b/pkg/native_stack_traces/README.md
index 4e609d5..aeb39f9 100644
--- a/pkg/native_stack_traces/README.md
+++ b/pkg/native_stack_traces/README.md
@@ -1,4 +1,5 @@
-# native_stack_traces
+[![pub package](https://img.shields.io/pub/v/native_stack_traces.svg)](https://pub.dev/packages/native_stack_traces)
+[![package publisher](https://img.shields.io/pub/publisher/native_stack_traces.svg)](https://pub.dev/packages/native_stack_traces/publisher)
This package provides libraries and a utility for decoding non-symbolic
stack traces generated by an AOT-compiled Dart application.
diff --git a/pkg/native_stack_traces/pubspec.yaml b/pkg/native_stack_traces/pubspec.yaml
index ad5add0..78b29eb 100644
--- a/pkg/native_stack_traces/pubspec.yaml
+++ b/pkg/native_stack_traces/pubspec.yaml
@@ -1,5 +1,5 @@
name: native_stack_traces
-version: 0.4.5
+version: 0.4.6
description: Utilities for working with non-symbolic stack traces.
repository: https://github.com/dart-lang/sdk/tree/main/pkg/native_stack_traces
diff --git a/pkg/vm_snapshot_analysis/CHANGELOG.md b/pkg/vm_snapshot_analysis/CHANGELOG.md
index f931fce..626d21a 100644
--- a/pkg/vm_snapshot_analysis/CHANGELOG.md
+++ b/pkg/vm_snapshot_analysis/CHANGELOG.md
@@ -1,5 +1,10 @@
# Changelog
+## 0.7.2
+
+- Upgrade to `package:lints` 2.0.
+- Populate the pubspec `repository` field.
+
## 0.7.1
- Make `CallGraphNode.dominator` nullable.
diff --git a/pkg/vm_snapshot_analysis/README.md b/pkg/vm_snapshot_analysis/README.md
index 18a7f5a..2aec2e0 100644
--- a/pkg/vm_snapshot_analysis/README.md
+++ b/pkg/vm_snapshot_analysis/README.md
@@ -1,4 +1,5 @@
-# vm_snapshot_analysis
+[![pub package](https://img.shields.io/pub/v/vm_snapshot_analysis.svg)](https://pub.dev/packages/vm_snapshot_analysis)
+[![package publisher](https://img.shields.io/pub/publisher/vm_snapshot_analysis.svg)](https://pub.dev/packages/vm_snapshot_analysis/publisher)
This package provides libraries and a utility for analysing the size and
contents of Dart VM AOT snapshots based on the output of
@@ -141,7 +142,6 @@
└── package:package_config (total 64039 bytes)
```
-
### `compare`
```console
diff --git a/pkg/vm_snapshot_analysis/pubspec.yaml b/pkg/vm_snapshot_analysis/pubspec.yaml
index b38740a..20c3302 100644
--- a/pkg/vm_snapshot_analysis/pubspec.yaml
+++ b/pkg/vm_snapshot_analysis/pubspec.yaml
@@ -1,5 +1,5 @@
name: vm_snapshot_analysis
-version: 0.7.1
+version: 0.7.2
description: Utilities for analysing AOT snapshot size.
repository: https://github.com/dart-lang/sdk/tree/main/pkg/vm_snapshot_analysis
diff --git a/runtime/vm/heap/pages.cc b/runtime/vm/heap/pages.cc
index f1c3ed4..53381e2 100644
--- a/runtime/vm/heap/pages.cc
+++ b/runtime/vm/heap/pages.cc
@@ -1709,10 +1709,12 @@
#endif
if (FLAG_log_growth || FLAG_verbose_gc) {
- THR_Print("%s: threshold=%" Pd "kB, idle_threshold=%" Pd "kB, reason=%s\n",
+ THR_Print("%s: hard_threshold=%" Pd "MB, soft_threshold=%" Pd
+ "MB, idle_threshold=%" Pd "MB, reason=%s\n",
heap_->isolate_group()->source()->name,
- RoundWordsToKB(hard_gc_threshold_in_words_),
- RoundWordsToKB(idle_gc_threshold_in_words_), reason);
+ RoundWordsToMB(hard_gc_threshold_in_words_),
+ RoundWordsToMB(soft_gc_threshold_in_words_),
+ RoundWordsToMB(idle_gc_threshold_in_words_), reason);
}
}
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 0b5f8bc..9e867c4 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -2628,12 +2628,8 @@
// If the size is greater than both kNewAllocatableSize and
// kAllocatablePageSize, the object must have been allocated to a new
// large page, which must already have been zero initialized by the OS.
-#if defined(DART_COMPRESSED_POINTERS)
- needs_init = true;
-#else
needs_init = Heap::IsAllocatableInNewSpace(size) ||
Heap::IsAllocatableViaFreeLists(size);
-#endif
} else {
initial_value = static_cast<uword>(null_);
#if defined(DART_COMPRESSED_POINTERS)
diff --git a/tools/VERSION b/tools/VERSION
index 3ea86a6..92973e7 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 18
PATCH 0
-PRERELEASE 156
+PRERELEASE 157
PRERELEASE_PATCH 0
\ No newline at end of file