Repository navigation
feat(logging): LuaLS 日志写入宿主会话日志目录 - #6
Merged
Merged
Conversation
- plugin.json 升到 pluginAPIVersion 2,启动参数传入 ${logDir}
- 启动器把 --logpath 指向宿主提供的会话目录,并固定 --loglevel=warn;
不再创建缓存下的 log/ 目录,meta 仍在用户缓存目录
- 非绝对路径的日志目录直接以退出码 64 拒绝
- README 补充诊断日志说明和宿主版本要求
This was referenced Nov 4, 2026
xiaoyumuxi
marked this pull request as ready for review
November 4, 2026 10:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
Lua 插件接入结构化日志 v2:插件升到插件 API 2,通过启动模板
${logDir}把宿主分配的会话日志目录传给 LuaLS,LuaLS 只保留 warn/error 并写入该目录,不再在用户缓存目录下自建log/。语言服务生命周期、window/logMessage和有界 stderr 仍由宿主统一写入lsp/lua通道。本插件没有后端,也不使用 SDK。依赖:
${logDir}启动模板,已合入preview,尚未进入稳定版)清单(
plugin.json)pluginAPIVersion从 1 改为 2。[]改为["${logDir}"]。启动器(
bin/lithe-lua-language-server)shift,其余参数照旧传给 LuaLS。$state_dir/meta,不再创建$state_dir/log。--logpath="$log_dir" --loglevel=warn;--metapath仍指向用户缓存目录。README
plugins/io.github.lithe-idea.lua-support/files/;生成的标准库定义仍在~/Library/Caches/io.github.lithe-idea.lua-support/meta/(设置XDG_CACHE_HOME时用其对应目录),两者生命周期独立。logDirectory的最新 macOS Lithe preview。--logpath、--loglevel、--metapath是 LuaLS 3.19.1 的公开 CLI 参数;默认只保留 warn/error,避免 trace/debug 的协议和文档内容写进文件。logDirectory时,按已有启动契约明确拒绝${logDir},不回退到安装目录。验证
sh -n检查启动器语法通过。node scripts/package.mjs通过,生成 arm64、x64 两个包。预期的 CI 状态与合并顺序
${logDir},LuaLS 无法启动。限制
配套 PR: