From 34d85bcf0b80cbc513425b6857a1452e44c29159 Mon Sep 17 00:00:00 2001 From: Gregor Grigorjan Date: Thu, 4 Apr 2024 14:30:01 +0300 Subject: [PATCH] feat(emacs): langs: add C# --- modules/nixos/programs/emacs/default.nix | 4 ++++ modules/nixos/programs/emacs/init.el | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/modules/nixos/programs/emacs/default.nix b/modules/nixos/programs/emacs/default.nix index 39a442bd..a2ce5f36 100644 --- a/modules/nixos/programs/emacs/default.nix +++ b/modules/nixos/programs/emacs/default.nix @@ -79,6 +79,8 @@ in nodePackages.typescript-language-server # Terraform terraform + # CSharp + omnisharp-roslyn ]; elementary.home = { @@ -91,6 +93,8 @@ in (add-to-list 'lsp-java-vmargs "-javaagent:${pkgs.elementary.lombok-jar}/share/java/lombok.jar") (setq lsp-clients-typescript-tls-path ${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server) + + (setq lsp-csharp-server-path "${pkgs.omnisharp-roslyn}/bin/OmniSharp") ''; }; file = { diff --git a/modules/nixos/programs/emacs/init.el b/modules/nixos/programs/emacs/init.el index 0ea8e289..6c64cd66 100644 --- a/modules/nixos/programs/emacs/init.el +++ b/modules/nixos/programs/emacs/init.el @@ -623,6 +623,7 @@ (use-package treesit-auto :config (delete 'yaml treesit-auto-langs) ;; yaml-mode is superior + (delete 'c-sharp treesit-auto-langs) ;; csharp-ts-mode highlighting sucks (global-treesit-auto-mode)) (use-package yasnippet) @@ -736,6 +737,12 @@ (typescript-ts-mode . lsp) (tsx-ts-mode . lsp)) +(use-package emacs + :ensure nil + :hook + (csharp-mode . lsp) + (csharp-ts-mode . lsp)) + (use-package emacs :ensure nil :mode