Configuration
Source: config.rs
The Installation section contains details on configuration for some of the editors.
In general, wgsl-analyzer is configured by using LSP messages, which means that it is up to the editor to decide on the exact format and location of configuration files.
Some editors, such as VS Code or COC plugin in Vim, provide wgsl-analyzer-specific configuration UIs.
Other editors may require you to know a bit more about the interaction with wgsl-analyzer.
For the latter category, it might help to know that the initial configuration is specified as a value of the initializationOptions field of the InitializeParameters message, in the LSP protocol.
The spec says that the field type is any?, but wgsl-analyzer is looking for a JSON object that is constructed using settings from the list below.
The name of the setting, ignoring the wgsl-analyzer. prefix, is used as a path, and the value of the setting becomes the JSON property value.
Please consult your editor’s documentation to learn more about how to configure LSP servers.
To verify which configuration is actually used by wgsl-analyzer, set the WA_LOG environment variable to wgsl_analyzer=info and look for config-related messages.
Logs should show both the JSON that wgsl-analyzer sees as well as the updated config.
This is the list of config options wgsl-analyzer supports:
wgsl-analyzer.cachePriming.numThreads
Default: "physical"
Number of worker threads used to warm caches when a project opens.
Use 0 to let the server choose automatically based on the machine.
wgsl-analyzer.diagnostics.external.naga.parsing
Default: true
Whether to show diagnostics from naga about parsing.
wgsl-analyzer.diagnostics.external.naga.validation.errors
Default: true
Whether to show diagnostics from naga about validation.
wgsl-analyzer.diagnostics.external.naga.version
Default: "0.29"
Naga version used for validation.
wgsl-analyzer.diagnostics.external.tintErrors
Default: false
Whether to show Tint shader compiler’s messages.
wgsl-analyzer.diagnostics.external.tintPath
Default: null
The path to the tint binary.
wgsl-analyzer.diagnostics.semanticErrors
Default: true
Whether to show diagnostics about the code semantics.
wgsl-analyzer.extensions.shaderInt64
Default: true
Whether to enable u64 and i64 scalar types.
wgsl-analyzer.inlayHints.enabled
Default: true
Whether to show inlay hints.
wgsl-analyzer.inlayHints.parameterHints
Default: true
Whether to show inlay hints for the names of function parameters.
wgsl-analyzer.inlayHints.renderColons
Default: true
Whether to render leading colons for type hints, and trailing colons for parameter hints.
wgsl-analyzer.inlayHints.structLayoutHints
Default: false
Whether to show inlay hints for the layout of struct fields.
wgsl-analyzer.inlayHints.typeHints
Default: true
Whether to show inlay hints for types of variable declarations.
wgsl-analyzer.inlayHints.typeVerbosity
Default: "compact"
Verbosity of type hints: "full", "compact", or "inner".
wgsl-analyzer.numThreads
Default: null
Number of worker threads for the main analysis loop.
null lets the server choose automatically.
wgsl-analyzer.trace.extension
Default: false
Enable logging of VS Code extensions itself. This settings is now deprecated. Log level is now controlled by the Developer: Set Log Level… command. You can set the log level for the current session and also the default log level from there. This is also available by clicking the gear icon on the OUTPUT tab when wgsl-analyzer Client is visible or by passing the –log wgsl-analyzer.wgsl-analyzer:debug parameter to VS Code.
wgsl-analyzer.trace.server
Default: "off"
Server trace verbosity.
One of: "off", "messages", or "verbose".