chore: adopt Dart 3.9 toolchain — honest floor + tall-style reformat (T-353)
Raise the declared minimums in pubspec.yaml to what our deps already require: Flutter >=3.35.0 / Dart >=3.9.0 (was 3.19.0 / 3.5.0). alchemist 0.12 needs Flutter 3.32; Dart 3.9 first ships in Flutter 3.35, so 3.35 is the binding floor. Pin the exact build toolchain in .fvmrc (Flutter 3.44.1). Moving to the Dart 3.9 language level switches `dart format` to the new "tall" style and enables two new lints. This commit is the resulting mechanical churn, isolated from any behaviour change: - whole-tree `dart format` reformat (tall style) - `dart fix` for unnecessary_underscores + use_null_aware_elements No runtime behaviour change; `make test` green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -31,12 +31,7 @@ void main() {
|
||||
FindInFilesController make() => ctrl = FindInFilesController(ipc: f.ipc, events: f.services.events);
|
||||
|
||||
void emitMatch(String id, List<Map<String, Object?>> matches) {
|
||||
f.services.events.emit(DaemonEvent(
|
||||
subsystem: 'search',
|
||||
kind: 'search.match',
|
||||
data: {'searchId': id, 'matches': matches},
|
||||
ts: DateTime.now().toUtc(),
|
||||
));
|
||||
f.services.events.emit(DaemonEvent(subsystem: 'search', kind: 'search.match', data: {'searchId': id, 'matches': matches}, ts: DateTime.now().toUtc()));
|
||||
}
|
||||
|
||||
Map<String, Object?> m(String path, int line) => {'path': path, 'line': line, 'matchStart': 0, 'matchEnd': 3, 'preview': 'foo bar'};
|
||||
@@ -93,12 +88,9 @@ void main() {
|
||||
test('search.done clears running', () async {
|
||||
final c = make();
|
||||
await c.run('foo');
|
||||
f.services.events.emit(DaemonEvent(
|
||||
subsystem: 'search',
|
||||
kind: 'search.done',
|
||||
data: const {'searchId': 's1', 'cancelled': false},
|
||||
ts: DateTime.now().toUtc(),
|
||||
));
|
||||
f.services.events.emit(
|
||||
DaemonEvent(subsystem: 'search', kind: 'search.done', data: const {'searchId': 's1', 'cancelled': false}, ts: DateTime.now().toUtc()),
|
||||
);
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
expect(c.running, isFalse);
|
||||
expect(c.done, isTrue);
|
||||
@@ -107,12 +99,9 @@ void main() {
|
||||
test('search.error surfaces the message', () async {
|
||||
final c = make();
|
||||
await c.run('(bad');
|
||||
f.services.events.emit(DaemonEvent(
|
||||
subsystem: 'search',
|
||||
kind: 'search.error',
|
||||
data: const {'searchId': 's1', 'message': 'invalid regex: x'},
|
||||
ts: DateTime.now().toUtc(),
|
||||
));
|
||||
f.services.events.emit(
|
||||
DaemonEvent(subsystem: 'search', kind: 'search.error', data: const {'searchId': 's1', 'message': 'invalid regex: x'}, ts: DateTime.now().toUtc()),
|
||||
);
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
expect(c.error, contains('invalid regex'));
|
||||
expect(c.running, isFalse);
|
||||
@@ -151,11 +140,12 @@ void main() {
|
||||
|
||||
test('a failed search.grep surfaces the error', () async {
|
||||
f.ipc.stub(
|
||||
'search.grep',
|
||||
(_) async => IpcResponse.err(
|
||||
id: '',
|
||||
error: IpcError(code: IpcExitCode.userError, kind: IpcErrorKind.userError, message: 'nope'),
|
||||
));
|
||||
'search.grep',
|
||||
(_) async => IpcResponse.err(
|
||||
id: '',
|
||||
error: IpcError(code: IpcExitCode.userError, kind: IpcErrorKind.userError, message: 'nope'),
|
||||
),
|
||||
);
|
||||
final c = make();
|
||||
await c.run('foo');
|
||||
expect(c.error, 'nope');
|
||||
|
||||
@@ -28,17 +28,19 @@ void main() {
|
||||
tearDown(() => f.dispose());
|
||||
|
||||
void emitMatches() {
|
||||
f.services.events.emit(DaemonEvent(
|
||||
subsystem: 'search',
|
||||
kind: 'search.match',
|
||||
data: const {
|
||||
'searchId': 's1',
|
||||
'matches': [
|
||||
{'path': 'lib/a.dart', 'line': 12, 'matchStart': 6, 'matchEnd': 9, 'preview': 'final foo = 1;'},
|
||||
],
|
||||
},
|
||||
ts: DateTime.now().toUtc(),
|
||||
));
|
||||
f.services.events.emit(
|
||||
DaemonEvent(
|
||||
subsystem: 'search',
|
||||
kind: 'search.match',
|
||||
data: const {
|
||||
'searchId': 's1',
|
||||
'matches': [
|
||||
{'path': 'lib/a.dart', 'line': 12, 'matchStart': 6, 'matchEnd': 9, 'preview': 'final foo = 1;'},
|
||||
],
|
||||
},
|
||||
ts: DateTime.now().toUtc(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
testWidgets('search renders matches grouped by file', (tester) async {
|
||||
@@ -79,12 +81,9 @@ void main() {
|
||||
await tester.enterText(find.byType(EditableText).first, 'foo');
|
||||
await tester.pump(const Duration(milliseconds: 250));
|
||||
await pumpAsync(tester);
|
||||
f.services.events.emit(DaemonEvent(
|
||||
subsystem: 'search',
|
||||
kind: 'search.done',
|
||||
data: const {'searchId': 's1', 'cancelled': false},
|
||||
ts: DateTime.now().toUtc(),
|
||||
));
|
||||
f.services.events.emit(
|
||||
DaemonEvent(subsystem: 'search', kind: 'search.done', data: const {'searchId': 's1', 'cancelled': false}, ts: DateTime.now().toUtc()),
|
||||
);
|
||||
await pumpAsync(tester);
|
||||
expect(find.text('No results'), findsOneWidget);
|
||||
});
|
||||
@@ -94,12 +93,9 @@ void main() {
|
||||
await tester.enterText(find.byType(EditableText).first, '(bad');
|
||||
await tester.pump(const Duration(milliseconds: 250));
|
||||
await pumpAsync(tester);
|
||||
f.services.events.emit(DaemonEvent(
|
||||
subsystem: 'search',
|
||||
kind: 'search.error',
|
||||
data: const {'searchId': 's1', 'message': 'invalid regex: boom'},
|
||||
ts: DateTime.now().toUtc(),
|
||||
));
|
||||
f.services.events.emit(
|
||||
DaemonEvent(subsystem: 'search', kind: 'search.error', data: const {'searchId': 's1', 'message': 'invalid regex: boom'}, ts: DateTime.now().toUtc()),
|
||||
);
|
||||
await pumpAsync(tester);
|
||||
expect(find.textContaining('invalid regex'), findsOneWidget);
|
||||
});
|
||||
@@ -136,10 +132,7 @@ void main() {
|
||||
await seedReplace(tester);
|
||||
// The emitted match line is 'final foo = 1;' → preview shows the after
|
||||
// (rendered as a RichText span, so match on the plain text).
|
||||
expect(
|
||||
find.byWidgetPredicate((w) => w is RichText && w.text.toPlainText() == 'final bar = 1;'),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.byWidgetPredicate((w) => w is RichText && w.text.toPlainText() == 'final bar = 1;'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('Replace all on a dirty tree shows a guard dialog, no apply', (tester) async {
|
||||
@@ -226,12 +219,13 @@ void main() {
|
||||
|
||||
testWidgets('Markdown mode lists markdown files on switch', (tester) async {
|
||||
f.ipc.stub(
|
||||
'pql.files',
|
||||
(_) async => _ok({
|
||||
'files': [
|
||||
{'path': 'docs/initial-plan.md'},
|
||||
],
|
||||
}));
|
||||
'pql.files',
|
||||
(_) async => _ok({
|
||||
'files': [
|
||||
{'path': 'docs/initial-plan.md'},
|
||||
],
|
||||
}),
|
||||
);
|
||||
await tester.pumpWidget(harness(f, const SearchPanelView()));
|
||||
await pumpAsync(tester);
|
||||
|
||||
@@ -243,11 +237,12 @@ void main() {
|
||||
|
||||
testWidgets('Vault mode surfaces a pql search error', (tester) async {
|
||||
f.ipc.stub(
|
||||
'pql.search',
|
||||
(_) async => IpcResponse.err(
|
||||
id: '',
|
||||
error: IpcError(code: IpcExitCode.toolError, kind: IpcErrorKind.toolError, message: 'pql down'),
|
||||
));
|
||||
'pql.search',
|
||||
(_) async => IpcResponse.err(
|
||||
id: '',
|
||||
error: IpcError(code: IpcExitCode.toolError, kind: IpcErrorKind.toolError, message: 'pql down'),
|
||||
),
|
||||
);
|
||||
await tester.pumpWidget(harness(f, const SearchPanelView()));
|
||||
await pumpAsync(tester);
|
||||
await tester.tap(find.text('Vault'));
|
||||
|
||||
Reference in New Issue
Block a user