forked from foxora/nix
added leptosfmt
This commit is contained in:
parent
4321b6f6c3
commit
c5416f0b92
2 changed files with 18 additions and 1 deletions
|
|
@ -58,7 +58,18 @@ return {
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = nixCats("lang.lua.format") and { "stylua" } or nil,
|
lua = nixCats("lang.lua.format") and { "stylua" } or nil,
|
||||||
nix = nixCats("lang.nix.format") and { "alejandra" } or nil,
|
nix = nixCats("lang.nix.format") and { "alejandra" } or nil,
|
||||||
rust = nixCats("lang.rust.format") and { "rustfmt", lsp_format = "fallback" } or nil,
|
rust = (function()
|
||||||
|
if not nixCats("lang.rust.format") then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
local formatters = {}
|
||||||
|
if nixCats("lang.rust.formatters.leptos") then
|
||||||
|
table.insert(formatters, "leptosfmt")
|
||||||
|
end
|
||||||
|
table.insert(formatters, "rustfmt")
|
||||||
|
formatters.lsp_format = "fallback"
|
||||||
|
return formatters
|
||||||
|
end)(),
|
||||||
haskell = nixCats("lang.haskell.format") and { "ormolu" } or nil,
|
haskell = nixCats("lang.haskell.format") and { "ormolu" } or nil,
|
||||||
proto = nixCats("lang.protobuf.format") and { "buf" } or nil,
|
proto = nixCats("lang.protobuf.format") and { "buf" } or nil,
|
||||||
toml = nixCats("lang.toml.format") and { "taplo" } or nil,
|
toml = nixCats("lang.toml.format") and { "taplo" } or nil,
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,9 @@ in {
|
||||||
lsp = [cargo mpkgs.rust-analyzer];
|
lsp = [cargo mpkgs.rust-analyzer];
|
||||||
# nightly rustfmt has nicer features :3
|
# nightly rustfmt has nicer features :3
|
||||||
format = [(rustfmt.override {asNightly = true;})];
|
format = [(rustfmt.override {asNightly = true;})];
|
||||||
|
formatters = {
|
||||||
|
leptos = [leptosfmt];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
zig = {
|
zig = {
|
||||||
lsp = [zls];
|
lsp = [zls];
|
||||||
|
|
@ -278,6 +281,9 @@ in {
|
||||||
|
|
||||||
rust.lsp = true;
|
rust.lsp = true;
|
||||||
rust.format = true;
|
rust.format = true;
|
||||||
|
rust.formatters = {
|
||||||
|
leptos = true;
|
||||||
|
};
|
||||||
|
|
||||||
zig.lsp = true;
|
zig.lsp = true;
|
||||||
zig.format = true;
|
zig.format = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue