Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ Windows 全量回归发现,原 Go 适配器去掉 `file://` 后把 `/elsewhere

把发行目录作为默认写入根会改变安装基线,因此所有来源只由平台存储或用户工作区提供。乐观字节检查不会锁住不遵守协议的外部写入者,不宣称跨进程事务锁。

### 工具原生配置使用独立的来源表单

插件偏好与工具配置分开处理。通用 `sourceSettings: 0` 由 Core PR [#57](https://github.com/Lithe-IDEA/Lithe-core-rust/pull/57) 定义,插件只返回非敏感字段和真实来源摘要;原始工具文档不跨 RPC。格式解析与编辑仍在所属插件,宿主不认识工具名称。

编译器页面归“构建、执行、部署”。打开页面只显示明确的读取按钮,点击后才使声明的语言/构建会话就绪并取得上游实际项目事实。工具读取可能运行项目代码和下载依赖,不以打开页面代替授权。读取、暂存和回读都在有界后台任务中执行。

Core 区分原始覆盖、当前有效值与移除覆盖后的继承值。界面保留草稿,模块表只增加用户选中的覆盖;不把查看继承值变成写入。外部更改在保存时通过原生基线拒绝,不以本地草稿覆盖新文件。

宿主在系统临时目录创建一次调用拥有的 0700 目录和已存在的 0600 文件,插件只能写暂存。所有替换先准备完成,再逐个经原生条件原子写入发布;每次发布前复查整批基线、工作区和包身份。多文件不能提供文件系统事务,部分提交被明确报告并要求重读。安装根和插件仓库只读,临时目录在成功、失败和取消时清理;可变状态不跨工作树复用,不影响签名或增量更新基线。

## 后果

保护逻辑只在后台读取或明确保存时运行,没有空闲轮询或帧内文件 I/O。批量非法输入、取消和外部修改不会覆盖旧来源;项目层清空只删除已经为空的目标文档,不删除其他插件配置。生成的用户状态和临时文件全部排除工作树复用。
Expand Down Expand Up @@ -134,3 +144,12 @@ Core 和 C ABI 共享同一份 `Lithe-core-rust/rust/fixtures/plugins/settings-d
桌面桥接、界面和工作台回归分别在 `desktop/internal/core/settings_surfaces_test.go`、
`desktop/internal/settingswindow/settings_surfaces_test.go` 和
`desktop/internal/workbench/settings_publication_test.go`。


### 全局 SDK 登记不依赖项目

SDK 的安装目录和默认版本属于本机用户,不应要求先打开项目,更不应在每个项目复制一份安装列表。因此工具链页默认显示全局范围,允许自动识别与手动添加多个目录;项目范围只保留可选覆盖。两个范围共用同一解析器,项目覆盖优先于全局默认,清空全局默认只恢复自动选择,不删除手动登记。

Core 负责有界登记文档、目录身份规则与合并;原生适配器在平台用户设置目录读取 `toolchains/global.json`,保存前核对原始字节和文件身份,保存后重新探测。打开页面不创建目录;版本号不作为持久化事实;运行中进程保留启动时环境,新启动的 Build、Run、语言服务读取最新默认值。不要用当前工作目录冒充全局操作的项目,也不要写入 SDK、插件安装目录或 app bundle;该资源随用户设置存续,不影响签名和增量更新。

放弃把全局默认复制为每个项目 pin 的方案,因为这会阻断以后切换全局默认。验证覆盖无项目读取、多版本登记、保存冲突、两个项目的实时继承及显式项目覆盖;窗口测试覆盖多个添加草稿和确认保存。
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Agent 笔记:诊断下划线按实际字符列定位并复用波浪网格

状态:已实现

## 先说结论

语言服务器给出的 UTF-16 位置不能直接当成屏幕字符列。诊断先绑定不可变文本修订,在后台换算 Tab、中文与表情的显示宽度;窗口只接收仍属于当前修订的结果。波浪线复用 Viva 的不可变图形网格,不能每帧重新生成整段笔画。

## 问题

UTF-16 用两个单位表示部分表情,中文通常占两个显示格,Tab 又取决于前面的列。直接把诊断偏移乘以字体宽度会让线条与标识符错位。把修正后的长波浪路径在每帧交给通用描边器,又会在密集诊断文件中反复计算同一几何形状。

## 决策

`ProjectMarkers` 只读取捕获的不可变文本,按行合并诊断端点,一行最多扫描到最后一个端点;结果仅含显示格范围。后台操作有取消与期限,回到窗口时核对文档、代数和文本修订;关闭文档会取消自己的投影。原生编辑器仍是文本和字体布局的所有者,Core 不保存第二份全文。

短线使用有界的视图内图形集合,最多 32 种、合计 8192 条路径指令,调用 Viva 既有的有界图形缓存。新形状超出额度或长于 512 点时,重复绘制同一个固定周期,并只裁剪两端。图形没有文件资源或后台进程,视图销毁时释放自己的集合。横向移动与换行沿用文档列的相位,线条靠近实际文本基线。

正确做法:文本改变后丢弃旧投影,稳态绘制只复用网格。不要这样做:绘制时扫描全文、在服务器线程修改视图、按每个文档或每个诊断无界缓存路径。

## 考虑过的备选方案

- 直接使用 UTF-16 偏移:无法对齐宽字符和 Tab,拒绝。
- 每帧重新描整条波浪:实测显著增加密集诊断绘制耗时,拒绝。
- 为全部宽度建立永久全局缓存:会随文档和缩放累积几何数据,拒绝。
- 保留直矩形线:虽然开销低,但不满足诊断波浪线的视觉要求。

## 后果

投影到达前不展示过期标记;稳态绘制无堆分配。波浪比原直矩形包含更多绘制图元,必须在同机六次基线中报告实际代价,不得通过改预算或减少诊断来隐藏它。典型上限和所有权在代码中显式保持,不创建运行时磁盘资源。

## 验证

`desktop/internal/editorview/markers_test.go` 覆盖 Tab、中文、表情、混合字符、分数像素、取消与过期修订;原始错位和直线实现先失败,修正后通过。`desktop/internal/workbench/diagnostic_visual_test.go` 捕获中英、明暗主题的生产窗口。`scripts/desktop/perf/editor-bench.sh` 按原有完整场景和文档规模运行前后六次基线,密集标记继续要求零稳态分配。平台原生验证独立记录。

## 适用范围

Viva 编辑器的诊断投影、文本修订发布和下划线绘制,不改变上游诊断内容、严重级别或语言服务语义。
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
| 外观与行为 | 应用本身的外观、更新、编辑器显示与输入、快捷键,以及应用自身网络请求的代理设置 |
| 插件 | 插件的安装、启用和插件自带的选项;一级页面,不属于任何分组 |
| 版本控制 | Git、SVN 等版本控制系统的配置 |
| 构建、执行、部署 | 构建工具、项目 JDK、运行配置、服务运行,以及框架和构建工具注入的配置 |
| 构建、执行、部署 | 构建工具、项目 JDK、插件声明的编译器页与模块字节码、运行配置、服务运行,以及框架和构建工具注入的配置 |
| 语言与框架 | 语言服务(LSP)的开关,以及 Spring Boot 等框架的配置 |
| 工具 | 终端等通用工具;插件带来的专用工具可以放进对应工具页。日志与诊断不属于设置,它是独立的日志窗口 |
| AI | 与 AI 有关的全部配置:MCP、Skill、全局指令、AI 提交信息、Agents、AI 服务商 |
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/desktop-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,20 @@ jobs:
- name: Vet and test
run: ./scripts/desktop/check.sh

- name: Capture native settings and diagnostic screenshots
env:
LITHE_VISUAL_OUTPUT_DIR: ${{ github.workspace }}/.artifacts/native-settings-visual
run: ./scripts/desktop/desktop-go.sh test -tags 'vivahead lithevisual' ./internal/settingswindow ./internal/workbench -run '^(TestVisualNativeSettingsForm|TestVisualDiagnosticUnderline)$' -count=1 -timeout=120s

- name: Upload native settings visual evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: native-settings-visual-${{ runner.os }}-${{ runner.arch }}
path: .artifacts/native-settings-visual/*.png
if-no-files-found: error
retention-days: 14

- name: Upload native cache regression report
if: always()
uses: actions/upload-artifact@v7
Expand Down Expand Up @@ -288,6 +302,20 @@ jobs:
- name: Vet and test
run: ./scripts/desktop/check.sh

- name: Capture native settings and diagnostic screenshots
env:
LITHE_VISUAL_OUTPUT_DIR: ${{ github.workspace }}/.artifacts/native-settings-visual
run: ./scripts/desktop/desktop-go.sh test -tags 'vivahead lithevisual' ./internal/settingswindow ./internal/workbench -run '^(TestVisualNativeSettingsForm|TestVisualDiagnosticUnderline)$' -count=1 -timeout=120s

- name: Upload native settings visual evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: native-settings-visual-${{ runner.os }}-${{ runner.arch }}
path: .artifacts/native-settings-visual/*.png
if-no-files-found: error
retention-days: 14

- name: Upload native cache regression report
if: always()
uses: actions/upload-artifact@v7
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/desktop-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Desktop Release

# Releases the Viva desktop client (desktop/) for macOS, Windows and Linux. Its tags are
# desktop-vMAJOR.MINOR.PATCH, apart from the v* tags of the SwiftUI and Tauri clients, and each
# release is a GitHub prerelease, so those clients' updaters continue to read their own latest release.
# release is stable. Keep the legacy clients' latest release unchanged; desktop updates select desktop-v tags.
on:
push:
tags:
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
if-no-files-found: error

publish:
name: Publish the prerelease
name: Publish the release
if: github.event_name != 'workflow_dispatch' || inputs.publish
needs:
- prepare
Expand All @@ -201,7 +201,7 @@ jobs:
DESKTOP_VERSION: ${{ needs.prepare.outputs.version }}
run: node scripts/ci/common/desktop-packages.mjs verify "$DESKTOP_VERSION" dist

- name: Create or update the GitHub prerelease
- name: Create or update the GitHub release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ needs.prepare.outputs.tag }}
Expand All @@ -211,7 +211,8 @@ jobs:
--repo "$GITHUB_REPOSITORY"
--title "Lithe Desktop $DESKTOP_VERSION"
--notes-file "docs/releases/v$DESKTOP_VERSION.md"
--prerelease
--prerelease=false
--latest=false
)
if ! gh release view "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" > /dev/null 2>&1; then
gh release create "$RELEASE_TAG" --target "$GITHUB_SHA" "${release_args[@]}" || \
Expand Down
4 changes: 2 additions & 2 deletions desktop/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ toolchain go1.27.3
require (
github.com/creack/pty v1.1.24
github.com/tailscale/hujson v0.0.0-20260727124030-b80ff77dac4f
github.com/vivaui/viva v0.6.5-0.20261115084025-ad3c812a43e2
github.com/vivaui/viva v0.6.5-0.20261115140306-89ce846fe65c
github.com/zalando/go-keyring v0.2.8
golang.org/x/sys v0.50.0
)
Expand All @@ -20,4 +20,4 @@ require (
github.com/godbus/dbus/v5 v5.2.2 // indirect
)

replace github.com/vivaui/viva => github.com/Lithe-IDEA/viva v0.6.5-0.20261115111929-3a274c3800ef
replace github.com/vivaui/viva => github.com/Lithe-IDEA/viva v0.6.5-0.20261115165622-97fdbdde326b
4 changes: 2 additions & 2 deletions desktop/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/Lithe-IDEA/viva v0.6.5-0.20261115111929-3a274c3800ef h1:p3n2Bsu2/gCcNmbVBJ5eu6NEW8JjUX7zf/uzgFAA9Mc=
github.com/Lithe-IDEA/viva v0.6.5-0.20261115111929-3a274c3800ef/go.mod h1:e9In6+J77G7B9ow4enZ2FSOFh7U3q4cQ5iJr3Qn/Olk=
github.com/Lithe-IDEA/viva v0.6.5-0.20261115165622-97fdbdde326b h1:JY0yXuRzZDlj6KHC712le49ISjGVrkFwm9KP5XlJFH8=
github.com/Lithe-IDEA/viva v0.6.5-0.20261115165622-97fdbdde326b/go.mod h1:e9In6+J77G7B9ow4enZ2FSOFh7U3q4cQ5iJr3Qn/Olk=
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=
github.com/danieljoos/wincred v1.2.3 h1:v7dZC2x32Ut3nEfRH+vhoZGvN72+dQ/snVXo/vMFLdQ=
Expand Down
1 change: 1 addition & 0 deletions desktop/internal/core/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ type BuildExecutableCandidate struct {
// BuildRuntimeRequirement is a runtime the build tool needs, with the probe
// Core expects the host to run when it must check the version.
type BuildRuntimeRequirement struct {
PathVariable string `json:"pathVariable,omitempty"`
ID string `json:"id"`
DisplayName string `json:"displayName"`
HostManaged bool `json:"hostManaged"`
Expand Down
20 changes: 12 additions & 8 deletions desktop/internal/core/plugin_setting_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@ type PluginSettingsActionRequest struct {
// Only an invoke plan contains Function and Params; runtime ownership is checked
// again when the existing provider session receives that invocation.
type PluginSettingsActionPlan struct {
Version string `json:"version"`
Kind string `json:"kind"`
PluginID string `json:"pluginID"`
ActionID string `json:"actionID"`
Title string `json:"title"`
Reason string `json:"reason,omitempty"`
Function string `json:"function,omitempty"`
Params json.RawMessage `json:"params,omitempty"`
Version string `json:"version"`
Kind string `json:"kind"`
PluginID string `json:"pluginID"`
ActionID string `json:"actionID"`
Title string `json:"title"`
Reason string `json:"reason,omitempty"`
Function string `json:"function,omitempty"`
Params json.RawMessage `json:"params,omitempty"`
SourceEditor bool `json:"sourceEditor,omitempty"`
BuildSystemID string `json:"buildSystemID,omitempty"`
LanguageID string `json:"languageID,omitempty"`
EditFunction string `json:"editFunction,omitempty"`
}

// PlanPluginSettingsAction resolves a manifest action without opening a backend
Expand Down
22 changes: 15 additions & 7 deletions desktop/internal/core/plugin_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
type PluginSettingPage struct {
LanguageID string `json:"languageID,omitempty"`
BuildSystemID string `json:"buildSystemID,omitempty"`
CompilerID string `json:"compilerID,omitempty"`
}

// PluginSettingOption is one value and its plugin-provided display title.
Expand Down Expand Up @@ -56,13 +57,20 @@ type PluginSettingRow struct {

// PluginSettingAction invokes a declared function only after a user action.
type PluginSettingAction struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Page *PluginSettingPage `json:"page,omitempty"`
Section string `json:"section,omitempty"`
Function string `json:"function"`
Confirm bool `json:"confirm"`
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Page *PluginSettingPage `json:"page,omitempty"`
Section string `json:"section,omitempty"`
Function string `json:"function"`
Confirm bool `json:"confirm"`
SourceEditor *PluginSourceEditorDeclaration `json:"sourceEditor,omitempty"`
}

type PluginSourceEditorDeclaration struct {
BuildSystemID string `json:"buildSystemID,omitempty"`
LanguageID string `json:"languageID,omitempty"`
EditFunction string `json:"editFunction"`
}

// PluginSettingsStorage is Core's bounded read plan under native-owned roots.
Expand Down
Loading
Loading