Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Asset LSP

The Asset LSP validates authored mesh asset paths in C++ files and completes mesh names from glTF files. Use it in CLion through the LSP4IJ plugin.

Features

Feature Scope
Diagnostics Reports invalid Asset::MeshPath and CREATE_MESH_ASSET_PATH(...) mesh names.
Completion Completes the mesh name string from the referenced glTF file.
Quick fix Replaces full project asset string literals with matching Engine::Core::Path::...() helper calls when a mapping exists.

The server runs over standard input and output. CLion starts the process when a mapped C++ file opens.

Build

Build the server with the asset-lsp CMake build preset:

cmake --build --preset asset-lsp

The preset uses x64-Release-fast-tracy, which enables ENABLE_ASSET_LSP and writes the executable to:

out/build/x64-Release-fast-tracy/asset-lsp

Run the server only through an LSP client. It waits for JSON-RPC messages on standard input.

CLion Setup

Install the LSP4IJ plugin before configuring the server.

  1. Open Settings.
  2. Open Plugins.
  3. Search for LSP4IJ in the Marketplace.
  4. Install the plugin and restart CLion.

Create the Asset LSP server:

  1. Open Settings.
  2. Open Languages & Frameworks.
  3. Open Language Servers.
  4. Add a new server.
  5. Set Name to Asset Path LSP.
  6. Set Command to the built executable.
  7. Map the server to *.cpp, *.h, and *.hpp files.
  8. Apply the settings.

The executable path inside the checkout is:

out/build/x64-Release-fast-tracy/asset-lsp

Use CLion's file picker for the command field if LSP4IJ asks for an absolute executable path.

Project Config

The repository includes .lsp4ij/lsp4ij.json with the same server definition. If CLion imports it, verify that the command entry points to your local asset-lsp executable.

Expected mappings:

{
"patterns": ["*.cpp", "*.h", "*.hpp"]
}

Usage

Open a C++ file that contains a mesh asset reference:

auto mesh = Asset::MeshPath(modelPath.fsPath(), "Cube");
Identifies a named mesh-like asset inside an asset file.
Definition AssetPath.h:89

Place the caret inside the mesh name string and trigger completion. The server reads mesh names from the referenced glTF file and returns matching names.

The same completion path works for CREATE_MESH_ASSET_PATH(...):

auto mesh = CREATE_MESH_ASSET_PATH(modelPath, "Cube");

Troubleshooting

Symptom Check
CLion cannot start the server Build cmake --build --preset asset-lsp and verify the command path.
No diagnostics appear Confirm that the file extension matches the LSP4IJ mappings.
No mesh completion appears Confirm that the path expression resolves to an existing glTF file.
Errors Check $HOME/asset-lsp.log.

The server uses the CLion workspace root to resolve project-relative asset paths. Open the repository root as the CLion project.

Related Documentation