Cod3xDocs
guide

What the Hell Is a Language Server?

The editor, LuaLS, Cod3x, and the conversation that produces completion and diagnostics.

Your editor does not inherently know what openmw.world is.

OpenMW knows. Cod3x knows. Your editor needs somebody to tell it.

The basic picture

Your editor asks questions, LuaLS answers them, and Cod3x supplies the OpenMW knowledge LuaLS does not have.

  1. source

    Your .lua file

    The code you write.

  2. tool

    Your editor

    Displays the answers and sends questions to the language server.

  3. service

    Lua Language Server

    Understands Lua syntax, scopes, types, and common mistakes.

cod3x

Cod3x

Teaches LuaLS about OpenMW APIs, types, contexts, and interfaces.

How the pieces relate
  • Your .lua file Your editor
  • Your editor What is this symbol? Lua Language Server
  • Cod3x OpenMW knowledge Lua Language Server
  • Source
  • Tool
  • Service
  • Cod3x knowledge

The Language Server Protocol is a standard conversation between an editor and a separate analysis program. The editor asks questions such as “what does this name mean?” or “is this call valid?” The language server answers.

LuaLS is the analysis program in this picture. Your editor or editor extension is the client that displays its answers.

What each piece does

PieceJob
LuaLSUnderstands Lua syntax, scopes, types, and common mistakes.
Cod3x annotationsTeach LuaLS about OpenMW modules, objects, records, handlers, and APIs.
Cod3x context pluginAdds OpenMW-specific context rules that ordinary Lua analysis cannot infer.
Editor LSP clientDisplays completion, hover text, warnings, and errors.

Cod3x does not change what OpenMW runs. LuaLS does not run your script. A green editor does not prove that the game behavior is correct.

What it can and cannot prove

LuaLS can catch a misspelled field, a wrong argument shape, an unavailable module for the declared context, or a type mismatch.

It cannot prove that your .omwscripts file is installed, that a save has the state you expected, that an object is still valid after a cell transition, or that your code is fast enough. Those require the engine, logs, tests, or measurement.

That distinction is useful rather than disappointing. Use the editor to catch cheap static mistakes before launching OpenMW, then use OpenMW to answer runtime questions.

Continue to Set Up Cod3x.