Skip to content

Features

VukeFN edited this page Aug 15, 2026 · 12 revisions

Features

This page provides detailed explanations of all Verse Auto Imports features.

Table of Contents


Automatic Import Detection

When you use an identifier that needs an import, like player or creative_device, the Verse compiler shows an error. The extension:

  1. Detects the error pattern
  2. Extracts the required import information
  3. Adds the import automatically or shows quick fix options

Asset Class Name Detection

The extension automatically detects asset class names from your project's Assets.digest.verse file to provide accurate import suggestions.

How It Works

When UEFN builds your project, it generates an Assets.digest.verse file containing all asset class definitions. The extension:

  1. Parses this file to extract class name mappings
  2. Corrects import suggestions when a class name exists in the asset digest
  3. For example: If you use my_texture and it's defined in Ake.UI.UI_UMG.my_texture, the extension correctly suggests importing Ake.UI rather than Ake.UI.UI_UMG

Automatic Updates

A file watcher monitors your Assets.digest.verse file and re-parses it when it changes, is created, or is deleted — so editing an asset in UEFN keeps working for the rest of the session, and opening VS Code before UEFN has generated the digest still picks it up once it appears.

Changes to the .uefnproject file refresh the asset names as well, so a renamed or switched project does not answer from the previous project's assets.


Legacy UEFN Project Structure Support

The extension supports both current and legacy UEFN folder structures:

  • Automatically detects your project layout
  • Searches up to 5 parent directories for .uefnproject files
  • Handles nested Content folders under Plugins/<ProjectName>/Content

This ensures compatibility with older UEFN projects that may have different directory structures.


Multi-Option Quick Fixes

When VS Code encounters ambiguous identifiers, you get multiple import options:

// When you type this:
MyComponent : some_component = some_component{}

// And VS Code shows: "Did you mean any of: GameFramework.some_component, UI.Components.some_component"
// You'll see quick fix options:
// Add import: using { GameFramework } (some_component from GameFramework)
// Add import: using { UI.Components } (some_component from UI.Components)

How to use:

  1. Hover over the error (red squiggly line)
  2. Click the lightbulb or press Ctrl+.
  3. Choose the import option you want

Each option is labelled in the import syntax that applies to the file you are editing, which in a multi-root workspace is the one its own folder sets — so the label matches the text the fix inserts.


Module Visibility

A module in your own project that is not declared <public> cannot be reached from another module, and importing it fails with:

Invalid access of internal module (/creator@fortnite.com/MyProject/Gadgets:)Tools from module /creator@fortnite.com/MyProject/Scripts. Consider setting the module's access specifier to <public> to make it accessible from other modules within your project.

A quick fix on that error writes the declaration for you:

  1. Hover over the error and press Ctrl+.
  2. Choose Make module 'Tools' public
  3. VS Code opens its refactor preview listing every file the fix would change; apply it from there, or drop it

The preview is the confirmation step: nothing is written until you accept it, so a fix that would touch a file you did not expect is visible before it lands rather than after.

Where the module already has an explicit declaration, that declaration gains the <public> specifier in place. Where it has none — a folder is a module whether or not anything declares it — the declaration is written to _definitions.verse at the Content root, nesting the module chain so the path still resolves:

Gadgets := module:
    Tools<public> := module {}

In a workspace with several folders, the file written is the one belonging to the folder holding the edited file, under that folder's own definitionsFileName where it overrides the default.

When It Declines

The quick fix refuses rather than applying half an edit, and names the module standing in the way:

  • A module on the path is scoped, epic_internal, private or protected. Making the target public would still not reach it, and overriding an access level someone chose deliberately is not the extension's call.
  • The module is declared with a named access level. It is reported rather than given a second specifier beside the first, which the compiler rejects.
  • A project file cannot be read. Whether that file declares part of the module is then unknown, and writing anyway could produce a second declaration the compiler rejects. The file is named in the message.
  • A project file changed while the scan ran. The offsets the fix computed no longer describe the file, so it stops and asks you to run the fix again rather than writing at stale positions.

Auto-Import Debouncing

Auto-imports wait for you to stop typing before triggering:

  • Default delay: 3 seconds (3000ms)
  • Configurable: Adjust to your preference
  • Smart debouncing: Timer resets when you continue typing

This prevents distracting import suggestions while you're actively coding. The extension waits for the configured duration after your last keystroke before analyzing and auto-importing.

To customize the delay:

{
    "verseAutoImports.general.autoImportDebounceDelay": 5000
}

How it works:

  1. You type code that needs an import
  2. Each keystroke cancels any pending auto-import
  3. When you stop typing for 3 seconds (configurable)
  4. Only then does the auto-import trigger

Path Conversion

Converting imports between relative and absolute form, dot notation, module detection and the CodeLens settings are on the Path Conversion page.


Manual Import Control

Prefer manual control? Disable auto-import and use quick fixes:

{ "verseAutoImports.general.autoImport": false }

Then use Ctrl+. on any error to see import options.


Import Location Control

Preserved Locations (Default): Keep existing imports where they are, add new ones at top

{ "verseAutoImports.behavior.preserveImportLocations": true }

Consolidated Imports: All imports moved to the top, sorted alphabetically

{ "verseAutoImports.behavior.preserveImportLocations": false }

Import Order Is Semantic

Verse resolves using statements top-down, so a dotted local import such as using { Economy.Shop } needs its first segment (Economy) already in scope, which a bare import like using { Features } provides. Plain alphabetical sorting would place Economy.Shop first and reintroduce the "Unknown identifier" error the import was meant to fix.

With behavior.sortImportsAlphabetically enabled (the default), sorting is therefore rank-based rather than purely alphabetical:

  1. Absolute paths, alphabetically
  2. Bare local imports, keeping their original relative order
  3. Dotted local imports, alphabetically

A new import is ranked against the whole file, not against one block, so it lands in the group the file's ordering calls for rather than always the first group. With sorting disabled, order is left untouched and new imports are appended after the last group.

The File Header Is Left Alone

Where a file opens with a comment run — a licence, an attribution, a description of what the file is — a new import is written below it rather than above it, on every configuration. A run of blank lines alone is not a header.

A new import is never written into a position that would change what it belongs to: not inside an indented module body, where it would apply to that module instead of the file, and not inside a block comment left unterminated, where it would be commented out and so silently written again on every later compile.

Comments Are Respected

A using statement inside a <# ... #> block comment is ignored by every import operation, so a deliberately disabled import stays disabled: it is not counted as already present, not hoisted by Optimize Imports, and never written into. Nested block comments and the indented <#> form are handled.

A <# written inside a # line comment opens a real block comment, exactly as one written in code does, and that block outlives the line it was opened on — it runs until a matching #>. This matches the compiler, and it means everything between the two is commented out:

# disabled for now <# using { Gadgets }
using { Tools } #>

Neither import above counts as present, and neither is rewritten.

A # inside the quoted segment of a path, such as Mod'a#b', is part of the path rather than the start of a comment, so such an import reads whole and is neither rewritten into a different module nor duplicated.

Files saved with Windows line endings keep them. Imports, the blank line after the import block, and the document body are all written with the line ending the file already uses.


Organize Imports

VS Code's own Organize Imports source action reaches the extension in .verse files, so the editor's standard entry points rebuild the import block:

  • Shift+Alt+O
  • The Source Action menu
  • editor.codeActionsOnSave, which runs it on every save:
{
    "[verse]": {
        "editor.codeActionsOnSave": ["source.organizeImports"]
    }
}

This is the same operation as the Optimize Imports command on the Commands page, reached the way the rest of VS Code reaches it.


Edits Are Checked Before They Are Written

Both automatic import insertion and Optimize Imports compare their own output against the document before applying it. Where the rewrite would drop a line of your code, the edit is refused rather than applied, so a malformed file cannot be produced by an import operation that misread it.


Command Palette

Every command, its ID, and a keybinding example are on the Commands page. The toggles among them are also reachable from the Status Bar Menu.


Ambiguous Import Handling

Configure preferred modules for classes that exist in multiple places:

{
    "verseAutoImports.behavior.ambiguousImports": {
        "vector3": "/UnrealEngine.com/Temporary/SpatialMath",
        "vector2": "/UnrealEngine.com/Temporary/SpatialMath",
        "rotation": "/UnrealEngine.com/Temporary/SpatialMath"
    }
}

No mappings ship by default, so this list is exactly what you put in it. A class with no entry is left to behavior.multiOptionStrategy, which offers the candidates as a quick fix unless you change it.


Experimental Features

Digest-Based Suggestions (opt-in): Enhanced suggestions based on official Verse API documentation

{
    "verseAutoImports.experimental.useDigestFiles": true
}

Where an identifier is declared by more than one bundled module, every one of them is offered as a quick fix rather than one being chosen for you. The list is led by the live module, so the SpatialMath and input surfaces offer their current path ahead of the deprecated /UnrealEngine.com spelling of the same name.

An identifier that exists only as a member of a parametric type, such as Name or AddMember, is not treated as a module member at all, so it no longer produces an import that does not fix the error.

Note: These features are experimental and may not always provide accurate suggestions.


Path Tree Caching

What the cache holds, how it invalidates, and the commands that manage it are on the Path Tree Caching page.