clippy by default

This commit is contained in:
Christoph J. Scherr 2024-02-16 15:53:23 +01:00
parent e7f7ad4ca8
commit 10a01d0503
Signed by: cscherrNT
GPG Key ID: 8E2B45BC51A27EA7
3 changed files with 761 additions and 729 deletions

View File

@ -5,8 +5,8 @@ local M = {}
local highlights = require "custom.highlights"
M.ui = {
theme = "github_light",
theme_toggle = { "kanagawa", "github_light" },
theme = "oceanic-next",
theme_toggle = { "oceanic-next", "oceanic-light" },
hl_override = highlights.override,
hl_add = highlights.add,

View File

@ -10,7 +10,7 @@ local servers = {
"tsserver",
"clangd",
"pyright",
"rust_analyzer", -- rustaceanvim wants to do that, but the builtin thing has better integration!
-- "rust_analyzer", -- rustaceanvim wants to do that, but the builtin thing has better integration!
"bashls",
"cmake",
}
@ -21,3 +21,28 @@ for _, lsp in ipairs(servers) do
capabilities = capabilities,
}
end
lspconfig.rust_analyzer.setup {
on_attach = on_attach,
settings = {
["rust-analyzer"] = {
check = {
command = "clippy",
},
imports = {
granularity = {
group = "module",
},
prefix = "self",
},
cargo = {
buildScripts = {
enable = true,
},
},
procMacro = {
enable = true,
},
},
},
}

View File

@ -102,7 +102,12 @@ local plugins = {
["<leader>f"] = { name = "+formatting" },
},
},
{ "echasnovski/mini.trailspace", lazy = false, event = { "BufReadPost", "BufNewFile" }, opts = {} },
{
"echasnovski/mini.trailspace",
lazy = false,
event = { "BufReadPost", "BufNewFile" },
opts = {},
},
{
"itchyny/vim-cursorword",
event = "FileType",
@ -650,8 +655,7 @@ local plugins = {
local label = {}
for severity, icon in pairs(icons) do
local n = #vim.diagnostic.get(props.buf,
{ severity = vim.diagnostic.severity[string.upper(severity)] })
local n = #vim.diagnostic.get(props.buf, { severity = vim.diagnostic.severity[string.upper(severity)] })
if n > 0 then
table.insert(label, { icon .. " " .. n .. " ", group = "DiagnosticSign" .. severity })
end
@ -765,7 +769,7 @@ local plugins = {
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
args = function()
return require('custom.utils').tokenize_args(vim.fn.input("args: "))
return require("custom.utils").tokenize_args(vim.fn.input "args: ")
end,
cwd = "${workspaceFolder}",
-- FIXME: perhaps we can put the stdio somewhere more practical
@ -808,8 +812,11 @@ local plugins = {
config = function()
local dap = require "dap"
vim.g.rustaceanvim = {
enable_clippy = true,
-- Plugin configuration
tools = {},
tools = {
enable_clippy = true,
},
-- LSP configuration
server = {
auto_attach = false,