Skip to content

Zig#

Server#

For more information about the LSP server, check zls.

Installation#

For more instructions on how to install manually, check here.

Debugger: Not available#

Available configurations#

lsp-zig-build-on-save-step#

Type: string

Default: install

Select which step should be executed on build-on-save.


lsp-zig-build-runner-global-cache-path#

Type: string

Default: ``

Path to a directory that will be used as the global cache path when executing a projects build.zig. null is equivalent to the path shown by zig env.


lsp-zig-build-runner-path#

Type: string

Default: ``

Path to the build_runner.zig file provided by zls. null is equivalent to ${executable_directory}/build_runner.zig.


lsp-zig-builtin-path#

Type: string

Default: ``

Path to builtin; useful for debugging, automatically set if let null.


lsp-zig-completions-with-replace#

Type: boolean

Default: nil

Completions confirm behavior. If true, replace the text after the cursor.


lsp-zig-dangerous-comptime-experiments-do-not-enable#

Type: boolean

Default: nil

When true, skips searching for references in std. Improves lookup speed for functions in user`s code. Renaming and go-to-definition will continue to work as is.


lsp-zig-enable-argument-placeholders#

Type: boolean

Default: t

Whether to enable function argument placeholder completions.


lsp-zig-enable-autofix#

Type: boolean

Default: nil

Whether to automatically fix errors on save. Currently supports adding and removing discards.


lsp-zig-enable-build-on-save#

Type: boolean

Default: nil

Whether to enable build-on-save diagnostics.


lsp-zig-enable-inlay-hints#

Type: boolean

Default: t

Enables inlay hint support when the client also supports it.


lsp-zig-global-cache-path#

Type: string

Default: ``

Path to a directory that will be used as zigs cache. null is equivalent to${KnownFolders.Cache}/zls`.


lsp-zig-highlight-global-var-declarations#

Type: boolean

Default: nil

Whether to highlight global var declarations.


lsp-zig-inlay-hints-exclude-single-argument#

Type: boolean

Default: t

Don`t show inlay hints for single argument calls.


lsp-zig-inlay-hints-hide-redundant-param-names#

Type: boolean

Default: nil

Hides inlay hints when parameter name matches the identifier (e.g. foo: foo).


lsp-zig-inlay-hints-hide-redundant-param-names-last-token#

Type: boolean

Default: nil

Hides inlay hints when parameter name matches the last token of a parameter node (e.g. foo: bar.foo, foo: &foo).


lsp-zig-inlay-hints-show-builtin#

Type: boolean

Default: t

Don`t show inlay hints for single argument calls.


lsp-zig-inlay-hints-show-parameter-name#

Type: boolean

Default: t

Enable inlay hints for parameter names.


lsp-zig-inlay-hints-show-variable-type-hints#

Type: boolean

Default: t

Enable inlay hints for variable type.


lsp-zig-prefer-ast-check-as-child-process#

Type: boolean

Default: t

Favor using zig ast-check instead of ZLS`s fork.


lsp-zig-record-session#

Type: boolean

Default: nil

When true, zls will record all request is receives and write in into record_session_path, so that they can replayed with zls replay.


lsp-zig-record-session-path#

Type: string

Default: ``

Output file path when record_session is set. The recommended file extension *.zlsreplay.


lsp-zig-replay-session-path#

Type: string

Default: ``

Used when calling zls replay for specifying the replay file. If no extra argument is given record_session_path is used as the default path.


lsp-zig-semantic-tokens#

Type: (choice (const off) (const messages) (const verbose))

Default: partial

Traces the communication between Emacs and the language server.


lsp-zig-server-store-path#

Type: file

Default: ~/.emacs.d/.cache/lsp/zig/

The path to the file in which zls will be stored.


lsp-zig-skip-std-references#

Type: boolean

Default: nil

hen true, skips searching for references in std. Improves lookup speed for functions in user`s code. Renaming and go-to-definition will continue to work as is.


lsp-zig-trace-server#

Type: (choice (const off) (const messages) (const verbose))

Default: off

Traces the communication between Emacs and the language server.


lsp-zig-warn-style#

Type: boolean

Default: nil

Enables warnings for style guideline mismatches.


lsp-zig-zig-exe-path#

Type: string

Default: ``

Zig executable path.

e.g. /path/to/zig/zig, used to run the custom build runner. If null, zig is looked up in PATH. Will be used to infer the zig standard library path if none is provided.


lsp-zig-zig-lib-path#

Type: string

Default: ``

Zig library path. e.g. /path/to/zig/lib/zig, used to analyze std library imports.


lsp-zig-zls-executable#

Type: string

Default: zls

The zls executable to use.

Leave as just the executable name to use the default behavior of finding the executable with variable exec-path.


lsp-zls-enable-snippets#

Type: boolean

Default: t

Enables snippet completions when the client also supports them.



Last update: November 19, 2024