From 4e2702dfd179a67bbdbe1cd0944457179973320c Mon Sep 17 00:00:00 2001 From: unexplrd Date: Thu, 8 May 2025 12:30:00 +0300 Subject: [PATCH] editor/helix: add config for fsharp Signed-off-by: unexplrd --- modules/home/programs/editor/helix.nix | 31 ++++++++++++++++++++------ 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/modules/home/programs/editor/helix.nix b/modules/home/programs/editor/helix.nix index c178ad6..9d39776 100644 --- a/modules/home/programs/editor/helix.nix +++ b/modules/home/programs/editor/helix.nix @@ -66,13 +66,22 @@ in { markdown-oxide.command = getExe pkgs.markdown-oxide; # nil.command = getExe pkgs.nil; nixd.command = getExe pkgs.nixd; - pyright.command = getExe pkgs.pyright; - pyright.args = ["-"]; + # pyright.command = getExe pkgs.pyright; + # pyright.args = ["-"]; ruff.command = getExe pkgs.ruff; ruff.args = ["server"]; # rust-analyzer.command = getExe pkgs.rust-analyzer; # texlab.command = getExe pkgs.texlab; tinymist.command = getExe pkgs.tinymist; + fsac.command = getExe pkgs.fsautocomplete; + fsac.config = { + # editor.formatOnSave = true; + AutomaticWorkspaceInit = true; + FSharp.ExternalAutocomplete = true; + FSharp.linting.fsharplint.enabled = true; + FSharp.linting.fsharplint.configFile = "fsharplint.json"; + FSharp.formatting.fantomas.enabled = true; + }; }; language = [ { @@ -109,6 +118,14 @@ in { auto-format = true; formatter.command = "${pkgs.clang-tools}/bin/clang-format"; } + { + name = "fsharp"; + auto-format = true; + # formatter.command = getExe pkgs.fantomas; + language-servers = ["fsac"]; + scope = "source.fs"; + roots = ["fsproj" "sln" ".git"]; + } # { # name = "rust"; # auto-format = true; @@ -121,12 +138,12 @@ in { language-servers = [ { name = "ruff"; - only-features = ["format" "diagnostics"]; - } - { - name = "pyright"; - except-features = ["format" "diagnostics"]; + # only-features = ["format" "diagnostics"]; } + # { + # name = "pyright"; + # except-features = ["format" "diagnostics"]; + # } ]; } ];