DEV Community

taku25
taku25

Posted on

🚀 Neovim for Unreal Engine: Major Update with Asset Tracking Plugin 'UEA.nvim'

It's not Friday yet, but the plugin suite designed to accelerate Unreal Engine development in NeoVim just got a major update and a powerful new addition! The highly anticipated plugin for handling asset references within binary files, UEA.nvim, has officially arrived.


🌟 Weekly Highlight: Introducing UEA.nvim!

We are excited to announce the release of UEA.nvim (Unreal Engine Asset). This plugin performs shallow parsing of binary asset data (.uasset, .umap) using ripgrep (rg) to quickly track reference relationships between C++ code and assets.

💡 Compatibility Note
Since .uasset searching involves binary parsing, the displayed information may not always be perfectly accurate, but functionality has been verified on UE5.3 and UE5.6.


💎 UEA.nvim Key Features and Commands

UEA.nvim brings asset manipulation functionalities close to those of the Unreal Editor directly into Neovim.

1. Code Lens

The plugin displays usage metrics directly above C++ class definitions (.h, .cpp).

⚠️ Note: The Code Lens feature requires tree-sitter-unreal-cpp to be installed.

  * Function: In the class definition area, Code Lens shows the number of inheriting assets ( X Children) and the total number of referencing assets ( Y Refs).
  * Command: Use :UEA refresh_lens to update the lens manually.

Code Lens

2. Asset Reference and Dependency Search

Command Action Primary Use Case
:UEA find_bp_usages[!] Lists Blueprint/assets that are referencing the C++ class under the cursor. Use ! to select from a list of all C++ classes. Tracking all child assets inheriting from a specific C++ class.
:UEA find_references[!] Lists other assets that are "referencing" (using) the selected asset. Investigating the impact of a breaking change or deletion (which assets will break?).
:UEA find_dependencies[!] Lists assets and classes that the selected asset "depends on" (uses internally). Understanding the composition and requirements needed for an asset to function correctly.

find_bp

3. Asset Path Manipulation and External Integration

Command Function
:UEA copy_reference Lists assets and copies the Reference Path (e.g., /Game/BP_MyActor.BP_MyActor_C) of the selected asset to the clipboard.
:UEA system_open Lists assets and opens the folder containing the selected asset's physical file in the OS file explorer (Finder/Explorer).
:UEA show_in_editor Selects an asset and synchronizes the Unreal Editor Content Browser to that asset. (The asset is not opened.)
:UEA find_bp_parent[!] Selects an asset and displays its Native Parent Class (the C++ base class name).
:UEA grep_string Performs a Live Grep for a string within the asset files.

🛠️ UEP/UCM Integration Fixes and Enhancements

The existing core plugins, UEP.nvim and UCM.nvim, received vital improvements in stability and integration logic.

🐞 Bug Fixes

  1. UEP Cache Initialization Stability:
    • Fixed an issue where a specific Warning message would appear when executing :UEP refresh immediately after :UEP cleanup.
  2. UCM Operation Synchronization:
    • Fixed a bug where changes made by :UCM new_class, :UCM delete, or :UCM rename were not immediately reflected in lists like UEP files.

🔗 Class List Logic Improvement (Shallow-deps)

When listing classes (e.g., for selecting a parent class in UCM new_class), the scope was previously limited to the Game component.

  • Change: The class list scope is now fetched based on Shallow-deps (Direct Dependencies).
  • Effect: This prevents an overwhelming list of unnecessary Engine classes from being displayed, while ensuring all required dependency classes (AActor, UUserWidget, etc.) are available, promoting safe inheritance practices.

⚙️ New Command: OS File Explorer Integration

A command to open file and asset paths directly in the OS file explorer has been added to UEP.nvim.

  • :UEP system_open[!] [Path]
    • Function: Opens the location of the current file, or the specified file/asset path, in the system's file explorer (Windows Explorer, macOS Finder, xdg-open) and selects the file.

⚙️ UnrealDev.nvim Initialization Control Changes

The wrapper plugin UnrealDev.nvim has been improved to address an issue where it would inadvertently enable APIs for plugins that were not included in the dependency list, often leading to initialization errors or warnings.

Controlling API Activation via Configuration

When setting up UnrealDev.nvim (e.g., using lazy.nvim), you can now explicitly control which plugins' setups are run via the setup_modules table.

return {
  {
    'taku25/UnrealDev.nvim',
    -- Define all plugins you actually use here.
    dependencies = {
      {
        'taku25/UNL.nvim', -- Core Library (Required)
        lazy = false,
      },
      'taku25/UEP.nvim',   -- Project Explorer (Used)
      'taku25/UCM.nvim',   -- Class Manager (Used)
      -- 'taku25/UBT.nvim', -- Comment out if not used
       { 
          'nvim-treesitter/nvim-treesitter',
           branch = "main",
           config = function(_, opts)
             vim.api.nvim_create_autocmd('User', { pattern = 'TSUpdate',
               callback = function()
                 local parsers = require('nvim-treesitter.parsers')
                 parsers.cpp = {
                   install_info = {
                     url  = 'https://github.com/taku25/tree-sitter-unreal-cpp',
                     revision  = '89f3408b2f701a8b002c9ea690ae2d24bb2aae49',
                   },
                 }
              end
            })
            local langs = { "c", "cpp",  }
            require("nvim-treesitter").install(langs)
            local group = vim.api.nvim_create_augroup('MyTreesitter', { clear = true })
            vim.api.nvim_create_autocmd('FileType', {
               group = group,
               pattern = langs,
               callback = function(args)
                  vim.treesitter.start(args.buf)
                  vim.bo[args.buf].indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
               end,
            })
         end
       }
    },
    opts = {
      -- Only modules defined here will attempt to run setup.
      setup_modules = {
        UEP = true,  
        UCM = true,  
        -- UBT = false, 
      },
    },
  },
}
Enter fullscreen mode Exit fullscreen mode
  • Result: Commands like UDEV refresh or UDEV new_class will only be defined and active for plugins included in your dependencies.
  • Note: Commands may still be defined even if the plugin is missing, but this change eliminates initialization errors and warnings.

✨ Final Thoughts

If you find these plugins (UnrealDev.nvim or UEA.nvim) useful for your workflow, please consider starring the GitHub repositories! Your support is a huge encouragement to continue development!

Top comments (0)