[emacs] Fix c# mode config
This commit is contained in:
parent
a0d9abdf2e
commit
0f42c1c6fa
2 changed files with 3 additions and 52 deletions
|
|
@ -63,14 +63,7 @@
|
||||||
'(org-odd-levels-only t)
|
'(org-odd-levels-only t)
|
||||||
'(org-todo-keywords '((sequence "TODO" "|" "DONE" "ABANDONED" "DEFERRED")))
|
'(org-todo-keywords '((sequence "TODO" "|" "DONE" "ABANDONED" "DEFERRED")))
|
||||||
'(package-check-signature nil)
|
'(package-check-signature nil)
|
||||||
'(package-selected-packages
|
'(package-selected-packages nil)
|
||||||
'(adaptive-wrap add-node-modules-path bazel blacken claudemacs clipetty
|
|
||||||
clojure-mode company dap-mode deadgrep doom-themes
|
|
||||||
earthfile-mode eat eglot-java filladapt fish-mode
|
|
||||||
flycheck-elm go-mode howm ink-mode jsonnet-mode magit
|
|
||||||
poly-markdown prettier-js protobuf-mode ron-mode rust-mode
|
|
||||||
scala-ts-mode sql-indent swift-mode terraform-mode
|
|
||||||
typescript-mode wgsl-mode xterm-color zig-mode))
|
|
||||||
'(package-vc-selected-packages '((claudemacs :url "https://github.com/cpoile/claudemacs")))
|
'(package-vc-selected-packages '((claudemacs :url "https://github.com/cpoile/claudemacs")))
|
||||||
'(reb-re-syntax 'string)
|
'(reb-re-syntax 'string)
|
||||||
'(rmail-mail-new-frame t)
|
'(rmail-mail-new-frame t)
|
||||||
|
|
|
||||||
|
|
@ -673,7 +673,7 @@ Or, uh, Objective C, I guess."
|
||||||
;; C#-Mode configuration.
|
;; C#-Mode configuration.
|
||||||
;; =================================================================
|
;; =================================================================
|
||||||
|
|
||||||
(use-package csharp-ts-mode
|
(use-package csharp-mode
|
||||||
|
|
||||||
:preface
|
:preface
|
||||||
(defun my-csharp-mode-hook ()
|
(defun my-csharp-mode-hook ()
|
||||||
|
|
@ -683,50 +683,9 @@ Or, uh, Objective C, I guess."
|
||||||
(turn-on-font-lock)
|
(turn-on-font-lock)
|
||||||
(c-set-style "ms-csharp"))
|
(c-set-style "ms-csharp"))
|
||||||
|
|
||||||
:mode "\\.cs\\'"
|
:mode ("\\.cs\\'" . csharp-ts-mode)
|
||||||
|
|
||||||
:config
|
:config
|
||||||
;; 2023-09-03 Stop using omnisharp
|
|
||||||
;; 2025-04-19 Still not using omnisharp, use it through eglot maybe
|
|
||||||
;; (use-package omnisharp :ensure t
|
|
||||||
;; :commands omnisharp-mode
|
|
||||||
;; :bind (:map omnisharp-mode-map
|
|
||||||
;; ([remap xref-find-definitions] . omnisharp-go-to-definition)
|
|
||||||
;; ([remap xref-find-references] . omnisharp-find-usages)
|
|
||||||
;; ;; `xref-pop-marker-stack' works as expected.
|
|
||||||
;; )
|
|
||||||
;; :config
|
|
||||||
;; (eval-after-load 'company '(add-to-list 'company-backends 'company-omnisharp)))
|
|
||||||
|
|
||||||
;; (use-package prettysharp
|
|
||||||
;; :commands prettysharp-mode
|
|
||||||
;; :config
|
|
||||||
;; (if (file-executable-p "c:/src/prettysharp/prettysharp.exe")
|
|
||||||
;; (setq prettysharp-command "c:/src/prettysharp/prettysharp.exe")))
|
|
||||||
|
|
||||||
(add-hook 'csharp-mode-hook 'my-csharp-mode-hook)
|
|
||||||
(c-add-style "ms-csharp"
|
|
||||||
'((c-basic-offset . 4)
|
|
||||||
(c-comment-only-line-offset . (0 . 0))
|
|
||||||
(c-offsets-alist . ((c . c-lineup-C-comments)
|
|
||||||
(inclass . +)
|
|
||||||
(namespace-open . 0)
|
|
||||||
(namespace-close . 0)
|
|
||||||
(innamespace . +)
|
|
||||||
(class-open . 0)
|
|
||||||
(class-close . 0)
|
|
||||||
(defun-open . 0)
|
|
||||||
(defun-close . 0)
|
|
||||||
(defun-block-intro . +)
|
|
||||||
(inline-open . 0)
|
|
||||||
(statement-block-intro . +)
|
|
||||||
(brace-list-intro . +)
|
|
||||||
(block-open . -)
|
|
||||||
(substatement-open . 0)
|
|
||||||
(arglist-intro . +)
|
|
||||||
(arglist-close . 0)
|
|
||||||
))))
|
|
||||||
|
|
||||||
;; Fix up record indentation (and parameter list indentation too.)
|
;; Fix up record indentation (and parameter list indentation too.)
|
||||||
(push
|
(push
|
||||||
'((parent-is "parameter_list") parent-bol csharp-ts-mode-indent-offset)
|
'((parent-is "parameter_list") parent-bol csharp-ts-mode-indent-offset)
|
||||||
|
|
@ -734,7 +693,6 @@ Or, uh, Objective C, I guess."
|
||||||
(push
|
(push
|
||||||
'((node-is "arrow_expression_clause") parent-bol csharp-ts-mode-indent-offset)
|
'((node-is "arrow_expression_clause") parent-bol csharp-ts-mode-indent-offset)
|
||||||
(cdar csharp-ts-mode--indent-rules))
|
(cdar csharp-ts-mode--indent-rules))
|
||||||
|
|
||||||
(push
|
(push
|
||||||
'((node-is "type_parameter_constraints_clause") parent-bol csharp-ts-mode-indent-offset)
|
'((node-is "type_parameter_constraints_clause") parent-bol csharp-ts-mode-indent-offset)
|
||||||
(cdar csharp-ts-mode--indent-rules))
|
(cdar csharp-ts-mode--indent-rules))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue