From d6361b1591f3d8027ac500359e07c19f7102fc02 Mon Sep 17 00:00:00 2001 From: Nick Zana Date: Tue, 21 Jan 2025 22:10:09 -0500 Subject: [PATCH] leptos rust support --- lua/plugins/lsp.lua | 22 ++++++++++++++++++++++ lua/plugins/treesitter.lua | 14 ++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 507c58a..6cfb1e1 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -83,6 +83,10 @@ return { lsp.rust_analyzer.setup({ settings = { ["rust-analyzer"] = { + checkOnSave = { + allFeatures = true, + command = { "clippy" }, + }, procMacro = { enable = true, ignored = { @@ -91,7 +95,25 @@ return { }, cargo = { allFeatures = true, + autoreload = true, + }, + rustfmt = { + overrideCommand = { "leptosfmt", "--stdin", "--rustfmt" }, + }, + callInfo = { full = true }, + lens = { + enable = true, + references = true, + implementations = true, + enumVariantReferences = true, + methodReferences = true, + }, + inlayHints = { + enable = true, + typeHints = true, + parameterHints = true, }, + hoverActions = { enable = true, }, } } }) diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index c755ea7..a71b467 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -9,4 +9,18 @@ return { }) end, }, + { + "rayliwell/tree-sitter-rstml", + dependencies = { "nvim-treesitter" }, + build = ":TSUpdate", + config = function () + require("tree-sitter-rstml").setup() + end + }, + { + "windwp/nvim-ts-autotag", + config = function() + require("nvim-ts-autotag").setup() + end, + }, }