diff --git a/desktop/internal/i18n/shared.generated.go b/desktop/internal/i18n/shared.generated.go index c9654a1e8f..79dbaa4711 100644 --- a/desktop/internal/i18n/shared.generated.go +++ b/desktop/internal/i18n/shared.generated.go @@ -76,6 +76,7 @@ var sharedCatalogs = map[string]map[string]string{ "desktop.build.chooseTaskScope": "Choose a project or target this task runs on first.", "desktop.build.commandUnsupported": "This build system answered with a command plan; provider-backed tasks are required here.", "desktop.build.debugTarget": "Debug", + "desktop.build.dependenciesHelp": "The build tool reads the dependency tree only when this is first opened, which can take a while as the tool runs. The tree is then kept until the build systems are detected again or Reload is chosen on the build system or on Dependencies.", "desktop.build.emptyOutput": "Run a build task to see output.", "desktop.build.executableMissing": "No usable build executable was found for this build system.", "desktop.build.exited": "Build exited with code {code}.", @@ -2524,6 +2525,7 @@ var sharedCatalogs = map[string]map[string]string{ "desktop.build.chooseTaskScope": "请先选择此任务可以运行的项目或目标。", "desktop.build.commandUnsupported": "此构建系统返回了命令计划;当前接入需要提供者驱动的任务。", "desktop.build.debugTarget": "调试", + "desktop.build.dependenciesHelp": "第一次展开时才让构建工具读取依赖树,构建工具运行期间可能要等一会儿。读到的依赖会一直保留,直到重新检测构建系统,或在构建系统或“依赖”上选“重新加载”。", "desktop.build.emptyOutput": "运行构建任务以查看输出。", "desktop.build.executableMissing": "未找到此构建系统可用的构建程序。", "desktop.build.exited": "构建以代码 {code} 退出。", diff --git a/desktop/internal/workbench/build_panels_visual_test.go b/desktop/internal/workbench/build_panels_visual_test.go index 9b26bbfdd9..f192b529f4 100644 --- a/desktop/internal/workbench/build_panels_visual_test.go +++ b/desktop/internal/workbench/build_panels_visual_test.go @@ -59,9 +59,39 @@ func visualBuildSystems() []buildInstance { } } +// visualGoModule is one Go module whose targets are named by their whole import path, under +// the folder each is in, which their rows show alone. Two of its packages are commands, which +// run; the others are packages with tests. +func visualGoModule() buildInstance { + const module = "github.com/example/shop/desktop" + pkg := func(dir, tag string) core.BuildTarget { + return core.BuildTarget{ID: dir, ProjectID: "desktop", Name: module + "/" + dir, Path: dir, Tags: []string{tag}} + } + return buildInstance{ + BuildInstance: core.BuildInstance{ID: "go@desktop", PluginID: "dev.example.go", BuildSystemID: "go", Root: "desktop"}, + PluginID: "dev.example.go", + System: pluginservice.BuildSystemDeclaration{ + DisplayName: "Go Modules", + Runs: []pluginservice.BuildRunDeclaration{{ID: "main", Name: "Run", Tags: []string{"application"}}}, + Tasks: []pluginservice.BuildTaskDeclaration{{ID: "build", DisplayName: "Build", Source: "provider"}, {ID: "vet", DisplayName: "Vet", Source: "provider"}}, + Dependencies: &pluginservice.BuildDependenciesDeclaration{Scopes: []string{"project"}}, + }, + Model: core.BuildModel{ + Projects: []core.BuildProject{{ID: "desktop", Path: ".", Name: module}}, + Targets: []core.BuildTarget{ + pkg("cmd/shop", "application"), pkg("cmd/shop-perf", "application"), + pkg("internal/checkout", "test"), pkg("internal/catalog", "test"), pkg("internal/catalog/search", "test"), + pkg("internal/payments", "test"), pkg("internal/storage", "test"), pkg("internal/i18n", "test"), + }, + }, + modelLoaded: true, + } +} + // TestVisualBuildPanels captures the Build window on the right, with the run configurations // above the aggregated build tree, beside the Run window at the bottom showing only the build -// console, and the Build window filtered. +// console; the Build window filtered; and a Go module, whose runnable rows lead with the green +// triangle. func TestVisualBuildPanels(t *testing.T) { out := os.Getenv("LITHE_VISUAL_OUTPUT_DIR") if out == "" { @@ -71,7 +101,7 @@ func TestVisualBuildPanels(t *testing.T) { t.Fatal(err) } for _, look := range []struct{ theme, language string }{{"dark", "zh-Hans"}, {"light", "en"}} { - for _, scene := range []string{"build-and-run", "build-filter"} { + for _, scene := range []string{"build-and-run", "build-filter", "build-go-targets"} { t.Run(scene+"-"+look.theme, func(t *testing.T) { prefs := store.At(t.TempDir()) if err := prefs.Save(settingsFile, settings{Theme: themeChoice(look.theme), Language: look.language, DisableAutoSave: true}); err != nil { @@ -130,6 +160,12 @@ func TestVisualBuildPanels(t *testing.T) { }) case "build-filter": h.app.post(func(*App) { p.panels.buildFilter = "app" }) + case "build-go-targets": + h.app.post(func(a *App) { + p.build.instances, p.build.selected = []buildInstance{visualGoModule()}, 0 + p.build.projectID, p.build.targetID, p.build.taskID = "desktop", "internal/catalog", "" + a.refreshRunConfigurations(p) + }) } h.settleChain() h.app.invalidator.Invalidate() diff --git a/desktop/internal/workbench/build_tree_test.go b/desktop/internal/workbench/build_tree_test.go index 9980705ead..ef09d9a625 100644 --- a/desktop/internal/workbench/build_tree_test.go +++ b/desktop/internal/workbench/build_tree_test.go @@ -425,6 +425,71 @@ func (k *captureBuildTask) PlanBuildTask(_ context.Context, _ json.RawMessage, _ return core.BuildPlan{}, errors.New("captured") } +// A task, and a target that has a run, lead with the green triangle that runs them whether +// they are chosen or not, as IntelliJ's Make window marks its targets: one click on it chooses +// the row and runs it. A target with nothing to run keeps the icon of its kind, a build +// operation in flight leaves no triangle to click, a row's hover hint holds its whole name and +// path, and the Dependencies heading has the ⓘ that says when its tree is read. +func TestBuildTreeRunMarksRunTheirRowsAtOnce(t *testing.T) { + instance := runConfigInstance("app") + instance.System.Tasks = []pluginservice.BuildTaskDeclaration{{ID: "vet", DisplayName: "Vet verification", Scopes: []string{"project"}, Source: "provider"}} + instance.System.Dependencies = &pluginservice.BuildDependenciesDeclaration{Scopes: []string{"project"}} + instance.Model.Targets[0].Path = "server/cmd/main" + kernel := &captureBuildTask{Kernel: &testKernel{Client: core.NewClient()}, requests: make(chan core.BuildPlanRequest, 1)} + h, p := openBuildTree(t, kernel, []buildInstance{instance}) + h.app.reduceChrome(core.SetChromeOpen(itemBuild, true)) + if err := h.driver.Resize(1280, 1400); err != nil { + t.Fatal(err) + } + h.settle() + h.settle() + text, language := h.app.text.Build, h.app.language() + controls := func(label string) []gfx.Hit { + var found []gfx.Hit + for _, hit := range h.driver.Snapshot().Hits { + if hit.Label == label && !hit.IsLabel { + found = append(found, hit) + } + } + return found + } + if marks := controls(text.RunTarget("Run")); len(marks) != 1 { + t.Fatalf("%d target triangles, want only the one of the target that has a run", len(marks)) + } + task := controls(text.RunTarget("Vet verification")) + if len(task) != 1 || task[0].Hint != text.RunTarget("Vet verification") { + t.Fatalf("the task's triangle is %+v", task) + } + if rows := controls("Main"); len(rows) != 1 || rows[0].Hint != "Main\nserver/cmd/main" { + t.Fatalf("the target row's hover hint is %+v", rows) + } + help := controls(i18n.Shared(language, "native.moreInformation")) + if len(help) != 1 || help[0].Hint != i18n.Shared(language, "desktop.build.dependenciesHelp") { + t.Fatalf("the Dependencies heading's ⓘ is %+v", help) + } + + // One click on the triangle of a task nothing chose chooses it and runs it. + if p.build.taskID != "" || p.build.targetID != "" { + t.Fatalf("task %q and target %q chosen before the click", p.build.taskID, p.build.targetID) + } + h.click(center(task[0].Bounds)) + awaitStateWithin(t, h, 10*time.Second, "the task plan request", func() bool { return len(kernel.requests) == 1 }) + if request := <-kernel.requests; request.Task != "vet" || p.build.taskID != "vet" { + t.Fatalf("the triangle asked for %+v with task %q chosen", request, p.build.taskID) + } + awaitStateWithin(t, h, 10*time.Second, "the refused plan", func() bool { return p.build.operation == nil }) + + // While a build operation runs, no triangle takes a click. + var operation *buildOperation + h.app.post(func(a *App) { operation = a.beginBuildOperation(p, "build", "vet", "") }) + h.settle() + if len(controls(text.RunTarget("Vet verification"))) != 0 || len(controls(text.RunTarget("Run"))) != 0 { + t.Fatal("a triangle took clicks while a build operation ran") + } + h.app.post(func(a *App) { a.finishBuildTask(p, operation, json.RawMessage(`{"exitCode":0}`)) }) + h.settle() +} + // A task row of the tree carries no project, so the run fits the selection to the task: a // project task runs on the build system's only project instead of the workspace, a model task // on its own project, and a project task with no project to infer asks for one. diff --git a/desktop/internal/workbench/build_tree_view.go b/desktop/internal/workbench/build_tree_view.go index f3b9805629..3cce7e8aa7 100644 --- a/desktop/internal/workbench/build_tree_view.go +++ b/desktop/internal/workbench/build_tree_view.go @@ -325,7 +325,8 @@ var buildSectionIcons = map[string]*gfx.Icon{ // buildSectionRow declares the heading of one section of a group: its arrow, icon, name and // how many rows it holds, once that is known. A click opens or closes it, unless a filter -// keeps it open. The Dependencies and Discovered Tests headings have the menu of their rows. +// keeps it open. The Dependencies and Discovered Tests headings have the menu of their rows, +// and the Dependencies heading the ⓘ that says when its tree is read. func (a *App) buildSectionRow(row ui.ListRow, p *project, instance *buildInstance, spec buildRow) { c := row.C element := a.buildTreeRowElement(row, spec) @@ -337,6 +338,13 @@ func (a *App) buildSectionRow(row ui.ListRow, p *project, instance *buildInstanc if spec.count >= 0 { ui.Text(c, strconv.Itoa(spec.count)).FontSize(treeFontSize - 1).Color(a.colors.Subtle).Shrink(0) } + if spec.section == buildSectionDependencies { + // The heading shows no count until the tree is read, and opening it runs the build + // tool, so the ⓘ says when that happens and how to read it again. + language := a.language() + ui.Button(c.Part("help"), i18n.Shared(language, "native.moreInformation")).Icon(icons.Info).IconOnly().Ghost().Size(18, 18). + Tooltip(i18n.Shared(language, "desktop.build.dependenciesHelp")).TooltipOn(ui.TooltipRight) + } ui.Spacer(c) if !spec.fixed && (toggled || element.Clicked()) { key, open := buildOpenKey(instance.ID, spec.section), spec.open @@ -398,33 +406,65 @@ func (a *App) buildNoteRow(row ui.ListRow, p *project, instance *buildInstance, } } -// buildItemIcons are the icons of the rows a user chooses or runs. +// buildItemIcons are the icons of the rows a user chooses or runs that have nothing to run. var buildItemIcons = map[buildRowKind]*gfx.Icon{ buildRowProject: &icons.Folder, buildRowTarget: &icons.CircleDot, buildRowTask: &icons.SquareTerminal, } -// buildItemRow declares a project, target or task: its icon, name and detail. A click chooses -// it, in its build system, which it selects first, and a click on the row already chosen lets -// it go; a double click runs a task or a target's first run, and opens a project's build file. -// The chosen target or task has the button that runs it, and a target whose first run debugs -// the button that debugs it. -func (a *App) buildItemRow(row ui.ListRow, p *project, instance *buildInstance, spec buildRow) { - c, b := row.C, &p.build - element := a.buildTreeRowElement(row, spec) +// buildDetailShrink is how much faster than its name a row's detail gives way when the row is +// too narrow for both: the path goes first, and the name gives way only once the path is gone. +const buildDetailShrink = 1000 + +// buildRunMark declares the green triangle that leads a row that runs, in the place of its +// kind's icon, as IntelliJ's Make window marks every target it runs, and reports a click on +// it. label names what the click starts, for its hover hint and for assistive technology. +// While a build operation runs or the model loads, the triangle is dimmed and takes no click, +// and a click there falls to the row. +func (a *App) buildRunMark(c ui.C, label string, disabled bool) bool { + k := c.Part("run") + // As wide as the icons of the rows beside it, so the names line up. + slot := ui.Row(k).Size(14, treelist.Icon).Shrink(0).Center() + if disabled { + slot.Children(func() { + ui.Icon(k, icons.Play).Size(14, 14).Color(a.colors.Subtle).Opacity(0.5) + }) + return false + } + slot = slot.HitWith(ui.ID(k), label, gfx.HitOptions{Role: gfx.RoleButton, Cursor: gfx.PointerCursorHand, SkipFocus: true}).Tooltip(label) + slot.Children(func() { + ui.Icon(k, icons.Play).Size(14, 14).Color(a.colors.Success) + }) + return slot.Clicked() +} + +// buildItemTip is the hover hint of a project, target or task row: its whole name and, under +// it, its whole detail, which a narrow window cuts short; or the row's own tooltip, the full +// name of a target that shows only its path (buildTargetLabel). +func buildItemTip(spec buildRow) string { if spec.tooltip != "" { - element = element.Tooltip(spec.tooltip) + return spec.tooltip } - ui.Row(c.Part("arrow")).Size(treelist.Disclosure, treelist.Icon).Shrink(0) - if icon := buildItemIcons[spec.kind]; icon != nil { - ui.Icon(c, *icon).Size(14, 14).Shrink(0).Color(a.colors.Subtle) + if spec.detail == "" || spec.detail == spec.label { + return spec.label } - ui.Text(c, spec.label).FontSize(treeFontSize).Color(treelist.Text(a.colors.Dark)).Ellipsis().Shrink(0).MaxWidth(320) - if spec.detail != "" { - ui.Text(c, spec.detail).FontSize(treeFontSize - 1).Color(a.colors.Subtle).Ellipsis().Shrink(1).MinWidth(0) + return spec.label + "\n" + spec.detail +} + +// buildItemRow declares a project, target or task: its icon, name and detail. A task, and a +// target that has a run, lead with the green triangle that runs it; the others lead with the +// icon of their kind. A click chooses the row, in its build system, which it selects first, +// and a click on the row already chosen lets it go; a double click runs a task or a target's +// first run, and opens a project's build file. The chosen target whose first run debugs has +// the button that debugs it. When the row is too narrow, the detail gives way before the +// name, and the hover hint shows both whole. +func (a *App) buildItemRow(row ui.ListRow, p *project, instance *buildInstance, spec buildRow) { + c, b := row.C, &p.build + element := a.buildTreeRowElement(row, spec) + if tip := buildItemTip(spec); tip != "" { + element = element.Tooltip(tip) } - ui.Spacer(c) busy := b.operation != nil || instance.modelLoading index := spec.instance // choose makes the row the window's choice; run, when set, then starts what it runs. @@ -444,7 +484,8 @@ func (a *App) buildItemRow(row ui.ListRow, p *project, instance *buildInstance, runLabel := "" switch spec.kind { case buildRowTask: - runLabel = i18n.Shared(a.language(), "desktop.runConfig.run") + // Every task row has its triangle, so each names its own task. + runLabel = a.text.Build.RunTarget(spec.label) run = func() { a.runSelectedBuildTask(p) } case buildRowTarget: if action, ok := buildPrimaryAction(instance, spec.target); ok { @@ -456,14 +497,24 @@ func (a *App) buildItemRow(row ui.ListRow, p *project, instance *buildInstance, } } } - if spec.selected && run != nil && a.gitIconButton(c.Part("run"), runLabel, icons.Play, false, busy) { - c.After(func() { - a.performed("build.item.run", surfaceButton) - choose() - run() - a.showBuildConsole(p) - }) + ui.Row(c.Part("arrow")).Size(treelist.Disclosure, treelist.Icon).Shrink(0) + if run != nil { + if a.buildRunMark(c, runLabel, busy) { + c.After(func() { + a.performed("build.item.run", surfaceButton) + choose() + run() + a.showBuildConsole(p) + }) + } + } else if icon := buildItemIcons[spec.kind]; icon != nil { + ui.Icon(c, *icon).Size(14, 14).Shrink(0).Color(a.colors.Subtle) + } + ui.Text(c, spec.label).FontSize(treeFontSize).Color(treelist.Text(a.colors.Dark)).Ellipsis().Shrink(1).MinWidth(0) + if spec.detail != "" { + ui.Text(c, spec.detail).FontSize(treeFontSize - 1).Color(a.colors.Subtle).Ellipsis().Shrink(buildDetailShrink).MinWidth(0) } + ui.Spacer(c) if spec.selected && debug != nil && a.gitIconButton(c.Part("debug"), i18n.Shared(a.language(), "desktop.build.debugTarget"), icons.Bug, false, busy || p.debug.preparing) { c.After(func() { a.performed("build.target.debug", surfaceButton) diff --git a/desktop/internal/workbench/notifications_test.go b/desktop/internal/workbench/notifications_test.go index 5b315c6362..2883cd5abd 100644 --- a/desktop/internal/workbench/notifications_test.go +++ b/desktop/internal/workbench/notifications_test.go @@ -21,6 +21,8 @@ func TestRepeatedNoticesAreOneEntryWithACount(t *testing.T) { h.app.notify("Index ready") clock = clock.Add(time.Minute) h.app.notify("Build failed") + // The notices came outside a frame: ask for the repaint the window would make. + h.app.invalidator.Invalidate() h.settle() list := h.app.notifications.list @@ -46,6 +48,7 @@ func TestNotificationBellOpensReadsAndClearsTheHistory(t *testing.T) { h.open(t.TempDir()) h.app.notify("Plugin updated") h.app.notify("Index ready") + h.app.invalidator.Invalidate() h.settle() h.clickNamed("Notifications, 2 unread") @@ -88,6 +91,7 @@ func TestNoticesKeepTheirKindAndShowAtMostThreeToasts(t *testing.T) { h.app.notifySuccess("Sync") h.app.notifyInfo("Index ready") h.app.notify("Disk almost full") + h.app.invalidator.Invalidate() h.settle() list := h.app.notifications.list diff --git a/docs/assets/build-panels/README.md b/docs/assets/build-panels/README.md index 73ffc37ecf..4363844842 100644 --- a/docs/assets/build-panels/README.md +++ b/docs/assets/build-panels/README.md @@ -8,6 +8,7 @@ | --- | --- | --- | | 右侧构建窗口(运行配置列表和聚合构建树)与底部运行窗口(只显示构建控制台) | [截图](build-and-run-dark.png) | [截图](build-and-run-light.png) | | 构建窗口按名称筛选 | [截图](build-filter-dark.png) | [截图](build-filter-light.png) | +| Go 模块的目标以完整导入路径命名,行上只显示所在目录:可运行的目标和任务行首是绿色运行按钮,依赖标题旁有 ⓘ | [截图](build-go-targets-dark.png) | [截图](build-go-targets-light.png) | 复验:设置 `LITHE_VISUAL_OUTPUT_DIR`,通过 `scripts/desktop/desktop-go.sh test -tags vivahead,lithevisual ./internal/workbench -run '^TestVisualBuildPanels' diff --git a/docs/assets/build-panels/build-and-run-dark.png b/docs/assets/build-panels/build-and-run-dark.png index bfc184a716..7acd4e043f 100644 Binary files a/docs/assets/build-panels/build-and-run-dark.png and b/docs/assets/build-panels/build-and-run-dark.png differ diff --git a/docs/assets/build-panels/build-and-run-light.png b/docs/assets/build-panels/build-and-run-light.png index b23e82c5b6..58cb2673bd 100644 Binary files a/docs/assets/build-panels/build-and-run-light.png and b/docs/assets/build-panels/build-and-run-light.png differ diff --git a/docs/assets/build-panels/build-filter-dark.png b/docs/assets/build-panels/build-filter-dark.png index 3ffb8f17d6..b65adac7e2 100644 Binary files a/docs/assets/build-panels/build-filter-dark.png and b/docs/assets/build-panels/build-filter-dark.png differ diff --git a/docs/assets/build-panels/build-filter-light.png b/docs/assets/build-panels/build-filter-light.png index d1b6934c96..8c08073c0b 100644 Binary files a/docs/assets/build-panels/build-filter-light.png and b/docs/assets/build-panels/build-filter-light.png differ diff --git a/docs/assets/build-panels/build-go-targets-dark.png b/docs/assets/build-panels/build-go-targets-dark.png new file mode 100644 index 0000000000..1e1ea989c9 Binary files /dev/null and b/docs/assets/build-panels/build-go-targets-dark.png differ diff --git a/docs/assets/build-panels/build-go-targets-light.png b/docs/assets/build-panels/build-go-targets-light.png new file mode 100644 index 0000000000..5babb80c76 Binary files /dev/null and b/docs/assets/build-panels/build-go-targets-light.png differ diff --git a/shared/i18n/locales/en-US.json b/shared/i18n/locales/en-US.json index 817d09a2af..675f659e08 100644 --- a/shared/i18n/locales/en-US.json +++ b/shared/i18n/locales/en-US.json @@ -10997,6 +10997,7 @@ "desktop.terminal.runSelection": "Run Selection in Terminal", "desktop.build.debugTarget": "Debug", "desktop.build.filter": "Filter build systems, tasks and targets", + "desktop.build.dependenciesHelp": "The build tool reads the dependency tree only when this is first opened, which can take a while as the tool runs. The tree is then kept until the build systems are detected again or Reload is chosen on the build system or on Dependencies.", "desktop.build.noMatches": "No matching build items", "desktop.build.noDebugAdapter": "The build provider's own plugin declares no debug adapter that can start a prepared program.", "desktop.debug.consoleEmpty": "The debug session's output appears here.", diff --git a/shared/i18n/locales/zh-CN.json b/shared/i18n/locales/zh-CN.json index 3e27885c6e..7de45b11a8 100644 --- a/shared/i18n/locales/zh-CN.json +++ b/shared/i18n/locales/zh-CN.json @@ -10997,6 +10997,7 @@ "desktop.terminal.runSelection": "在终端运行选中内容", "desktop.build.debugTarget": "调试", "desktop.build.filter": "筛选构建系统、任务与目标", + "desktop.build.dependenciesHelp": "第一次展开时才让构建工具读取依赖树,构建工具运行期间可能要等一会儿。读到的依赖会一直保留,直到重新检测构建系统,或在构建系统或“依赖”上选“重新加载”。", "desktop.build.noMatches": "没有匹配的构建项", "desktop.build.noDebugAdapter": "该构建插件所属的插件没有声明可以启动已准备程序的调试适配器。", "desktop.debug.consoleEmpty": "调试会话的输出会显示在这里。", diff --git a/shared/i18n/messages.json b/shared/i18n/messages.json index b8e34e4e3b..b8605398c6 100644 --- a/shared/i18n/messages.json +++ b/shared/i18n/messages.json @@ -6610,6 +6610,13 @@ "desktop" ] }, + { + "id": "desktop.build.dependenciesHelp", + "description": "Hover hint of the information button on the Build window's Dependencies heading: when the dependency tree is read and how to read it again", + "platforms": [ + "desktop" + ] + }, { "id": "desktop.build.noMatches", "description": "Build tool window text when no build system, project, target, task or test matches the filter", diff --git a/shared/platform-feature-matrix/features/build-system-plugins.json b/shared/platform-feature-matrix/features/build-system-plugins.json index 106de0381a..e59a0619b8 100644 --- a/shared/platform-feature-matrix/features/build-system-plugins.json +++ b/shared/platform-feature-matrix/features/build-system-plugins.json @@ -67,7 +67,7 @@ }, "owner": "Extensions", "verification": "macOS 已接入 static、command、hostIntegration、provider 四种模型来源:宿主向 Core 声明 buildSystems 与 buildProviders 能力,插件市场因此列出兼容的 API 3 声明式和 Provider 版本;Provider 进程按插件、构建系统和工作区各自独立,经各自 stdio 用 JSON-RPC(LSP 基础协议)与宿主通信,initialize 协商 capabilities.experimental.litheBuild 后宿主才经 lsp.buildRequest 发送 lithe/build/model、lithe/build/dependencies,回复交给 Core 解码;共享写法只复用同一插件的语言服务器会话;进程只在用户加载模型或依赖时启动,切换工作区、关闭项目窗口、停止执行模块、停用或更新插件、退出应用时停止;ExecutionFeatureGraph.stop 经 BuildSystemService.stop 同时回收已就绪和初始化中的 Provider,停止后的初始化完成也不得重新登记会话;状态写入插件状态目录;每个已启用的构建系统插件在打开工作区后各有一个右侧工具窗口(标题为 displayName、图标为 icon),不依赖识别结果,工作区没有对应工程时窗口内显示未检测到该构建系统,工具栏放运行、参数任务、刷新和 presentation=toolbar 的开关,树顶部是 presentation=tree 的勾选选项,工程下按 category(缺省按 group)分级列出任务,再列测试、目标和依赖;内置 Maven 窗口与共享 Build 窗口已删除,Build Output 显示输出、诊断与测试结果。窗口恢复先激活所属插件模块,激活中的命令面板项禁用;参数任务遵守 workspace/project/target 作用范围与目标标签,模型或工作区变化后清除旧选择。隔离回归覆盖这些边界、窗口布局恢复及包内图标读取前后文件清单与字节不变;多实例的根目录选择器保留每个实例的模型候选和生效值,编辑多选时保留兄弟实例独有的已选值;显式清空按实例根持久化为空覆盖,检测、同步指纹、任务计划和语言服务器导入使用同一覆盖,兄弟编辑或重开不会恢复非空默认值,非空编辑清当前实例标记而共享编辑/重置清该选项全部标记;真实 Core、生产存储与服务回归核对最终 argv 和导入值;列表单选与多选支持 allowCustom 原生输入和移除已选自定义值,文本/文件/目录清空提交显式空字符串,只有重置删除覆盖。插件选项在项目打开、选项修改和模型加载完成后通过 Core build.languageImport 归一化为 mavenContext/javaGradle,与构建计划使用同一生效值,并在 Java 启动前等待同一工作区代次的最新配置;运行时准备后再等一次,覆盖等待期间失效。唯一发布回调优先 Maven 原地热更新,被拒绝时串行恢复重启;停用最后一个 Maven 插件时,仅清除曾带 Maven 输入的同一会话,纯 Gradle 首次启动保持 nil。Gradle 在下次启动生效,取消/重置拒绝旧检测与恢复任务,被动工具路径发现不执行 Wrapper/版本探测;没有对应插件导入输入时兼容原 Maven 设置。命令模型 run 配置尚未接入;buildProviders 2 已接入原生任务 lithe/build/execute,复用工作区进程并校验协议版本、进度/结果、取消/超时和旧结果隔离,真实安装包/工具工作流仍待验收,Provider 无操作系统级沙盒;Windows 宿主尚未调用 build.* 命令。自动化:cargo test -p lithe-core --lib build_systems、cargo test -p lithe-core --lib lsp、scripts/architecture/verify-shared-contracts.sh、./scripts/macos/test/test-macos.sh --filter 'BuildSystemToolWindowTests|RustBuildSystemOperationsTests|BuildSystemServiceTests|PluginMarketplaceServiceTests'。手动验证:安装 fixtures 中 build-static-file、build-command-stdout 形态的插件包,确认每个构建系统各出现一个工具窗口,列出工程、分级任务、选项和依赖,停用插件后窗口消失;执行任务与测试的 argv 与 build-plans.json 一致,停止与输出上限生效;JUnit 报告与 lineMatcher 诊断可跳转到源码;命令模型和项目内 Wrapper 只在用户点击加载或运行后启动;禁用插件后实例消失;Windows 接入后另需验证未信任工作区不启动任何模型命令或 Wrapper;build-provider 形态的自有 Provider 只在用户操作或工作区信任后启动、停用插件时停止,build-provider-language-server 形态复用语言服务器会话而不启动第二个进程;运行前后 app bundle 文件清单不变(scripts/desktop/verify/verify-runtime-bundle-immutability.sh)。;新路径选择使用 executableResolution 1 + settings 2,已发布 buildSystems 2 旧字段只作统一候选输入适配:MacBuildToolResolverTests 验证带空格绝对路径、权限与版本失败不回退,BuildSystemServiceTests 验证 Provider 失败不独立发现,RustBuildSystemOperationsTests 验证全局值接入。Cargo 独立仓库以显式本地 Core bridge 验证自选路径用于 metadata 和全部构建/测试/运行/清理;发布前需把独立仓库 sdk.lock.json 的宿主 pin 更新到包含该能力的已发布提交。;回归增加非法存储值不回默认、数组/priority/插入顺序与拒绝循环、宿主注入发现、空设置跳过和被动选择不探测;Language Server/Execution Provider 新清单语法尚未开放,Windows 不声明 executableResolution。;真实 Core + macOS resolver + BuildSystemService 组合回归覆盖前置 Runtime 缺失/版本不足时保留工具或后置 Runtime 的非空 setting 约束,Provider 不发送独立发现请求;全部设置为空时仍可回退。自定义 Runtime 先构造含所选目录的 PATH,再以同一环境探测与执行,同目录 helper 的带空格路径回归通过。;buildProviders 3 增加原生测试执行 lithe/build/test,筛选参数保持类型化,报告复用 JUnit/标准结果解析;旧协议明确拒绝测试,报告解析期间配置失效会取消操作并丢弃迟到结果。原生树已接入按需测试发现,Core 校验完整清单并保留模块身份,运行前重查当前清单;配置/源码/包变化、停用/重开使缓存或进行中的发现失效。真实 Maven 模块编译与单方法测试已有生产 macOS Provider 会话证据;Windows 工作流仍待验收。;buildProviders 4 应用目标准备接入原生 Build 树,构建进度在 Build Output 展示,验证后转交 RunService 解析工具与启动/停止应用;准备期间源码、选项、工作区或停用变化拒绝迟到启动,旧操作 ID 不得停止替换进程;Core 拒绝绝对可执行路径、越界目录/符号链接及超限参数环境。服务编排、调试与 Java/Maven 消费者迁移尚未完成;真实插件/发行包和 Windows 工作流仍待验收。;Run v2 本地层显式保存 Provider 选择器,参数保持原始数组;无 generated.json 也能读回/显示,重复保存保留 ID/其他配置/项目环境;重启重新进入当前 Provider,停止与晚到结果按身份隔离。原生入口保存工作区文档后再准备,Run 窗口在未生成旧配置时仍显示 Provider 输出。;Agent 入口回归从真实本地配置启动,验证准备到进程退出保持公开操作 ID、准备中停止与重启重新准备,旧 ID 不能停止替换操作;Provider 与进程为可控替身,真实插件端到端验收仍待完成。;配套独立仓库 Node/Java SDK 源码补齐协议 2/3/4 的处理器、版本准入与进度;无页面示例经真实 Core 验证非零构建退出码、精确筛选、运行前构建及准备计划、并行工作区、取消工具清理和完整包不变,另保留锁定旧契约的兼容场景与 TypeScript 调用方编译检查。SDK 尚未发布,真实 Maven/JDT 与 Windows 验收仍待完成。 原生 Debug:运行声明引用同包适配器,点击 Build 树 Debug 或保存配置的 Debug 后先保存并构建,验证程序路径/参数/环境交给注册表;停止、源码或配置变化、模型重载、插件停用与工作区切换均丢弃过期结果,解码后的文件别名变化和不可执行文件在平台交接前拒绝。Node/Java SDK 进程的准备协议与 Core 解码有端到端覆盖;真实适配器、Java/JDT、跨插件协作和 Windows 尚未验收。 Maven 独立插件的本地增量已经删除生命周期/插件目标/自定义目标/测试的命令模板,改由 Provider 3 执行;真实 Core C ABI + Java 后端 + Maven 三模块工程验证模块编译、单方法 Surefire 报告和模型共享,受控进程回归覆盖取消、非零退出和输出超限。插件与新版 SDK 已分别提交 Draft PR #7/#4,尚未发布,正式 SDK 锁定仍待更新;生产 macOS Provider 会话已经执行模型、编译和单方法测试,包 SHA-256/权限保持不变;显式 SDK CI 在 Java 8 上通过当前与 3.6.3 Maven 的 55 项开发检查(各自包括 3 项打包);旧 MavenService、Agent/设置/Run/Java 迁移、正式包、完整 macOS UI 与 Windows 验收未完成,保持 partial/pending。 真实原生调试集成:公开 Node SDK Provider 用 Clang 编译 C 程序,经生产 macOS 会话、Core 准备、Registry 明确身份、生产 stdio 传输和 LLDB 命中源码断点、读取 main 栈帧、保留空格参数后继续并退出码 0;包 SHA-256/权限不变,所有本次进程回收。测试显式选择 SDK/工具,完整 UI、正式发行与 Windows 尚未验收,verification 保持 pending。 Build 树应用从文档保存阶段起持有同一可取消运行 ID;保存 gate 下启动新任务/测试或停止、切换工作区、选项/源码/模型/插件失效后,旧保存返回不得启动 Provider、替换新运行或清空新输出;保存失败不启动,成功后才准备。 原生视图隔离回归用真实 Core 与受控 Provider 数据检查深浅主题的测试发现、Debug 入口和 Run 输出;截图仅验证该视图状态,不代替完整发行包或 Windows 实机验收。 实例作用域:用同一工作区的两个独立根验证 Profiles、文件/目录、布尔与文本值独立持久化;编辑、清空或重置 A 不影响 B,重开后任务、静态运行入口、同步和语言导入读取相同根的配置;未声明作用域的插件保留共享行为。旧 Maven 数据迁移与 Windows 运行验收另行完成,保持 partial/pending。 作用域变更的旧 Build 偏好先复制并验证目标,再删除共享源;写入失败阻止默认配置发布并允许重试,已有实例值优先,暂未检测到根的空标记也迁移保留。 工具链候选通过真实 Core 与生产本地文档验证按实例选择 Maven/JDK,Provider 环境保留选中的 JAVA_HOME/PATH 且不转发无关测试凭据;被动导入不探测版本或运行 Wrapper,显式路径失败不能独立发现。Windows 不声明 executableResolution 2,旧 Maven 服务迁移仍待完成。 共享 Build 文档验证工作区/实例默认值、逐根覆盖和本机差异合并;重开和检测不改共享字节,重置本机值恢复继承,外部修改冲突或文档损坏明确失败并保留原始数据。 未选中的自定义候选仅在 allowCustom 选项中展示,不改变选择和模型;真实 Core、生产存储和服务回归通过,新增实例静态入口继承团队默认值。 协议 8 回归覆盖协商拒绝、随执行返回的报告、缺失/损坏失败、模块同名测试隔离、取消/配置变更后拒绝晚到解码,以及普通任务中的测试结果。Maven 开发包用官方已配置测试 Mojo 的报告目录和 Apache Surefire parser,真实 Core/Maven 覆盖带空格自定义目录与非零退出的失败用例,坏 XML/外部实体拒绝,包字节保持不变。Java/Node SDK 同步,正式发布和全部旧 Maven/Java 消费者迁移尚未完成。 本机选项、逐根映射和空多选标记中存在非 Data 存储值时,检测失败并保留原始偏好,不得当缺失键发布默认值。 本机实例默认值继承、逐根覆盖与重置通过真实 Core 和生产存储验证,团队文档字节不变;本机默认值不进入资源复用。 固定宿主 ac24a96af 与 SDK 71667af 的 Java 8 CI(https://github.com/Lithe-IDEA/lithe-plugin-maven/actions/runs/40792694290)在当前 Maven/3.6.3 各 72 项通过,覆盖新原生配置与 Surefire/Failsafe 报告、取消清理和包字节不变;正式发行组合仍待验证。 协议 10 接通带版本协商的类型化运行选项与服务/任务准备(Core、Swift、Node/Java SDK)。原生 Run/Start All 为每个 Maven 服务独立准备,配置 ABA/Stop/重置拒绝旧回复,已停进程输出不能覆盖新会话;Build 树按服务/任务类型发请求;停用和包更新在删除包前停止准备及进程,旧启动注册更新后不可再次使用。后端复用 Maven reactor 和 Mojo 执行器,真实 Core→Maven 验证未安装兄弟模块、精确 argv、cwd、目标撤销和包哈希不变。macOS 无调用者的旧 Maven 桥和工程模型已删除;Windows 当前旧命令消费者、Core 旧实现和正式发行/完整 UI 验收仍待完成。 保存 Provider service/task 引用保留执行类型、稳定配置 ID 和参数,重开后按当前声明重验;独立准备至进程交接保留 Agent 操作身份。 服务所有者使用完整插件包身份;停用其中一个插件不会停止同名构建系统下另一插件的进程。preview 内存检测层保留 Provider 模型摘要,自动识别不写工作区。 后续本机真实 Micronaut HTTP 应用(Platform 4.7.6 / Core 与注解处理器 4.7.14)在 JVM 暂停后经 JDI 恢复,通过 Netty 控制器和编译期注入服务读取未安装的 reactor 兄弟依赖,参数、环境及包字节不变;这是旧固定 CI 之后的本地四步框架增量,不代替 Debug UI、正式包或 Windows 原生验收。 Windows Build 选项编辑与 Agent 共用原生本机存储:开页只读,修改草稿后显式保存/恢复继承;隐藏重开保留草稿。团队/本机两层版本同时检查,冲突、关闭、插件撤销拒绝迟到写入。实例选择独立,工作区多选保留兄弟实例值和显式空选择;无关系统/根/记忆选项与团队文件字节保持。保存后重新检测并使旧模型失效。长选项/模型选择使用有界视口,不启动工具或 Provider。产品能力准入仍关闭,不能据此认定 Windows 完整 Maven 产品迁移完成。 Viva 2026-11-09:Tests 工具窗口经 build.testPlan 计划工作区测试,宿主只启动 Core 展开的命令或 Provider 请求;报告由 Core build.decodeTestResults 解码,最终判定由 build.resolveTestRunOutcome 归约,宿主不解析报告格式、不按退出码自行判定。结果树按 suite/case 分组并有界虚拟化,失败项按解码出的 workspace-relative path/line 打开;停止、工作区关闭和过期结果按 run generation 丢弃。desktop/internal/workbench/tests_test.go 以隔离 fixture 插件、真实测试进程和 JUnit fixture 覆盖运行→解码→结果树→失败定位、停止取消和关闭项目停止运行;desktop/internal/workbench/tests_provider_test.go 用真实 Provider 进程(lithe/build/test 返回规范报告)覆盖 Provider 运行→Core 解码→结果树、Provider 取消和关闭项目停止 Provider 会话;原生窗口、真实 Java/Cargo 插件组合与 Windows 实机仍 pending。 Viva 聚合 Build 窗口:build_tree_test.go 覆盖默认只展开选中实例、用户展开/折叠的记忆、全部展开时依赖保持折叠、筛选按分组/根目录/行匹配且不触发加载、同时最多加载 4 个模型、失败和折叠的分组不加载,以及点击其他分组的行切换构建系统并能运行选中的目标;build_menus_test.go 覆盖从右键菜单运行目标后打开 Run 窗口的构建控制台;runconfig_browser_test.go 覆盖 Build 窗口中的运行配置列表:范围与计数、固定写入客户端存储而不写项目、分组折叠展开、双击运行和行内停止。运行 scripts/desktop/desktop-go.sh test ./internal/workbench -run 'TestBuild|TestRunConfiguration' -count=1。真实插件组合与 Windows 实机仍待验收。 Viva 2026-11-14 任务范围:构建树的任务行不带项目,从树里运行时按任务声明的范围推断,不再把只能在项目上运行的任务当作工作区请求(Core 会报 plugin.build.invalidSelection)。模型任务用它所属的项目;声明任务依次用选中的目标、选中的项目(或目标所在的项目)、工作区;什么都没选时取构建根目录的项目或唯一的项目、唯一适用的目标;推断不出时提示先选择项目或目标,不发请求。选中项目时,任务分组只列出这个项目的模型任务。IDE API 仍按请求原样交给 Core 校验。build_tree_test.go 的 TestBuildTaskSelectionFitsDeclaredScopes、TestBuildTreeTasksRunOnTheScopeTheyDeclare 覆盖这些规则,后者在修复前失败(Project 为空);真实插件组合与 Windows 实机仍待验收。", - "notes": "Viva 已接入 buildSystems 1 / buildProviders 1–2 的纵向切片:Build 工具窗口用 Core 检测实例、加载 provider 模型或执行 command 模型,列出项目、目标、command/provider 任务;command 任务按 build.invocationPlan 的候选顺序解析并做版本检查,provider 任务经 lsp.buildRequest 执行,共享 provider 复用同插件语言服务器;输出有界、支持停止,关闭项目回收 provider 与进程树。真实 macOS 验证使用官方 Cargo 0.1.0 插件内容,按根目录重打包后安装、启用、模型加载与 cargo build 跑通;GitHub Release 原始包按契约 / 目录布局发布,当前 pluginpkg 只接受解压根目录的 plugin.json,测试使用根目录重打包的同一包,安装器布局问题单独记录。未声明 buildProviders 4、settings、executableResolution、测试与 Debug:工具链运行引用、需设置插件、测试/诊断面板仍缺失;Maven 0.1.1 的 languageImport 与固定 Core 不兼容。Windows Job Object 已实现并交叉编译,但无实机验证,保持 pending。Viva 客户端尚未逐项盘点;legacy 是迁移前基线,不代表当前实现。 Viva 运行设置接线:build.invocationPlan 携带真实全局插件层,显式无效工具路径直接失败并保留自动候选顺序;有效显式工具父目录进入 PATH。Provider 启动携带独立全局/项目层,工作区 URI 由 Core 生成。此接线不表示通用设置界面、原生配置页或完整 Build 协议迁移已验收。 Viva 2026-11-14:构建系统改为一个聚合的 Build 工具窗口,放在右侧工具栏上方(与 IDEA 的位置一致),不再为每个实例开标签页。窗口里是一棵树,每个检测到的构建系统实例是一个分组,显示构建系统名称、徽标和相对根目录;分组下是项目、目标、任务、测试和依赖。默认只展开当前选中的实例,用户手动展开或折叠过的分组保持该状态;依赖分组默认折叠,因为加载依赖要运行构建工具。筛选框按分组名称、根目录和行名称过滤,匹配的行固定展开在所属分组下;筛选只读已加载的模型,不会触发加载。展开的分组按需加载模型,同时最多加载 4 个,加载失败的不会自动重试,折叠的分组不加载。点击其他分组的行会切换到该构建系统并选中这一行,工具栏的运行按钮会执行选中的目标或任务。运行配置列表放在右侧 Build 窗口顶部,和下面的构建树之间有可拖动的分隔条,按范围、固定和执行类型筛选,双击运行、行内按钮停止。目标的名称以其路径结尾时(如 Go 包的导入路径以所在目录结尾),目标行只显示路径,鼠标悬停显示完整名称;其他目标仍显示名称并在旁边显示路径,筛选仍按名称和路径匹配。底部原先的 Build 窗口改为 Run 窗口,只显示运行输出:构建控制台,以及插件启动的运行各自的标签页;Build 窗口发起的任务或运行会打开 Run 窗口并切到构建控制台。", + "notes": "Viva 已接入 buildSystems 1 / buildProviders 1–2 的纵向切片:Build 工具窗口用 Core 检测实例、加载 provider 模型或执行 command 模型,列出项目、目标、command/provider 任务;command 任务按 build.invocationPlan 的候选顺序解析并做版本检查,provider 任务经 lsp.buildRequest 执行,共享 provider 复用同插件语言服务器;输出有界、支持停止,关闭项目回收 provider 与进程树。真实 macOS 验证使用官方 Cargo 0.1.0 插件内容,按根目录重打包后安装、启用、模型加载与 cargo build 跑通;GitHub Release 原始包按契约 / 目录布局发布,当前 pluginpkg 只接受解压根目录的 plugin.json,测试使用根目录重打包的同一包,安装器布局问题单独记录。未声明 buildProviders 4、settings、executableResolution、测试与 Debug:工具链运行引用、需设置插件、测试/诊断面板仍缺失;Maven 0.1.1 的 languageImport 与固定 Core 不兼容。Windows Job Object 已实现并交叉编译,但无实机验证,保持 pending。Viva 客户端尚未逐项盘点;legacy 是迁移前基线,不代表当前实现。 Viva 运行设置接线:build.invocationPlan 携带真实全局插件层,显式无效工具路径直接失败并保留自动候选顺序;有效显式工具父目录进入 PATH。Provider 启动携带独立全局/项目层,工作区 URI 由 Core 生成。此接线不表示通用设置界面、原生配置页或完整 Build 协议迁移已验收。 Viva 2026-11-14:构建系统改为一个聚合的 Build 工具窗口,放在右侧工具栏上方(与 IDEA 的位置一致),不再为每个实例开标签页。窗口里是一棵树,每个检测到的构建系统实例是一个分组,显示构建系统名称、徽标和相对根目录;分组下是项目、目标、任务、测试和依赖。默认只展开当前选中的实例,用户手动展开或折叠过的分组保持该状态;依赖分组默认折叠,因为加载依赖要运行构建工具。筛选框按分组名称、根目录和行名称过滤,匹配的行固定展开在所属分组下;筛选只读已加载的模型,不会触发加载。展开的分组按需加载模型,同时最多加载 4 个,加载失败的不会自动重试,折叠的分组不加载。点击其他分组的行会切换到该构建系统并选中这一行,工具栏的运行按钮会执行选中的目标或任务。运行配置列表放在右侧 Build 窗口顶部,和下面的构建树之间有可拖动的分隔条,按范围、固定和执行类型筛选,双击运行、行内按钮停止。目标的名称以其路径结尾时(如 Go 包的导入路径以所在目录结尾),目标行只显示路径,鼠标悬停显示完整名称;其他目标仍显示名称并在旁边显示路径,筛选仍按名称和路径匹配。底部原先的 Build 窗口改为 Run 窗口,只显示运行输出:构建控制台,以及插件启动的运行各自的标签页;Build 窗口发起的任务或运行会打开 Run 窗口并切到构建控制台。 Viva 2026-11-14:参照 IDEA 的 Make 窗口,每个任务和有运行入口的目标行首常驻绿色运行按钮,不必先选中,点一下就选中该行并运行,构建进行中按钮变暗不可点;没有运行入口的目标和项目保留类型图标,调试按钮仍只在选中的行上。名称与路径放不下时路径先省略、名称以省略号结尾,悬停提示显示完整名称和路径(只显示路径的目标显示完整名称);依赖标题旁的 ⓘ 说明依赖树在第一次展开时才由构建工具读取,以及何时重新读取。自动化:TestBuildTreeRunMarksRunTheirRowsAtOnce;截图 docs/assets/build-panels/build-go-targets-*.png。", "legacy": { "revision": "5a54c41aa37a4e6e6b68918a4b05765b9dd07a36", "macos": {