~removed lsp and better docs for oreodave/csharp/get-unit-test

This commit is contained in:
oreodave
2019-11-24 16:41:41 +00:00
parent 5102d03bdd
commit ebeb79cb5e
3 changed files with 38 additions and 39 deletions

View File

@@ -208,11 +208,10 @@ My docsets are stored in .docsets for ease of use
- Books
- Weather
* Language Config
** C#
** CSharp
#+BEGIN_SRC elisp
(after! csharp-mode
(after! omnisharp
(after! counsel-etags
(setq omnisharp-server-executable-path "~/bin/omnisharp/run")
(defun oreodave/csharp/get-unit-test-in-project ()
(interactive)
(let* ((tags-file (counsel-etags-locate-tags-file))
@@ -236,29 +235,30 @@ My docsets are stored in .docsets for ease of use
(counsel-etags-forward-line linenum)
(omnisharp-unit-test-at-point))
))
:caller 'oreodave/csharp/get-unit-tests-in-project))))
(setq omnisharp-server-executable-path "~/bin/omnisharp/run"))
:caller 'oreodave/csharp/get-unit-tests-in-project)))
(add-hook 'csharp-mode-hook '(lambda()
(add-hook! 'csharp-mode-hook '(lambda()
(omnisharp-mode)
(setq c-basic-offset 4)
(c-set-style "java"))) ; Hook for csharp setting variables
(after! lsp
(setq lsp-clients-csharp-language-server-path (expand-file-name "~/bin/omnisharp-lsp/artifacts/publish/OmniSharp.Stdio.Driver/mono/OmniSharp.exe")))
(map! ; CSharp Keybinds
:map csharp-mode-map
:localleader
:desc "Format buffer" "=" 'omnisharp-code-format-entire-file
(:prefix "t"
:desc "Select Test in Project" "t" 'oreodave/csharp/get-unit-test-in-project))
)
:desc "Select Test in Project" "t" 'oreodave/csharp/get-unit-test-in-project)))
#+END_SRC
- I have custom installed the omnisharp roslyn executable, so I'd rather use that
- C# code is better at 4 space indents, but I indent most of my C code at 2 space indents because it looks nicer :)
- I have custom installed the omnisharp roslyn executable, so I'd rather use
that
- C# code is better at 4 space indents, but I indent most of my C code at 2
space indents because it looks nicer :)
- Implemented my own function which piggy backs counsel etags to globally search
tags for test specific context, then goes to it and uses an omnisharp test
command to unit test it. Basically global test search in C# projects
command to unit test it. Basically global test search in C# projects. To use
this, just make sure you have tags compiled and that all your tests are
written as some public void *name*\_Test (i.e. they are appended with _Test so
that the pattern can be matched_)
** Python
#+BEGIN_SRC elisp
(after! python

View File

@@ -104,7 +104,7 @@
;;common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
(csharp +lsp) ; unity, .NET, and mono shenanigans
(csharp) ; unity, .NET, and mono shenanigans
data ; config/data formats
;;erlang ; an elegant language for a more civilized age
;;elixir ; erlang done right

View File

@@ -11,7 +11,6 @@
; Coding
(package! counsel-etags) ; tags are cool
(package! py-yapf) ; formatting
(package! omnisharp) ; unit testing
; Arduino
(package! arduino-mode) ; mandatory, though I might make my own module for this
(package! company-arduino) ; intellisense EVERYTHING