0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

UnrealDev.nvim: SQLite導入でキャッシュ読み込みを爆速化しました

Posted at

今年の駆け込みアップデートです!
これまで UnrealDev.nvim (および UEP.nvim) では、プロジェクト情報のキャッシュにJSONファイルを使用していました。しかし、大規模なUnreal Engineプロジェクトではファイルサイズが肥大化し、大量の書き込み&読み込みによるI/Oがボトルネックとなり、動作が重くなることがありました。

そこで今回、キャッシュ周りのバックエンドを SQLite に刷新しました!
これにより、データの読み書きが劇的に高速化され、NeovimでのUnreal Engine開発体験がさらに快適になりました。

🔧 主な変更点と導入方法

1. 必須要件の変更: sqlite.lua の導入

今回のアップデートにより、以下のプラグインが必須依存関係として追加されました。

Windowsユーザーへの注意点 (重要):
sqlite.lua を動作させるには sqlite3.dll が必要です。
winget 等でインストールした場合、.exe しか含まれておらず .dll がないケースがあります。その場合、プラグインがロードできません。

解決策:

  1. SQLite公式サイト から Windows用のバイナリ (dllが含まれているもの) を直接ダウンロードします。
  2. 適当な場所に配置し、init.lua 等でパスを指定してください。
-- 例: sqlite3.dll のパスを指定
vim.g.sqlite_clib_path = "C:\\Users\\username\\path\\to\\sqlite3.dll"

2. :checkhealth の対応

セットアップが正しいか確認するために、: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

これに伴い、コマンドの引数仕様が以下のように拡張されました。

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

新しく追加された mode 引数で、検索対象のファイル種別を指定できます。
(デフォルトは source です)

使用例:

" ランタイムモジュールの Config (.ini) ファイルのみを検索
:UEP files runtime config

" ゲームプロジェクト内の Program (ツール類) のソースを検索
:UEP files game programs

" エンジン全域の Shader (.usf/.ush) ファイルを検索
:UEP files engine shader

このように、スコープとモードを組み合わせることで、必要なファイルへ瞬時にアクセスできるようになりました。

:UEP module_files などのモジュール指定系コマンドについては、引数が複雑になりすぎるのを避けるため、今回は統合せずそのまま残しています。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?