Installing¶
Vscode¶
Install the extension here. Then, it will prompt you to allow the extension to autoinstall the server binary from the releases page. Alternatively, you can build slang-server and set slang.path to that binary.
Vscode Forks (Cursor, Antigravity, VSCodium, etc.)¶
Install from your editor, or download from the OpenVSX Marketplace
Neovim¶
slang-serverwill eventually be added to nvim-lspconfig and mason.nvim so that no additional configuration will be required. Until then, follow one of the methods below to manually add the server configuration.
For newer versions of Neovim (≥ v0.11), the new vim.lsp API is the preferred, simpler way to configure language servers:
vim.lsp.config("slang-server", {
cmd = { "slang-server" },
root_markers = { ".git", ".slang" },
filetypes = {
"systemverilog",
"verilog",
},
})
vim.lsp.enable("slang-server")
Alternatively, adding the below to <runtimepath>/lsp/slang_server.lua will automatically be picked up by vim.lsp:
---@type vim.lsp.Config
return {
cmd = { "slang-server" },
root_markers = { ".git", ".slang" },
filetypes = {
"systemverilog",
"verilog",
},
}
For older versions of Neovim (< v0.11) with nvim-lspconfig, the server can be configured with:
local configs = require("lspconfig.configs")
local util = require("lspconfig.util")
if not configs.slang_server then
configs.slang_server = {
default_config = {
cmd = {
"slang-server",
},
filetypes = {
"systemverilog",
"verilog",
},
single_file_support = true,
root_dir = function(fname)
return util.root_pattern(".git", ".slang")(fname)
end,
},
}
end
For users of lazy.nvim, natively enable the server by adding the following to <runtimepath>/lua/plugins/slang_server.lua:
return {
"neovim/nvim-lspconfig",
opts = {
servers = {
slang_server = {
-- Tell LazyVim that Mason isn't needed since this is a manual config
mason = false,
},
},
},
}
The above assumes that a slang-server config has been added to vim.lsp.config or nvim-lspconfig using one of the preceding steps.
Optionally, run :LspInfo to make sure the LSP was correctly installed.
Pointing at the binary is all you need for standard language features, however a plugin is provided to enable some client-side features which extend the LSP (e.g. the hierarchy view, waveform integration). The plugin can be found in clients/neovim/ and is also mirrored in slang-server.nvim for ease of use with Neovim plugin managers.
Other editors¶
Most modern editors can at least point to a language server binary for specific file types. This will provide standard LSP features, but not HDL specific features.
If the editor also allows for executing LSP commands, HDL features like setting a compilation should be available.