DEV Community

taku25
taku25

Posted on

This Week in UnrealDev.nvim: Major Cache Overhaul & Smarter Builds!

Hey, dev.to community!

Another week, another big update for the UnrealDev.nvim plugin suite. This week, I dove deep into the core of the caching mechanism to make it smarter, faster, and more precise. Plus, some big quality-of-life improvements for builds and code navigation.

Hereโ€™s whatโ€™s new!


๐Ÿš€ Core Improvements

1. High-Precision Caching

This is the biggest change. Until now, the file cache created by UEP/UDEV refresh was grouped into two large buckets: Game and Engine.

Iโ€™ve refactored this to parse your build.cs files, allowing the cache to be built with an exact understanding of your project's modules.

2. Granular Scopes

Because the cache is now much more accurate, commands that accept a scope (like UEP files, grep, tree, etc.) can now use much more specific scopes:

  • Game: Your project's source code
  • Engine: The entire engine source code
  • Runtime: All Runtime-related source code (from both project and engine)
  • Editor: All Editor-related source code (including Runtime) (from both project and engine)
  • Full: All source code from the project and engine

3. Smarter Dependency Flags

The --deps-flag option also got a matching upgrade. We've moved from a simple --all-deps/--no-deps choice to a more nuanced system:

  • --shallow-deps (Default): Includes direct dependencies only.
  • --deep-deps: Includes all dependencies, recursively.
  • --no-deps: Includes no dependencies.

This is supported by all commands that use scopes and dependency flags.

4. Header Parsing Performance

I've moved header file parsing off the main thread and into a worker thread. This should make a noticeable difference and speed things up, especially on project refreshes.


โœจ New Commands

  1. UEP/UDEV enums
  * You can now get a full list of `enums` in your project and jump straight to their definition! This is possible thanks to a new enum-parsing pass.
  * This also means `UEP/UDEV goto_definition` now works for enums.
  * *(Note: This doesn't currently work for `typedef`-based types like `FVector3D`.)*
Enter fullscreen mode Exit fullscreen mode

enums

  1. UEP/UDEV config_files
  * Quickly list and open any of your project's config (`.ini`) files.
Enter fullscreen mode Exit fullscreen mode
  1. UEP/UDEV config_grep
  * Lets you run `grep` scoped specifically to your config files.
Enter fullscreen mode Exit fullscreen mode

config_grep


๐Ÿ› ๏ธ Changes to Existing Features

  1. UEP/UDEV tree
  * Thanks to the more accurate file data, the default scope for this command has been changed to `runtime`.
Enter fullscreen mode Exit fullscreen mode
  1. UCM move / UDEV move_class / UCM rename / UDEV rename_class
  * These class refactoring commands are now much smarter. When you move or rename a class, the plugin will **automatically update the corresponding `.cpp` file's header include path AND its `"xxxx.generated.h"` include**.
Enter fullscreen mode Exit fullscreen mode

rename


๐Ÿ”— Tighter UBT Integration

Commands that require a build target (like UBT/UDEV build!) have been improved. If UEP is loaded and your project has been analyzed, the plugin will now parse your Target.cs files to provide a perfectly accurate list of build targets.

I've also added two new settings to your UBT config:

  1. Specify your installed SDKs
    If you have platform SDKs like iOS or Android installed, you can tell UBT to offer them as build targets:

    -- UBT config
    {
      has_sdks = { "iOS", "Android" },
    }
    
  2. Use last preset as default
    This new option (defaulting to true) will make UBT remember the last build preset you chose for each project. This means you can just run UBT build! without setting a preset, and it will automatically suggest your last-used one.

    -- UBT config
    {
      use_last_preset_as_default = true, -- default: true
    }
    

    (Note: This setting is not persisted forever. It resets when you close Neovim.)

build


๐Ÿ“ The Wiki is Live!

I've officially started a GitHub Wiki for the UnrealDev.nvim repository!

Check it out here: https://github.com/taku25/UnrealDev.nvim/wiki

There isn't a ton of info there yet, but I'll be adding more and more content over time.


๐Ÿ“… What's Next?

Now that I've optimized the second (heavy) half of the UEP refresh process, I really want to speed up the first (project analysis) half. I'm struggling with it a bit, but I plan to keep fighting with that optimization next.

Oh, and I previously mentioned I might try to automate forward-declarations. I've decided to drop that feature. I remembered that since C++11, you can just re-declare the enum type at the definition site, which makes a complex automation feature less necessary.


๐Ÿ’ฌ A Quick Personal Note

I've been watching the "Unique clones" metric on the GitHub repo, and it makes me really happy to see a few new clones every single day.

Knowing that people are actually using this stuff is a huge motivation for me as a developer. Of course, there are also days with zero clones, which reminds me that it's still a very niche tool. But it's also cool to realize, "Wow, there are actually other people out there using Neovim for Unreal Engine!"

Thanks for reading, and see you in the next update!

Top comments (0)