fix(csharp): reduce formatter complexity
This commit is contained in:
parent
65b0b14849
commit
a5756f1e19
2 changed files with 3 additions and 10 deletions
|
@ -3,11 +3,7 @@
|
||||||
(use-package! csharp-mode
|
(use-package! csharp-mode
|
||||||
:hook (csharp-mode . rainbow-delimiters-mode)
|
:hook (csharp-mode . rainbow-delimiters-mode)
|
||||||
:config
|
:config
|
||||||
(when (and (file-exists-p (expand-file-name "~/.dotnet/tools/dotnet-csharpier"))
|
(set-formatter! 'csharpier '("dotnet-csharpier") :modes '(csharp-mode))
|
||||||
(file-exists-p ".config/dotnet-tools.json")
|
|
||||||
(eq 0 (call-process-shell-command
|
|
||||||
(format "grep -q 'dotnet-csharpier' %s" (expand-file-name ".config/dotnet-tools.json")) nil nil)))
|
|
||||||
(set-formatter! 'csharpier '("dotnet" "tool" "run" "dotnet-csharpier") :modes '(csharp-mode)))
|
|
||||||
(set-electric! 'csharp-mode :chars '(?\n ?\}))
|
(set-electric! 'csharp-mode :chars '(?\n ?\}))
|
||||||
(set-rotate-patterns! 'csharp-mode
|
(set-rotate-patterns! 'csharp-mode
|
||||||
:symbols '(("public" "protected" "private")
|
:symbols '(("public" "protected" "private")
|
||||||
|
|
|
@ -11,8 +11,5 @@
|
||||||
"This module requires (:tools tree-sitter)")
|
"This module requires (:tools tree-sitter)")
|
||||||
|
|
||||||
(when (modulep! :editor format)
|
(when (modulep! :editor format)
|
||||||
(unless (and (file-exists-p (expand-file-name "~/.dotnet/tools/dotnet-csharpier"))
|
(unless (executable-find "dotnet-csharpier")
|
||||||
(file-exists-p ".config/dotnet-tools.json")
|
(warn! "csharpier is not installed, formatting will be disabled.")))
|
||||||
(eq 0 (call-process-shell-command
|
|
||||||
(format "grep -q 'dotnet-csharpier' %s" (expand-file-name ".config/dotnet-tools.json")) nil nil)))
|
|
||||||
(warn! "csharpier is not installed or setup as a local tool. Please see the module README. \nOtherwise, formatting will be disabled.")))
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue