@@ -25,7 +25,9 @@ CONTENTS *omnisharp-contents
25
25
3.7 Miscellaneous ....................... |omnisharp-miscellaneous-options|
26
26
4. Commands ............................... |omnisharp-commands|
27
27
5. Autocmds ............................... |omnisharp-autocmds|
28
- 6. Integrations ........................... |omnisharp-integrations|
28
+ 6. Test runner ............................ |omnisharp-testrunner|
29
+ 6.1 Mappings ............................ |omnisharp-testrunner-mappings|
30
+ 7. Integrations ........................... |omnisharp-integrations|
29
31
30
32
===============================================================================
31
33
1. DEPENDENCIES *omnisharp-dependencies*
@@ -43,7 +45,7 @@ Optional:~
43
45
2. USAGE *omnisharp-usage*
44
46
45
47
Opening a `*.cs` file will automatically start an instance of omnisharp-server
46
- (if using vim 8.0+, neovim or vim-dispatch). Symantic completions are triggered
48
+ (if using vim 8.0+, neovim or vim-dispatch). Semantic completions are triggered
47
49
using omni-completion (CTRL-X_CTRL-O in insert mode), or using an
48
50
autocompletion plugin such as asyncomplete or Deoplete.
49
51
@@ -375,8 +377,8 @@ Default: atcursor >
375
377
376
378
*g:OmniSharp_runtests_echo_output*
377
379
When running unit tests with |:OmniSharpRunTest| and |:OmniSharpRunTestsInFile|
378
- or from the test runner , echo all test runner output to the |message-history|,
379
- so it can be viewed with |:messages|.
380
+ or from the |omnisharp-testrunner| , echo all test runner output to the
381
+ |message-history|, so it can be viewed with |:messages|.
380
382
Default: 0
381
383
382
384
*g:OmniSharp_runtests_parallel*
@@ -404,6 +406,47 @@ Default: 0
404
406
Open the |omnisharp-testrunner| automatically when running tests.
405
407
Default: 1
406
408
409
+ *g:OmniSharp_testrunner_banner*
410
+ Display the |omnisharp-testrunner| help/introduction banner when opening the
411
+ testrunner. When this option is set to 0, the banner may still be toggled with
412
+ the <F1> (default) toggle mapping.
413
+ Default: 1
414
+
415
+ *g:OmniSharp_testrunner_glyph*
416
+ Display a passed/failed "glyph" string beside completed test results in the
417
+ |omnisharp-testrunner|.
418
+ Default: 1
419
+
420
+ *g:OmniSharp_testrunner_glyph_failed*
421
+ The "glyph" string to display beside failed completed tests in the testrunner.
422
+ Default: ✘
423
+
424
+ *g:OmniSharp_testrunner_glyph_passed*
425
+ The "glyph" string to display beside passed completed tests in the testrunner.
426
+ Default: ✔
427
+
428
+ *g:OmniSharp_testrunner_loglevel*
429
+ The type of build and test logs to output in the |omnisharp-testrunner|.
430
+
431
+ all All build output and test runner output is displayed.
432
+
433
+ error When a build error occurs, the error message and stack
434
+ trace are output.
435
+
436
+ none Only build error messages will be output.
437
+
438
+ Default: error >
439
+ let g:OmniSharp_testrunner_loglevel = 'all'
440
+ <
441
+ *g:OmniSharp_testrunner_spinner*
442
+ Display a "running" spinner animation when running tests in the testrunner.
443
+ Default: 1
444
+
445
+ *g:OmniSharp_testrunner_spinnersteps*
446
+ A list of "step" strings to be displayed as the |omnisharp-testrunner|
447
+ "spinner" animation.
448
+ Default: ['∙∙∙', '●∙∙', '∙●∙', '∙∙●', '∙∙∙']
449
+
407
450
-------------------------------------------------------------------------------
408
451
3.6 INTEGRATIONS *omnisharp-integration-options*
409
452
@@ -623,18 +666,21 @@ convenient user re-mapping. These can be used like so: >
623
666
*<Plug>(omnisharp_run_test_no_build)*
624
667
:OmniSharpRunTest[!]
625
668
Run the current unit test. The cursor can be anywhere in the test method.
669
+ The |omnisharp-testrunner| window will be opened to display the test
670
+ status and results.
626
671
If the test fails, the failure message and location will be displayed in
627
- the quickfix list, along with the error stack trace, if one exists.
672
+ the testrunner, or optionally (see |g:OmniSharp_runtests_quickfix|) in the
673
+ quickfix list, along with the error stack trace if one exists.
628
674
629
675
When called with ! or the |<Plug>(omnisharp_run_test_no_build)| mapping, the
630
676
project is not built before running the test.
631
677
632
- *:OmniSharpDebugTest*
633
- *<Plug>(omnisharp_debug_test)*
634
- *<Plug>(omnisharp_debug_test_no_build)*
678
+ *:OmniSharpDebugTest*
679
+ *<Plug>(omnisharp_debug_test)*
680
+ *<Plug>(omnisharp_debug_test_no_build)*
635
681
:OmniSharpDebugTest[!]
636
682
Debug the current unit test with Vimspector. The cursor can be anywhere in
637
- the test method. The quickfix list is not populated with the test result.
683
+ the test method.
638
684
639
685
When called with ! or the |<Plug>(omnisharp_debug_test_no_build)| mapping,
640
686
the project is not built before starting the debugger.
@@ -643,8 +689,9 @@ convenient user re-mapping. These can be used like so: >
643
689
*<Plug>(omnisharp_run_tests_in_file)*
644
690
*<Plug>(omnisharp_run_tests_in_file_no_build)*
645
691
:OmniSharpRunTestsInFile[!]
646
- Run all unit tests in the current file. The quickfix list will be
647
- populated with the test results of all tests.
692
+ Run all unit tests in the current file. When |g:OmniSharp_runtests_quickfix|
693
+ is enabled, the quickfix list will be populated with the results of all
694
+ tests.
648
695
Optionally accepts one or more filenames of files to run tests for.
649
696
>
650
697
" Run all unit tests in the current file
@@ -668,6 +715,9 @@ convenient user re-mapping. These can be used like so: >
668
715
:OmniSharpOpenLog vsplit
669
716
:OmniSharpOpenLog tabedit
670
717
<
718
+ *:OmniSharpOpenTestRunner*
719
+ Open the |omnisharp-testrunner| window
720
+
671
721
*:OmniSharpGetCodeActions*
672
722
*<Plug>(omnisharp_code_actions)*
673
723
:OmniSharpGetCodeActions
@@ -809,7 +859,73 @@ OmniSharpStopped
809
859
Fired when the server process is stopped.
810
860
811
861
===============================================================================
812
- 6. INTEGRATIONS *omnisharp-integrations*
862
+ 6. TEST RUNNER *omnisharp-testrunner*
863
+
864
+ The test runner provides an overview of unit tests which have been run, along
865
+ with the test status (running/passed/failed/not run) and any outputs that may
866
+ be produced (exceptions and Console output).
867
+
868
+ Open the test runner window by either running a test (with e.g.
869
+ |:OmniSharpRunTest|) or with the |:OmniSharpOpenTestRunner| command.
870
+
871
+ Any time a new test is run, it (along with all other tests in the same file)
872
+ is added to the runner. Tests remain visible in the test runner window until
873
+ they are manually removed.
874
+
875
+ Tests are grouped under the files they are contained in, which are in turn
876
+ grouped by project. Folds are used to collapse and expand sections, so a
877
+ project/file/output section can be hidden or displayed using standard vim
878
+ |folding-commands|.
879
+
880
+ To disable the testrunner and instead use the quickfix list to navigate and
881
+ display test results, use the following settings: >
882
+ let g:OmniSharp_testrunner = 0
883
+ let g:OmniSharp_runtests_quickfix = 1
884
+ <
885
+ -------------------------------------------------------------------------------
886
+ 6.1 MAPPINGS *omnisharp-testrunner-mappings*
887
+
888
+ The following |<Plug>| mappings and associated default recursive mappings are
889
+ provided in the test runner window.
890
+
891
+ *<Plug>(omnisharp_testrunner_navigate)*
892
+ Default: <CR>
893
+ Navigate to the test under the cursor. When the used on a error stack trace
894
+ location in a failed test result, navigate to the stack location.
895
+
896
+ *<Plug>(omnisharp_testrunner_togglebanner)*
897
+ Default: <F1>
898
+ Toggle display of the help/intro banner. Note that the banner can be hidden
899
+ initially using the |g:OmniSharp_testrunner_banner| setting.
900
+
901
+ *<Plug>(omnisharp_testrunner_run)*
902
+ Default: <F5>
903
+ Run the test(s) under the cursor. When the cursor is on a line representing a
904
+ single test (the test itself or part of its output) then just that single test
905
+ is run. When the cursor is on a file name, then all tests in the file are run.
906
+ When the cursor is on a project name, all previously run tests in the project
907
+ will be run.
908
+ Note: Running tests in a project only runs previous run tests. This command
909
+ does not automatically discover tests in the project.
910
+
911
+ *<Plug>(omnisharp_testrunner_debug)*
912
+ Default: <F6>
913
+ Debug the test under the cursor in Vimspector.
914
+
915
+ *<Plug>(omnisharp_testrunner_set_breakpoints)*
916
+ Default: <F9>
917
+ When used on a failed test resulting in an error stack, the stack trace
918
+ locations are set in Vimspector as breakpoints.
919
+
920
+ *<Plug>(omnisharp_testrunner_remove)*
921
+ Default: dd
922
+ Remove the item under the cursor from the test runner. Can be used at the
923
+ test, file or project level. Note however that individual tests cannot be
924
+ completely removed: subsequent runs of tests in the containing file/project
925
+ will still run the removed test.
926
+
927
+ ===============================================================================
928
+ 7. INTEGRATIONS *omnisharp-integrations*
813
929
814
930
6.1 fzf, vim-clap, CtrlP, unite.vim~
815
931
0 commit comments