feat: verilog lsp
This commit is contained in:
parent
d6e8e23d3b
commit
8772b124fa
4 changed files with 39 additions and 5 deletions
|
|
@ -5,6 +5,18 @@ return {
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
json = { "prettierd", "prettier", stop_after_first = true },
|
json = { "prettierd", "prettier", stop_after_first = true },
|
||||||
jsonc = { "prettierd", "prettier", stop_after_first = true },
|
jsonc = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
verilog = { "verible" },
|
||||||
|
},
|
||||||
|
formatters = {
|
||||||
|
verible = {
|
||||||
|
command = "verible-verilog-format",
|
||||||
|
args = { "-" },
|
||||||
|
range_args = function(self, ctx)
|
||||||
|
return { "--lines", ctx.range.start[1] .. "-" .. ctx.range["end"][1] }
|
||||||
|
end,
|
||||||
|
stdin = true,
|
||||||
|
cwd = require("conform.util").root_file({ ".git" }),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ return {
|
||||||
root_dir = function(fname)
|
root_dir = function(fname)
|
||||||
return vim.fs.dirname(vim.fs.find(".git", { path = fname, upward = true })[1])
|
return vim.fs.dirname(vim.fs.find(".git", { path = fname, upward = true })[1])
|
||||||
end,
|
end,
|
||||||
cmd = { "svls" },
|
cmd = { "verible-verilog-ls", "--rules_config_search" },
|
||||||
filetypes = { "verilog", "systemverilog" },
|
filetypes = { "verilog", "systemverilog" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
24
home/config/nvim/lua/plugins/nvim-lint.lua
Normal file
24
home/config/nvim/lua/plugins/nvim-lint.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
local pattern = "[^:]+:(%d+):(%d+):(%w+):(.+)"
|
||||||
|
local groups = { "lnum", "col", "code", "message" }
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-lint",
|
||||||
|
opts = {
|
||||||
|
linters_by_ft = {
|
||||||
|
-- verilog = { "verible" },
|
||||||
|
},
|
||||||
|
linters = {
|
||||||
|
verible = {
|
||||||
|
cmd = "verible-verilog-lint",
|
||||||
|
stdin = false,
|
||||||
|
args = { "--rules_config_search" },
|
||||||
|
stream = nil,
|
||||||
|
ignore_exitcode = false,
|
||||||
|
env = nil,
|
||||||
|
parser = require("lint.parser").from_pattern(pattern, groups),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -44,6 +44,8 @@ in
|
||||||
prettierd
|
prettierd
|
||||||
black
|
black
|
||||||
|
|
||||||
|
# SystemVerilog
|
||||||
|
verible
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.neovim = {
|
programs.neovim = {
|
||||||
|
|
@ -87,10 +89,6 @@ in
|
||||||
taplo
|
taplo
|
||||||
zls
|
zls
|
||||||
vscode-js-debug
|
vscode-js-debug
|
||||||
|
|
||||||
# SystemVerilog
|
|
||||||
svls
|
|
||||||
svlint
|
|
||||||
];
|
];
|
||||||
|
|
||||||
plugins = with pkgs.vimPlugins; [
|
plugins = with pkgs.vimPlugins; [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue