diff --git a/.agents/notes/implemented/bug-fix/2026-11-20-workspace-plugin-first-use.md b/.agents/notes/implemented/bug-fix/2026-11-20-workspace-plugin-first-use.md new file mode 100644 index 000000000..f070c258d --- /dev/null +++ b/.agents/notes/implemented/bug-fix/2026-11-20-workspace-plugin-first-use.md @@ -0,0 +1,31 @@ +# Agent 笔记:在当前工作区完成插件启用 + +状态:已实现 + +## 先说结论 + +工作区推荐里的「查看插件」直接打开插件市场,推荐多项时显示完整目录。启用语言服务器插件后,已打开、语言已识别的文件在原标签开始同步。用户可以在当前项目继续编辑。 + +## 问题 + +多项推荐沿用了普通插件设置入口,新窗口显示已安装的插件。打开文件时若没有语言服务器提供者,插件启用后也没有新的打开事件来请求服务器。安装恰好发生在首次查询已读到旧插件列表时,同语言的启动去重还可能吞掉新的请求。 + +## 决策 + +插件市场入口显式区分未指定搜索和空搜索。插件状态变更通过现有启动入口处理已打开文件,每种语言最多请求一次。首次启动使用旧列表并且未找到提供者时,才处理期间积存的注册表刷新请求。窗口和项目关闭、用户取消、以及正在运行的会话沿用原生命周期。 + +## 考虑过的备选方案 + +等待用户再次打开文件会延迟语言能力。启用任何插件都重启项目语言服务会重复导入工作区,并中断正在运行的会话。已有打开文件提供了按需启动所需的信息。 + +## 后果 + +启用后会查询已打开文件对应的语言,有服务的语言可以立即准备。已运行的服务器继续服务,真实启动错误仍通过现有诊断反馈。完全未知扩展名的旧标签需要再次打开来识别语言。 + +## 验证 + +运行 `./scripts/desktop/desktop-go.sh test ./internal/workbench -run TestPluginEnable`,覆盖现有文件接管及安装与旧查询交错。运行 `./scripts/desktop/desktop-go.sh test ./internal/settingswindow -run TestOpenMarketplaceWithoutSearch`,覆盖首次打开窗口和窗口已打开两种情况。 + +## 适用范围 + +适用于 Viva 工作台的插件管理、现有文档同步和设置窗口的插件市场入口。 diff --git a/desktop/internal/settingswindow/controller.go b/desktop/internal/settingswindow/controller.go index 952236a34..e6af5decf 100644 --- a/desktop/internal/settingswindow/controller.go +++ b/desktop/internal/settingswindow/controller.go @@ -54,9 +54,8 @@ type Values struct { EditorPreferences core.EditorPreferences EditorStoredPreferences core.EditorStoredPreferences KeymapSchemes core.KeymapSchemes - // MarketplaceQuery is the text the marketplace search starts with when the window opens on - // the plugin page; empty leaves it as it is. - MarketplaceQuery string + // MarketplaceQuery opens the Marketplace with that search. A nil query leaves the tab alone. + MarketplaceQuery *string // Language is a stored i18n language code ("en", "zh-Hans"); empty follows the system. Language string // Theme is "light" or "dark"; empty follows the system's look. @@ -657,8 +656,8 @@ func (c *Controller) OpenPlugins(application *app.Application, current Values) e // OpenPluginsWithQuery shows the plugin page with the marketplace search set to query, which // is what "Find in Marketplace" asks for; an open window takes the query too. func (c *Controller) OpenPluginsWithQuery(application *app.Application, current Values, query string) error { - current.MarketplaceQuery = query - return c.openWithQuery(application, current, pagePlugins, query) + current.MarketplaceQuery = &query + return c.open(application, current, pagePlugins) } // OpenTerminal opens the Terminal page under Tools, including when a settings window is @@ -691,16 +690,11 @@ func (c *Controller) OpenAI(application *app.Application, current Values) error // open shows the window on page, or, with noPage, on the page it already has or starts on. func (c *Controller) open(application *app.Application, current Values, page pageID) error { - return c.openWithQuery(application, current, page, "") -} - -// openWithQuery is open that also sets the marketplace search to query when it is not empty. -func (c *Controller) openWithQuery(application *app.Application, current Values, page pageID, query string) error { c.mu.Lock() if open := c.current; open != nil && open.win != nil && !open.win.Closed() && !open.sess.finished.Load() { win := open.win - if query != "" { - open.requestQuery(query) + if current.MarketplaceQuery != nil { + open.requestQuery(*current.MarketplaceQuery) } if page != noPage { open.requestPage(page) diff --git a/desktop/internal/settingswindow/marketplace_view_test.go b/desktop/internal/settingswindow/marketplace_view_test.go index f176d2e86..96acebcf3 100644 --- a/desktop/internal/settingswindow/marketplace_view_test.go +++ b/desktop/internal/settingswindow/marketplace_view_test.go @@ -447,3 +447,26 @@ func TestMarketplaceShowsFailureError(t *testing.T) { } }) } + +func TestOpenMarketplaceWithoutSearch(t *testing.T) { + query := "" + w := newWindow(NewController(Options{ + Marketplace: func(context.Context) (marketplace.Snapshot, error) { + return marketplace.Snapshot{}, nil + }, + }), Values{MarketplaceQuery: &query}) + w.sess.show(pagePlugins) + d := openWindow(t, w) + if w.pluginTab != pluginTabMarketplace || w.marketQuery != "" { + t.Fatalf("opened plugins tab = %v, query = %q, want unfiltered Marketplace", w.pluginTab, w.marketQuery) + } + + w.pluginTab = pluginTabInstalled + w.marketQuery = "previous query" + w.requestQuery("") + w.requestPage(pagePlugins) + d.pump() + if w.pluginTab != pluginTabMarketplace || w.marketQuery != "" { + t.Fatalf("reopened plugins tab = %v, query = %q, want unfiltered Marketplace", w.pluginTab, w.marketQuery) + } +} diff --git a/desktop/internal/settingswindow/visual_capture_test.go b/desktop/internal/settingswindow/visual_capture_test.go index e8847618c..0995f1f59 100644 --- a/desktop/internal/settingswindow/visual_capture_test.go +++ b/desktop/internal/settingswindow/visual_capture_test.go @@ -46,7 +46,7 @@ func TestVisualSettings(t *testing.T) { {"23-settings-keymap", pageKeymap}, {"24-settings-network", pageNetwork}, {"25-settings-process", pageProcessTermination}, {"26-settings-git", pageVersionControl}, {"26-settings-git-console", pageVersionControl}, {"27-settings-terminal", pageTerminal}, {"28-plugins-installed", pagePlugins}, - {"29-marketplace-empty", pagePlugins}, + {"29-marketplace-empty", pagePlugins}, {"29-marketplace-recommendations", pagePlugins}, {"32-settings-build", pageBuild}, {"32-settings-build-kind", pageBuild}, {"34-settings-debuggers", pageDebuggers}, {"33-settings-toolchains", pageToolchains}, {"m44-toolchain-directory-menu", pageToolchains}, {"m45-toolchain-custom-directory", pageToolchains}, {"m47-toolchain-project-untrusted", pageToolchains}, {"m48-toolchain-project-trusted", pageToolchains}, {"m49-toolchain-project-trust-click", pageToolchains}, @@ -99,6 +99,17 @@ func TestVisualSettings(t *testing.T) { } opts.SetAutoUpdatePlugins = func(bool) {} values := Values{Theme: theme, Language: language.Code(), TerminalScrollback: 2000, AutoUpdatePlugins: scenario.id == "m42-plugin-auto-update-on"} + if scenario.id == "29-marketplace-recommendations" { + query := "" + values.MarketplaceQuery = &query + opts.Marketplace = func(context.Context) (marketplace.Snapshot, error) { + return marketplace.Snapshot{Index: core.MarketplaceIndex{Plugins: []core.MarketplacePlugin{ + {ID: "dev.lithe.test.demo-build", Name: "Demo Build", Availability: core.MarketplaceAvailability{Status: "available", Version: "1.0.0"}}, + {ID: "dev.lithe.test.demo-language", Name: "Demo Language", Availability: core.MarketplaceAvailability{Status: "available", Version: "1.0.0"}}, + }}}, nil + } + opts.PluginState = nil + } if scenario.page == pageBuild || scenario.page == pageDebuggers { values.SteppingFilters = map[string]core.DebugSteppingFilters{"fixture-jvm": {ClassNameFilters: []string{"java.*", "javax.*", "sun.*", "com.example.generated.*"}, SkipSynthetics: true, SkipStaticInitializers: true}} } @@ -115,6 +126,9 @@ func TestVisualSettings(t *testing.T) { } w := newWindow(NewController(opts), values) w.sess.page = scenario.page + if scenario.id == "29-marketplace-recommendations" && (w.pluginTab != pluginTabMarketplace || w.marketQuery != "") { + t.Fatal("recommendations must open the unfiltered Marketplace") + } if scenario.page == pageBuild || parents[scenario.page] == pageBuild { // As the Build page opens its pages: with the group open in the sidebar. w.sess.open[pageBuild] = true diff --git a/desktop/internal/settingswindow/window.go b/desktop/internal/settingswindow/window.go index 3d7de95c0..8dd978846 100644 --- a/desktop/internal/settingswindow/window.go +++ b/desktop/internal/settingswindow/window.go @@ -260,8 +260,8 @@ func newWindow(c *Controller, current Values) *window { w.market.setCustom(c.opts.MarketplaceSources) w.market.reportDiscarded = c.opts.MarketplaceError w.market.search.rank = c.opts.MarketplaceRank - w.marketQuery = current.MarketplaceQuery - if w.marketQuery != "" { + if current.MarketplaceQuery != nil { + w.marketQuery = *current.MarketplaceQuery w.pluginTab = pluginTabMarketplace } w.market.search.report = c.opts.MarketplaceError diff --git a/desktop/internal/workbench/plugin_recommendations.go b/desktop/internal/workbench/plugin_recommendations.go index ce2f4acf7..63f0543b9 100644 --- a/desktop/internal/workbench/plugin_recommendations.go +++ b/desktop/internal/workbench/plugin_recommendations.go @@ -354,19 +354,17 @@ func (a *App) notifyPluginRecommendations(root string, recommendations []core.Ma }) primaryLabel := i18n.Shared(language, "desktop.marketplace.recommendedAction") secondaryLabel := i18n.Shared(language, "desktop.marketplace.recommendedDismiss") - firstQuery := names[0] - multiple := len(filtered) > 1 + query := "" + if len(names) == 1 { + query = names[0] + } a.shownTab().notifyActions( title, detail, ui.ToastInfo, primaryLabel, func(target *App) { - if multiple { - target.openPluginSettings(surfaceNotification) - return - } - target.openPluginSettingsSearch(surfaceNotification, firstQuery) + target.openPluginSettingsSearch(surfaceNotification, query) }, secondaryLabel, func(target *App) { diff --git a/desktop/internal/workbench/pluginbackends.go b/desktop/internal/workbench/pluginbackends.go index 840cb0e8b..5369df9e9 100644 --- a/desktop/internal/workbench/pluginbackends.go +++ b/desktop/internal/workbench/pluginbackends.go @@ -20,12 +20,13 @@ import ( // Progress is written by the worker and read by the status bar; identity and // cancellation remain protected by pluginServerMu. type pluginServerPreparation struct { - project *project - cancel context.CancelFunc - progress atomic.Pointer[pluginruntime.Progress] - cancelled atomic.Bool - pluginID string - revision uint64 + project *project + cancel context.CancelFunc + progress atomic.Pointer[pluginruntime.Progress] + cancelled atomic.Bool + pluginID string + revision uint64 + retryWithoutProvider bool } func (p *pluginServerPreparation) stop() { @@ -182,6 +183,10 @@ func (s *pluginServer) endBuild() { // A language nothing serves is the ordinary case for most files, so a missing // provider is not an error and nothing is logged for it. func (a *App) startPluginServer(languageID string) { + a.requestPluginServer(languageID, false) +} + +func (a *App) requestPluginServer(languageID string, providersChanged bool) { if a.plugins == nil || languageID == "" { return } @@ -197,7 +202,11 @@ func (a *App) startPluginServer(languageID string) { } if a.pluginServerStarting[languageID] { // Opening several files of one language at once must not launch several - // servers; the first start answers for all of them. + // servers. A registry change can arrive after this start read the + // old registry, so repeat selection if it returns without a provider. + if preparation := a.pluginServerPreparations[languageID]; providersChanged && preparation != nil { + preparation.retryWithoutProvider = true + } a.pluginServerMu.Unlock() return } @@ -259,6 +268,7 @@ func (a *App) finishPluginServerPreparation(preparation *pluginServerPreparation owner = session.PluginID } changed := a.pluginServerChanges[owner] > preparation.revision + retryWithoutProvider := preparation.retryWithoutProvider if current { delete(a.pluginServerPreparations, languageID) } @@ -280,6 +290,9 @@ func (a *App) finishPluginServerPreparation(preparation *pluginServerPreparation session, err = nil, context.Canceled } a.finishPluginServerStart(preparation.project, languageID, pluginID, version, session, err) + if retryWithoutProvider && session == nil && err == nil && a.project == preparation.project { + a.startPluginServer(languageID) + } } // finishPluginServerStart takes the started session back on the window thread and diff --git a/desktop/internal/workbench/plugins.go b/desktop/internal/workbench/plugins.go index 73bec4d77..b9e725440 100644 --- a/desktop/internal/workbench/plugins.go +++ b/desktop/internal/workbench/plugins.go @@ -256,7 +256,7 @@ func (a *App) commitPluginInstall(ctx context.Context, plan plugininstall.Plan, } // applyPluginLifecycleChange updates plugin state across every tab and, when reload is -// true, clears stale build state, reloads languages and re-detects builds on open tabs. +// true, reloads languages and refreshes build and language services in open projects. func (a *App) applyPluginLifecycleChange(reload bool) { for _, tab := range a.everyTab() { if reload { @@ -267,8 +267,17 @@ func (a *App) applyPluginLifecycleChange(reload bool) { } if reload { for _, tab := range a.openTabs() { - if tab.project != nil { - tab.loadBuildSystems(tab.project) + if p := tab.project; p != nil { + tab.loadBuildSystems(p) + // Opening a file normally requests its server. A plugin installed + // later must also get the files that were already open. + languages := make(map[string]bool) + for _, d := range p.docs.list { + if !d.virtual && !d.scratch && d.languageID != "" && !languages[d.languageID] { + languages[d.languageID] = true + tab.requestPluginServer(d.languageID, true) + } + } } } } diff --git a/desktop/internal/workbench/pluginsync_e2e_test.go b/desktop/internal/workbench/pluginsync_e2e_test.go index f2d3cb2d7..a3e22e981 100644 --- a/desktop/internal/workbench/pluginsync_e2e_test.go +++ b/desktop/internal/workbench/pluginsync_e2e_test.go @@ -365,3 +365,67 @@ func TestClangdBuildStartedSessionSynchronizesEditor(t *testing.T) { t.Fatal("shared server survived project close") } } + +func TestPluginEnableStartsServerForOpenDocument(t *testing.T) { + h := clangdHarness(t) + pluginID := "dev.lithe.test.clangd" + if err := h.app.plugins.Manager.SetEnabled(pluginID, false); err != nil { + t.Fatal(err) + } + root := t.TempDir() + path := filepath.Join(root, "open.c") + if err := os.WriteFile(path, []byte("int main(void) { return 0; }\n"), 0o600); err != nil { + t.Fatal(err) + } + h.open(root) + p := h.app.project + h.app.openFile(p, path) + h.settle() + doc := p.docs.byPath(path) + if doc == nil || doc.languageID != "c" || doc.sync.opened { + t.Fatal("expected the existing document to have the bundled language and no server") + } + h.app.setPluginEnabled(pluginID, true) + awaitStateWithin(t, h, 5*time.Second, "the server to open the existing document", func() bool { + return doc.sync.opened && doc.sync.pluginID == pluginID + }) + if p.docs.byPath(path) != doc { + t.Fatal("the original document was replaced") + } +} + +func TestPluginEnableRetriesAnInFlightStartWithoutProvider(t *testing.T) { + h := clangdHarness(t) + a := h.app + const pluginID = "dev.lithe.test.clangd" + if err := a.plugins.Manager.SetEnabled(pluginID, false); err != nil { + t.Fatal(err) + } + root := t.TempDir() + path := filepath.Join(root, "open.c") + if err := os.WriteFile(path, []byte("int main(void) { return 0; }\n"), 0o600); err != nil { + t.Fatal(err) + } + h.open(root) + p := a.project + a.openFile(p, path) + h.settle() + doc := p.docs.byPath(path) + if doc == nil || doc.languageID != "c" || doc.sync.opened { + t.Fatal("expected the file open without an enabled provider") + } + + // The first start inspected the disabled registry. Hold its empty result + // until after the plugin lifecycle callback requests the server again. + attempt := &pluginServerPreparation{project: p, cancel: func() {}} + a.pluginServerPreparations["c"] = attempt + a.pluginServerStarting["c"] = true + if err := a.plugins.Manager.SetEnabled(pluginID, true); err != nil { + t.Fatal(err) + } + a.applyPluginLifecycleChange(true) + a.finishPluginServerPreparation(attempt, "c", "", "", nil, nil) + awaitStateWithin(t, h, 5*time.Second, "the enabled server to open the existing document", func() bool { + return doc.sync.opened && doc.sync.pluginID == pluginID + }) +} diff --git a/desktop/internal/workbench/settings.go b/desktop/internal/workbench/settings.go index 362641410..f518c0f92 100644 --- a/desktop/internal/workbench/settings.go +++ b/desktop/internal/workbench/settings.go @@ -380,7 +380,7 @@ func (a *App) openPluginSettings(surface actionSurface) { // openPluginSettingsSearch shows the plugin page with the marketplace search set to query. func (a *App) openPluginSettingsSearch(surface actionSurface, query string) { - a.openSettingsPageWith(surface, settingsPlugins, query) + a.openSettingsPageWith(surface, settingsMarketplace, query) } // openTerminalSettings shows the settings window on its Terminal page, where the shell new @@ -401,6 +401,7 @@ const ( // settingsHome opens the window where it was left, or on its first page. settingsHome settingsPage = iota settingsPlugins + settingsMarketplace settingsTerminal // settingsAI is the AI page, where the providers a commit message is generated with are // configured. @@ -428,7 +429,7 @@ func (a *App) openSettingsPageWith(surface actionSurface, page settingsPage, que if a.application == nil { return } - if page == settingsPlugins { + if page == settingsPlugins || page == settingsMarketplace { a.reloadPluginLanguages() } a.post(func(a *App) { @@ -464,11 +465,9 @@ func (a *App) openSettingsPageWith(surface actionSurface, page settingsPage, que var err error switch page { case settingsPlugins: - if query != "" { - err = a.settingsWindow.OpenPluginsWithQuery(a.application, current, query) - } else { - err = a.settingsWindow.OpenPlugins(a.application, current) - } + err = a.settingsWindow.OpenPlugins(a.application, current) + case settingsMarketplace: + err = a.settingsWindow.OpenPluginsWithQuery(a.application, current, query) case settingsTerminal: err = a.settingsWindow.OpenTerminal(a.application, current) case settingsKeymap: diff --git a/shared/platform-feature-matrix/features/lsp-lifecycle.json b/shared/platform-feature-matrix/features/lsp-lifecycle.json index 6224b2e54..db4366dfd 100644 --- a/shared/platform-feature-matrix/features/lsp-lifecycle.json +++ b/shared/platform-feature-matrix/features/lsp-lifecycle.json @@ -5,31 +5,35 @@ "capability": "语言服务器启动与工作区准备", "macos": { "implementationStatus": "partial", - "verificationStatus": "not-applicable", + "verificationStatus": "pending", "evidence": [ "docs/viva-migration.md", "desktop/internal/workbench/catalog.go", "desktop/internal/workbench/shell.go", "desktop/internal/workbench/app.go", "desktop/internal/workbench/chrome.go", - "desktop/internal/workbench/problems_view.go" + "desktop/internal/workbench/problems_view.go", + "desktop/internal/workbench/plugins.go", + "desktop/internal/workbench/pluginsync_e2e_test.go" ] }, "windows": { "implementationStatus": "partial", - "verificationStatus": "not-applicable", + "verificationStatus": "pending", "evidence": [ "docs/viva-migration.md", "desktop/internal/workbench/catalog.go", "desktop/internal/workbench/shell.go", "desktop/internal/workbench/app.go", "desktop/internal/workbench/chrome.go", - "desktop/internal/workbench/problems_view.go" + "desktop/internal/workbench/problems_view.go", + "desktop/internal/workbench/plugins.go", + "desktop/internal/workbench/pluginsync_e2e_test.go" ] }, "owner": "Language Tooling", - "verification": "在两端用测试内联的合成语言服务器插件验证启动、重启、超时、取消和资源清理,并确认典型工作流后已安装程序包(macOS app bundle、Windows 安装目录)的文件清单不变。 等待期间取消不得重新激活;匹配 operation 的停止应清除 preparing,旧 operation 的停止不得影响新准备。 macOS #1523:通过插件入口启动语言服务器,连续失败最多自动启动三次,显式重启可恢复,且包内文件哈希保持不变。 macOS 最终关闭场景:暂停旧模块清理、排队文档和维护激活、关闭项目会话、释放清理;即使 AppModel 保留工作区 URL 与打开文档,也不能重新发布语言能力或启动 LSP。 macOS 生产 RustCoreBridge 与本地协议进程验证插件身份、host services、配置值和缓存启动上下文。 macOS 在大型工程导入期间打字、滚动与补全不掉帧(事件 drain 已移出主线程)。 Core:cargo test -p lithe-core --lib failed_initialize、failed_start 与 invalid_initial_configuration_is_rejected_before_launch,确认启动失败的进程确认退出后才允许下一次启动,清理不了时拒绝新启动。 #1662 LSP-08:启动失败后的自动重试由 Core 的 lsp.activationPolicy 决定,时间使用平台单调时钟。每次失败后自动启动等待 5 秒;连续失败 3 次后停止自动启动,只能显式重启或修复后重试;会话就绪、显式启动或停止会清空记录。macOS 新增失败后 5 秒冷却(此前可立即重试),Windows 新增 3 次上限(此前每 5 秒无限重试)。在两端用无法启动的语言服务器打开文件,确认 5 秒内不重复启动、第 3 次失败后不再自动启动、显式重启后恢复。 停止语言服务器时的进程组(2026-11-16,#2017,Lithe-core-rust #63,两端通过 Core ad148ec 获得):macOS 上语言服务器的进程都已退出、但还没被回收时,kill(-pgid) 返回 EPERM,Core 原来把它当成失败,停止或重启时报“Language-server process tree did not exit.”,会话留在注册表里;现在 EPERM 也视为已发出信号,是否结束仍由截止时间内的等待判断。Core 回归测试:cargo test -p lithe-platform-tests a_unix_tree_of_exited_unreaped_processes_ends_without_error。Windows 用 Job 对象,不走这段代码。", - "notes": "Viva 已接入插件语言服务器的启动、停止和文档同步,Problems 工具窗口展示服务器诊断,并在项目切换、服务器重启/停止/崩溃及插件禁用后清理;补全、悬浮、导航、重命名与格式化见各自能力行。macOS 已用真实 clangd 系统命令进程验证启动、文档打开/增量编辑/保存/关闭和诊断到达;Windows 和资源清理未验证。", + "verification": "在两端用测试内联的合成语言服务器插件验证启动、重启、超时、取消和资源清理,并确认典型工作流后已安装程序包(macOS app bundle、Windows 安装目录)的文件清单不变。 等待期间取消不得重新激活;匹配 operation 的停止应清除 preparing,旧 operation 的停止不得影响新准备。 macOS #1523:通过插件入口启动语言服务器,连续失败最多自动启动三次,显式重启可恢复,且包内文件哈希保持不变。 macOS 最终关闭场景:暂停旧模块清理、排队文档和维护激活、关闭项目会话、释放清理;即使 AppModel 保留工作区 URL 与打开文档,也不能重新发布语言能力或启动 LSP。 macOS 生产 RustCoreBridge 与本地协议进程验证插件身份、host services、配置值和缓存启动上下文。 macOS 在大型工程导入期间打字、滚动与补全不掉帧(事件 drain 已移出主线程)。 Core:cargo test -p lithe-core --lib failed_initialize、failed_start 与 invalid_initial_configuration_is_rejected_before_launch,确认启动失败的进程确认退出后才允许下一次启动,清理不了时拒绝新启动。 #1662 LSP-08:启动失败后的自动重试由 Core 的 lsp.activationPolicy 决定,时间使用平台单调时钟。每次失败后自动启动等待 5 秒;连续失败 3 次后停止自动启动,只能显式重启或修复后重试;会话就绪、显式启动或停止会清空记录。macOS 新增失败后 5 秒冷却(此前可立即重试),Windows 新增 3 次上限(此前每 5 秒无限重试)。在两端用无法启动的语言服务器打开文件,确认 5 秒内不重复启动、第 3 次失败后不再自动启动、显式重启后恢复。 停止语言服务器时的进程组(2026-11-16,#2017,Lithe-core-rust #63,两端通过 Core ad148ec 获得):macOS 上语言服务器的进程都已退出、但还没被回收时,kill(-pgid) 返回 EPERM,Core 原来把它当成失败,停止或重启时报“Language-server process tree did not exit.”,会话留在注册表里;现在 EPERM 也视为已发出信号,是否结束仍由截止时间内的等待判断。Core 回归测试:cargo test -p lithe-platform-tests a_unix_tree_of_exited_unreaped_processes_ends_without_error。Windows 用 Job 对象,不走这段代码。 TestPluginEnableStartsServerForOpenDocument 验证启用插件后原标签收到 didOpen。", + "notes": "Viva 已接入插件语言服务器的启动、停止和文档同步,Problems 工具窗口展示服务器诊断,并在项目切换、服务器重启/停止/崩溃及插件禁用后清理;补全、悬浮、导航、重命名与格式化见各自能力行。macOS 已用真实 clangd 系统命令进程验证启动、文档打开/增量编辑/保存/关闭和诊断到达;Windows 和资源清理未验证。 启用语言服务器插件时,已打开且已识别语言的文件可在原标签开始同步。", "legacy": { "revision": "5a54c41aa37a4e6e6b68918a4b05765b9dd07a36", "macos": { diff --git a/shared/platform-feature-matrix/features/plugin-workspace-recommendations.json b/shared/platform-feature-matrix/features/plugin-workspace-recommendations.json index 9c3b65771..6e25850cf 100644 --- a/shared/platform-feature-matrix/features/plugin-workspace-recommendations.json +++ b/shared/platform-feature-matrix/features/plugin-workspace-recommendations.json @@ -2,10 +2,10 @@ "id": "plugin-workspace-recommendations", "area": "扩展", "group": "插件与主题", - "capability": "打开工作区时对项目根及浅层子目录执行有界非阻塞扫描,结合插件市场发布的独立推荐索引与 Core 匹配规则筛选尚未安装或未被替代插件覆盖的可安装插件,并在应用内发出一条汇总通知,支持一键跳转到对应插件市场页面或永久不再提示。", + "capability": "打开工作区时对项目根及浅层子目录执行有界非阻塞扫描,结合插件市场发布的独立推荐索引与 Core 匹配规则筛选尚未安装或未被替代插件覆盖的可安装插件,并在应用内发出一条汇总通知,支持一键跳转到对应插件市场页面或永久不再提示。「查看插件」在只有一项时打开市场并搜索名称,有多项时打开无搜索词的市场。", "owner": "Extensions", "notes": "Viva Go 跨平台实现;桌面端仅保留协议与通用算法,具体插件与语言映射规则完全由外部插件市场同级索引提供,向后兼容旧版市场客户端。同一会话对市场目录缓存 15 分钟且按工作区根目录去重;选择不再提示后将插件 ID 持久化到设置文件中。macOS 与 Windows 原生真实环境均共享该逻辑。", - "verification": "自动化:Lithe-core-rust 契约单测(marketplace_plugins)、desktop/internal/core/marketplace_test.go 契约 fixture 测试、desktop/internal/marketplace/service_test.go HTTP 404/200/校验测试、desktop/internal/workbench/plugin_recommendations_test.go 与 notifications_test.go 覆盖深度与条目上限/符号链接跳过/多插件合并/覆盖插件过滤/查看插件与不再提示持久化,以及 -race 并发测试与无头 Viva 暗亮/中英截图验证。Windows 原生实机验证待 CI/VM 执行。", + "verification": "自动化:Lithe-core-rust 契约单测(marketplace_plugins)、desktop/internal/core/marketplace_test.go 契约 fixture 测试、desktop/internal/marketplace/service_test.go HTTP 404/200/校验测试、desktop/internal/workbench/plugin_recommendations_test.go 与 notifications_test.go 覆盖深度与条目上限/符号链接跳过/多插件合并/覆盖插件过滤/查看插件与不再提示持久化,以及 -race 并发测试与无头 Viva 暗亮/中英截图验证。Windows 原生实机验证待 CI/VM 执行。 TestOpenMarketplaceWithoutSearch 覆盖新窗口和已经打开的设置窗口。", "macos": { "implementationStatus": "implemented", "verificationStatus": "verified", @@ -18,7 +18,8 @@ "desktop/internal/workbench/notifications_test.go", "desktop/internal/workbench/plugin_recommendations.go", "desktop/internal/workbench/plugin_recommendations_test.go", - "desktop/internal/workbench/plugin_recommendations_visual_test.go" + "desktop/internal/workbench/plugin_recommendations_visual_test.go", + "desktop/internal/settingswindow/marketplace_view_test.go" ] }, "windows": { @@ -33,7 +34,8 @@ "desktop/internal/workbench/notifications_test.go", "desktop/internal/workbench/plugin_recommendations.go", "desktop/internal/workbench/plugin_recommendations_test.go", - "desktop/internal/workbench/plugin_recommendations_visual_test.go" + "desktop/internal/workbench/plugin_recommendations_visual_test.go", + "desktop/internal/settingswindow/marketplace_view_test.go" ] } }