Log inGet started

lsp

The lsp namespace — the engine's Luau API reference for lsp.

The lsp namespace — 20 functions.

globals/lsp/check

globals/lsp/check(path: string, opts: CheckOpts?) -> { Diagnostic }

Validate a single .luau file in the VFS and return its diagnostics.

globals/lsp/checkAll

globals/lsp/checkAll(opts: CheckAllOpts?) -> CheckAllResult

Validate the user's Luau scripts and return an aggregate summary plus diagnostic list. opts.scope = "user" (default) skips library mounts; "all" includes them.

globals/lsp/checkCode

globals/lsp/checkCode(source: string, opts: CheckOpts?) -> { Diagnostic }

Validate inline Luau source without a backing file. Useful for checking code before writing it to disk.

globals/lsp/checkDirty

globals/lsp/checkDirty() -> { Diagnostic }

Drain the dirty-file set populated by the hot-reload hook, validate each, and return the combined diagnostic list.

globals/lsp/describe

globals/lsp/describe(path: string) -> DocEntry?

Inspect a single documented entry. Returns the full doc table (signature, args, returns, examples, level), or nil.

globals/lsp/describeTool

globals/lsp/describeTool(path: string) -> string?

Return the full documentation text for a code-mode tool.

globals/lsp/docsByKind

globals/lsp/docsByKind(kind: string) -> { MethodSummary }

List every doc whose registration kind matches kind. Valid: "binding", "runtime_tool", "module", "component", "library", "lua_export".

globals/lsp/getStrictMode

globals/lsp/getStrictMode() -> StrictMode

Return the current strict mode.

globals/lsp/isStrict

globals/lsp/isStrict() -> boolean

Is the pre-execute LSP gate fully strict? False when off or in soft mode.

globals/lsp/lastCheckGen

globals/lsp/lastCheckGen() -> number

Generation counter — bumped each time the cache is rebuilt. UI polls this to know when to redraw.

globals/lsp/methods

globals/lsp/methods(namespace: string) -> { MethodSummary }

List every documented method / entry under a namespace.

globals/lsp/modules

globals/lsp/modules() -> { ModuleEntry }

List every Luau library module the engine currently knows about — discovered via --!module headers, library scans, and manually-recorded docs.

globals/lsp/namespaces

globals/lsp/namespaces() -> { NamespaceEntry }

List every top-level documentation namespace the engine knows about — FFI bindings, library / prelude modules, component contexts, Luau builtins, globals.

globals/lsp/readDirectives

globals/lsp/readDirectives(source: string) -> DirectiveBlock

Parse the leading --! directive block of a Luau source string. Used by UIs that audit which files have skip directives and what they suppress.

globals/lsp/search(query: string, opts: SearchOpts?) -> { MethodSummary }

Case-insensitive substring search across every registered doc's path, signature, and description.

globals/lsp/setStrict

globals/lsp/setStrict(enabled: boolean) -> boolean

Toggle the pre-execute LSP gate. Returns true when the change was persisted to .world_settings, false when the play-mode write lock blocked the write.

globals/lsp/setStrictMode

globals/lsp/setStrictMode(mode: StrictMode) -> boolean

Set the pre-execute strict gate's mode. Returns true when the change was persisted to .world_settings, false when the play-mode write lock blocked the write.

globals/lsp/summary

globals/lsp/summary() -> Summary

Counts only — does not re-run validation.

globals/lsp/tools

globals/lsp/tools() -> { ToolEntry }

List every code-mode tool registered in the VFS under /zero/docs/tools/<category>/<tool>.

globals/lsp/typeOf

globals/lsp/typeOf(expr_source: string, context_path: string?) -> TypeDescriptor

Infer the static type of a Luau expression. When context_path is given, the file is loaded and walked so the inference env contains every local + alias in scope at its end.

  • api
  • reference