Порівняти коміти

..
Автор SHA1 Повідомлення Дата
l0ng-ai 33bb5c5597 fix(run): run Dart test files with flutter test / dart test
A *_test.dart file ran with `dart run`, which can't load Flutter code
(dart:ui) and doesn't run package:test suites as tests. In a Flutter app
it now runs with `flutter test <file>` from the app's folder, elsewhere
with `dart test <file>`.
2026-11-19 11:16:54 +08:00
l0ng-ai e36cd37e56 fix(run): run a Flutter app's Dart files with flutter run (#4409)
Current File (and Run on a Dart file) ran `dart run <file>` even inside a
Flutter app, which can't start a Flutter program. In a folder with a
detected Flutter configuration the file now runs and debugs as the app,
`flutter run -t <file>` from the app's folder, on the toolbar's device.
Dart files outside a Flutter app keep `dart run`.
2026-11-19 11:01:17 +08:00
l0ng-ai 0f652824b3 fix(database): don't leave the tree loading after a disconnect or rename (#4406)
Disconnecting a data source (Deactivate, or Auto-disconnect when idle)
forgets what it loaded, but its expanded tree nodes stayed expanded and
showed Loading until collapsed by hand, since only expanding a node loads
its children. A disconnect now also collapses the nodes of what it
forgot: the source with all its databases, or one database. Renaming a
source dropped its metadata the same way; it now saves like any edit,
which reloads what the tree had expanded.

Fixes #4388
2026-11-19 10:51:01 +08:00
2 змінених файлів з 51 додано та 1 видалено

No files matched your search

+30
Переглянути файл
@@ -776,6 +776,36 @@ describe("project producers", () => {
expect(produceContext({ path: `${ROOT}/a.tscn`, root: ROOT, configs: [] }, OPTIMISTIC)).toBeNull();
});
it("Dart files of a Flutter app run as the app (flutter run -t) in the app's folder", () => {
const flutter = [
cfg({ id: "flutter:run", kind: "flutter", command: "flutter", args: ["run", "-t", "lib/main.dart"], cwd: "app" }),
];
const p = produceContext({ path: `${ROOT}/app/lib/demo.dart`, root: ROOT, configs: flutter }, ALL)!;
expect(p).toMatchObject({ name: "demo.dart", scope: "file" });
expect(p.config).toMatchObject({
kind: "flutter",
command: "flutter",
args: ["run", "-t", "lib/demo.dart"],
cwd: "app",
debugAdapter: "dart",
});
// Its tests run with `flutter test`, a Dart package's with `dart test`.
expect(run({ path: `${ROOT}/app/test/widget_test.dart`, root: ROOT, configs: flutter })).toMatchObject({
command: "flutter",
args: ["test", "test/widget_test.dart"],
cwd: "app",
});
expect(run({ path: `${ROOT}/tool/test/gen_test.dart`, root: ROOT, configs: flutter })).toMatchObject({
command: "/bin/dart",
args: ["test", "tool/test/gen_test.dart"],
});
// Outside the app (a Dart package next to it): `dart run`.
expect(run({ path: `${ROOT}/tool/gen.dart`, root: ROOT, configs: flutter })).toMatchObject({
command: "/bin/dart",
args: ["run", "tool/gen.dart"],
});
});
it("keeps package.json test files on the project's runner", () => {
const p = produceContext(
{ path: `${ROOT}/src/a.test.ts`, root: ROOT, configs, content: "test('x', () => {})" },
+21 -1
Переглянути файл
@@ -438,6 +438,7 @@ function site(input: ContextInput): FileSite {
ruby: ["ruby", "rake", "rspec"],
php: ["php", "phpunit", "composer"],
zig: ["zig", "zig-application"],
dart: ["flutter"],
};
const owner =
inside && language
@@ -992,8 +993,27 @@ export function produceFile(input: ContextInput, env: ToolEnv): Produced | null
return simple(lang, s, env, lang, () => [s.arg]);
case "r":
return simple(lang, s, env, "r", () => [s.arg]);
case "dart":
case "dart": {
// A file of a Flutter app runs as the app (`flutter run -t`), on the toolbar's device.
const app = s.inProject
? allClosest(
input.configs.filter((c) => c.kind === "flutter"),
s.idPath,
)[0]
: undefined;
// A test file runs its tests (`flutter test` / `dart test`); `dart run` can't run Flutter code.
const test = /_test\.dart$/.test(s.file);
if (app && test)
return { name: s.file, scope: "file", config: fileConfig(s, "dart", app.command, ["test", s.arg]) };
if (app)
return {
name: s.file,
scope: "file",
config: fileConfig(s, "flutter", app.command, ["run", "-t", s.arg], "dart"),
};
if (test) return simple(lang, s, env, "dart", () => ["test", s.arg]);
return simple(lang, s, env, "dart", () => ["run", s.arg], "dart");
}
case "scala":
return simple(lang, s, env, "scala-cli", () => ["run", s.arg]);
case "kotlin":