UnrealDev.nvim 更新:切换到 SQLite,实现极速性能

发布: (2025年12月29日 GMT+8 16:54)
3 min read
原文: Dev.to

Source: Dev.to

恰逢年末,我为 UnrealDev.nvim 发布了一次重大更新!
之前,UnrealDev.nvim(以及它的核心 UEP.nvim)使用 JSON 文件来缓存项目信息。对于大型 Unreal Engine 项目来说,庞大 JSON 文件的文件 I/O 开销成为了明显的瓶颈。本次更新将缓存后端迁移至 SQLite,实现了显著更快的文件导航和项目分析。

关键更改与安装

  1. 新依赖:sqlite.lua
    插件现在需要以下库:
    kkharji/sqlite.lua

Windows 用户的重要提示

sqlite.lua 需要 sqlite3.dll 才能运行。通过 winget 等包管理器安装 SQLite 可能只会提供 .exe,而不包含所需的 .dll

解决方案

  • 直接从 SQLite 下载页面 下载包含 DLL 的 Windows 二进制文件。
  • 在你的 init.lua 中配置路径:
-- 示例:设置 sqlite3.dll 的路径
vim.g.sqlite_clib_path = "C:\\Users\\username\\path\\to\\sqlite3.dll"

更新后的 :checkhealth

健康检查现在会验证 SQLite 状态。当一切配置正确时,你应当看到类似以下的输出:

UnrealDev:                                                                  ✅

UnrealDev Dependencies ~
- ✅ OK Executable 'fd': Found (File finder)
- ✅ OK Executable 'rg': Found (Ripgrep text searcher)
- ✅ OK UNL.nvim: Installed (Core Library & Utilities)
- ✅ OK Plugin 'kkharji/sqlite.lua' found.
- ✅ OK Path configured: C:\Users\taku3\AppData\Local\Programs\sqlite\sqlite3.dll
- ✅ OK SQLite is working correctly! (In-memory DB test passed)
...

命令统一

多个特定命令已被废弃并合并到主命令中。

  • 已废弃: :UEP config_files, :UEP program_files, :UEP config_grep, :UEP program_grep
  • 合并至: :UEP files, :UEP grep

命令参数现在支持新的 mode 参数:

:UEP files [scope] [mode] [deps_flag]
:UEP grep  [scope] [mode] [deps_flag]

你可以通过 mode 参数指定文件类型(默认是 source)。

示例

" 在 Runtime 模块中查找 Config(.ini)文件
:UEP files runtime config

" 在 Game 项目中查找 Programs(工具)的源文件
:UEP files game programs

" 在 Engine 中查找 Shader(.usf/.ush)文件
:UEP files engine shader

这使得通过组合 scopemode 实现灵活过滤成为可能。
注意:像 :UEP module_files 这样的命令仍保持独立,以便对模块特定操作保持参数逻辑的简洁性。

Back to Blog

相关文章

阅读更多 »