From 11e4e4509a252d3bdf382ad45b8774c76e0b1786 Mon Sep 17 00:00:00 2001 From: John Doty Date: Wed, 24 Dec 2025 06:53:52 -0800 Subject: [PATCH] [emacs] C# tweaks --- .emacs.d/init.el | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index d32e8b2..ac8cc4b 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -541,6 +541,18 @@ ("C-c p" . 'flymake-goto-prev-error))) +(defun rebuild-slnx () + "Rebuild the solution file." + (interactive) + (with-temp-buffer + (let ((exit-code (process-file "buck2" nil t nil "run" "//:gen_solution"))) + (unless (zerop exit-code) + (error "Error generating solution (%d): %s" exit-code (buffer-string)))) + (message "%s" (buffer-string))) + (if (and (functionp 'eglot-reconnect) + (functionp 'eglot-current-server)) + (eglot-reconnect (eglot-current-server)))) + ;; ================================================================= ;; CC-Mode configuration. Stuff that makes working in IDL, C, and ;; C++ a whole lot more tolerable. @@ -759,7 +771,16 @@ Or, uh, Objective C, I guess." ;; Fix up record indentation (and parameter list indentation too.) (push '((parent-is "parameter_list") parent-bol csharp-ts-mode-indent-offset) - (cdar csharp-ts-mode--indent-rules))) + (cdar csharp-ts-mode--indent-rules)) + (push + '((node-is "arrow_expression_clause") parent-bol csharp-ts-mode-indent-offset) + (cdar csharp-ts-mode--indent-rules)) + + (push + '((node-is "type_parameter_constraints_clause") parent-bol csharp-ts-mode-indent-offset) + (cdar csharp-ts-mode--indent-rules)) + + ) ;; (use-package csharp-lsp-decompile ;; :config