跳转到内容

VS Code 设置

所有设置都在 vizsla.* 命名空间下。你可以在 VS Code Settings UI 中搜索 Vizsla, 也可以直接编辑 settings.json

设置默认值说明
vizsla.server.commandnull自定义语言服务器命令。留空时使用 bundled server。
vizsla.server.args[]启动服务器时传入的前置参数。
vizsla.server.additionalArgs[]启动服务器时追加的参数。
vizsla.server.cwdnull服务器工作目录。默认使用第一个 workspace folder, 没有 workspace 时使用扩展目录。
vizsla.trace.server"off"LSP 通信跟踪, 可选 "off", "messages", "verbose"

示例:

{
"vizsla.server.command": "D:\\tools\\vizsla\\vizsla.exe",
"vizsla.server.additionalArgs": ["--log", "debug"]
}
设置默认值说明
vizsla.files.excludeDirs[]workspace 相对目录排除列表。不支持 glob; 文件选择 glob 写在 manifest 的 sources / exclude 中。
vizsla.files.watcher"client"文件监听方式, 可选 "client", "notify", "server"

client 会优先使用 VS Code 的 watched-file notifications。当前服务器配置中, 客户端不支持动态 watched files 时会回退到 server-side watcher; notifyserver 都会走服务端监听路径。

设置默认值说明
vizsla.workspace.auto.reloadtrue工程清单变更后自动刷新工程信息。
设置默认值说明
vizsla.scope.visibility"private"控制 scope 内符号对其它 scope 的可见性。可选 "private", "public"

这个设置会影响 references, rename 和 document highlight。

设置默认值说明
vizsla.formatter.provider"verible"formatter 后端。当前支持 verible, 会调用外部 verible-verilog-format
vizsla.formatter.pathnullverible provider 使用的可执行文件路径。留空时查找 verible-verilog-format
vizsla.formatter.args["--failsafe_success=false"]传给 verible-verilog-format 的参数。
vizsla.formatting.on.entertrue按 Enter 时启用格式化行为。
vizsla.formatting.in.commentstrue在注释内启用 Enter 辅助格式化。
vizsla.formatting.indent.width4编辑器没有提供 formatting options 时使用的后备缩进宽度。

Format Document, Format Selection 和 on-type formatting 请求会优先使用编辑器传入的 tabSizeverible provider 会在 formatter args 后追加当前缩进宽度对应的 --indentation_spaces=<N>

设置默认值说明
vizsla.inlayHints.port.connection.enabletrue显示端口连接 inlay hints。
vizsla.inlayHints.parameter.assignment.enabletrue显示参数赋值 inlay hints。
vizsla.inlayHints.end.structure.enabletrue显示结构结束名 hints。
设置默认值说明
vizsla.lens.instantiations.enabletrue显示模块实例 code lens。
设置默认值说明
vizsla.semantic.tokens.port.clk.rst.enabletrue为 clock/reset 端口启用专用 semantic token modifier。
vizsla.semantic.tokens.port.input.output.enabletrue为 input/output 端口启用专用 semantic token modifier。
设置默认值说明
vizsla.diagnostics.enabletrue启用所有 Vizsla diagnostics。
vizsla.diagnostics.update"onSave"诊断刷新时机。可选 "onSave", "onType"
vizsla.diagnostics.parse.enabletrue启用语法和 parse diagnostics。
vizsla.diagnostics.semantic.enabletrue启用编译和 semantic diagnostics。
vizsla.diagnostics.slang.warnings[]slang warning 选项, 例如 default, everything, none, error, no-<name>, error=<name>
vizsla.diagnostics.slang.rules[]诊断过滤或 severity override 规则。

vizsla.diagnostics.slang.warnings 会传给 slang 的 parse/semantic diagnostics 接口。写法和 slang 的 -W... warning options 对齐, 但在 VS Code 设置里不写前导 -W: 例如 everything 对应 -Weverything, no-unused 对应 -Wno-unused, error=width-trunc 对应 -Werror=width-trunc

需要查 warning 名称、warning group 或 warning flag 语义时, 请优先看 slang 文档:

vizsla.diagnostics.slang.rules 的 selector 支持:

  • code:<subsystem>:<code>
  • option:<name>
  • group:<name>
  • source:parse
  • source:semantic

示例:

{
"vizsla.diagnostics.slang.rules": [
{ "selector": "source:parse", "severity": "warning" },
{ "selector": "option:unconnected-port", "severity": "ignore" }
]
}

severity 可选 ignore, info, warning, error, fatal

设置默认值说明
vizsla.signature.help.params.onlyfalse只显示参数相关签名帮助。