LavaUI docs GitHub

enum FileIndex

Swift

enum FileIndex

The way to lava-index, the per-user file index (idl/index.npidl).

Per user, not per session, so unlike ControlPlane.referencePath there is no session in the name: a nested compositor searches the same files as the outer one.

Rides the NPRPC runtime the process already has when it is a compositor client — LavaClient.open starts it — and starts one of its own when it is not: a windowed LavaView has opened files too, and they belong in Recent as much as anything else.

Sources/LavaClient/FileIndex.swift:15

Properties

static var referencePath: String { get }

Not documented.

Sources/LavaClient/FileIndex.swift:16

Methods

static func connect() throws -> Index

A proxy to the running daemon.

Sources/LavaClient/FileIndex.swift:45

static func noteOpened(_ path: String, appId: String)

"The user opened this", for the Recent list. Fire-and-forget, and silent when there is no daemon: opening a file must never wait on, or fail because of, the index.

Safe from any thread. Reconnects when the published reference changes, so a daemon started or restarted after this process is still told. In a compositor client, call it after LavaClient.open, which is what starts the runtime this rides; before it, this would start a second.

Sources/LavaClient/FileIndex.swift:77

Types