Skip to content

Path Conversion

VukeFN edited this page Aug 15, 2026 · 5 revisions

Path Conversion

Convert between relative and absolute import paths with a single click:

// Before: relative import
using { Textures }

// After: absolute path import
using { /creator@fortnite.com/MyProject/ProjectFiles/Textures }

Table of Contents


How It Works

  1. Hover over any import statement line
  2. Click "Use absolute path" or "Use relative path" that appears above the import
  3. For ambiguous modules (found in multiple locations), choose from a list
  4. Or use "Use absolute paths for all" to convert all imports at once

The extension automatically detects your project's Verse path from the .uefnproject file.

Each of these actions is also a command; see Path Conversion commands.


What the Relative Form Is Measured Against

"Use relative path" shortens the absolute path against the module the file sits in, which is the spelling the Verse compiler itself suggests — not against the project root.

A file in Content/Scripts converting /creator@fortnite.com/MyProject/Scripts/Gadgets/Tools gets:

using { Gadgets.Tools }

and not the longer Scripts.Gadgets.Tools that measuring from the project root would produce.

Where the target is the file's own module, or one that encloses it, the bare module name is written instead: whatever encloses that module encloses the file too, so the name alone reaches it.


When Conversion Declines

"Use relative path" proposes a shorter spelling and then resolves it back from the importing file, through the same search the other direction uses. Where the short form would reach a different module, or no module at all, the conversion is refused and the import is left as it is.

The conversion overwrites an import that compiles today, so refusing is the safe answer: a shortening that is not checked would replace a working import with one that silently points elsewhere.

Conversion also declines where there is no relative form to give — a built-in module, a path outside the project, a workspace with no .uefnproject, or an importing file the Content root does not hold.

Projects Above the Search Limit

The search for a module declared in code reads at most 100 .verse files. A project holding more than that is reported once per run:

This project holds more than 100 .verse files, which is as many as the search for a declared module reads. Imports that need one are left alone rather than pointed at a module found in part of the project; write those absolute paths by hand.

Imports needing that search are then left as they are. A sample of the project cannot answer either question the conversion depends on — a location it did not reach is missing from the list, and a namesake it did not reach is missing from the ambiguity — so a single match is no evidence the name is unambiguous. The notice is spent once for a whole document rather than repeated per import.


Dot Notation Support

The extension properly handles Verse's dot notation for nested modules:

  • using { HUD.Textures } searches for Textures module in HUD folder
  • using { UI.Components.Button } searches for Button in UI/Components path
  • Converts to full paths like /creator@fortnite.com/Project/HUD/Textures

Module Detection

The extension finds both:

  • Implicit modules: Every folder in Content/ is automatically a module
  • Explicit modules: Code-defined using ModuleName := module: syntax, including one declared inside another module, which converts in both directions

Resolution is backed by the Path Tree Caching layer, which is why conversion stays fast in large projects.


Digest Modules

The extension skips digest modules that are already in their correct form:

  • /Fortnite.com/ modules (e.g., /Fortnite.com/Devices)
  • /UnrealEngine.com/ modules (e.g., /UnrealEngine.com/Temporary/SpatialMath)
  • /Verse.org/ modules (e.g., /Verse.org/Simulation)

These modules won't show the conversion CodeLens as they don't need to be converted.


Settings

Three settings govern this feature. See Configuration for the full reference.

Setting Default Effect
pathConversion.enableCodeLens true Whether the conversion actions appear at all
pathConversion.codeLensVisibility "hover" "hover" shows them only while hovering; "always" keeps them visible
pathConversion.codeLensHideDelay 1000 Milliseconds before hiding after the cursor leaves, in hover mode

If a module isn't found, see Troubleshooting.


Disabling Path Conversion

If you prefer not to see the path conversion options when hovering:

  1. Open the Status Bar Menu (click "Verse Auto Imports" in the status bar)
  2. Toggle "Path Conversion Helper" off
  3. Or search for "Path Conversion" in VS Code settings (Ctrl+,)

Clone this wiki locally