@@ -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
@@ -374,8 +376,8 @@ Default: atcursor >
374
376
375
377
*g:OmniSharp_runtests_echo_output*
376
378
When running unit tests with |:OmniSharpRunTest| and |:OmniSharpRunTestsInFile|
377
- or from the test runner , echo all test runner output to the |message-history|,
378
- so it can be viewed with |:messages|.
379
+ or from the |omnisharp-testrunner| , echo all test runner output to the
380
+ |message-history|, so it can be viewed with |:messages|.
379
381
Default: 0
380
382
381
383
*g:OmniSharp_runtests_parallel*
@@ -403,6 +405,47 @@ Default: 0
403
405
Open the |omnisharp-testrunner| automatically when running tests.
404
406
Default: 1
405
407
408
+ *g:OmniSharp_testrunner_banner*
409
+ Display the |omnisharp-testrunner| help/introduction banner when opening the
410
+ testrunner. When this option is set to 0, the banner may still be toggled with
411
+ the <F1> (default) toggle mapping.
412
+ Default: 1
413
+
414
+ *g:OmniSharp_testrunner_glyph*
415
+ Display a passed/failed "glyph" string beside completed test results in the
416
+ |omnisharp-testrunner|.
417
+ Default: 1
418
+
419
+ *g:OmniSharp_testrunner_glyph_failed*
420
+ The "glyph" string to display beside failed completed tests in the testrunner.
421
+ Default: ✘
422
+
423
+ *g:OmniSharp_testrunner_glyph_passed*
424
+ The "glyph" string to display beside passed completed tests in the testrunner.
425
+ Default: ✔
426
+
427
+ *g:OmniSharp_testrunner_loglevel*
428
+ The type of build and test logs to output in the |omnisharp-testrunner|.
429
+
430
+ all All build output and test runner output is displayed.
431
+
432
+ error When a build error occurs, the error message and stack
433
+ trace are output.
434
+
435
+ none Only build error messages will be output.
436
+
437
+ Default: error >
438
+ let g:OmniSharp_testrunner_loglevel = 'all'
439
+ <
440
+ *g:OmniSharp_testrunner_spinner*
441
+ Display a "running" spinner animation when running tests in the testrunner.
442
+ Default: 1
443
+
444
+ *g:OmniSharp_testrunner_spinnersteps*
445
+ A list of "step" strings to be displayed as the |omnisharp-testrunner|
446
+ "spinner" animation.
447
+ Default: ['∙∙∙', '●∙∙', '∙●∙', '∙∙●', '∙∙∙']
448
+
406
449
-------------------------------------------------------------------------------
407
450
3.6 INTEGRATIONS *omnisharp-integration-options*
408
451
@@ -602,18 +645,21 @@ convenient user re-mapping. These can be used like so: >
602
645
*<Plug>(omnisharp_run_test_no_build)*
603
646
:OmniSharpRunTest[!]
604
647
Run the current unit test. The cursor can be anywhere in the test method.
648
+ The |omnisharp-testrunner| window will be opened to display the test
649
+ status and results.
605
650
If the test fails, the failure message and location will be displayed in
606
- the quickfix list, along with the error stack trace, if one exists.
651
+ the testrunner, or optionally (see |g:OmniSharp_runtests_quickfix|) in the
652
+ quickfix list, along with the error stack trace if one exists.
607
653
608
654
When called with ! or the |<Plug>(omnisharp_run_test_no_build)| mapping, the
609
655
project is not built before running the test.
610
656
611
- *:OmniSharpDebugTest*
612
- *<Plug>(omnisharp_debug_test)*
613
- *<Plug>(omnisharp_debug_test_no_build)*
657
+ *:OmniSharpDebugTest*
658
+ *<Plug>(omnisharp_debug_test)*
659
+ *<Plug>(omnisharp_debug_test_no_build)*
614
660
:OmniSharpDebugTest[!]
615
661
Debug the current unit test with Vimspector. The cursor can be anywhere in
616
- the test method. The quickfix list is not populated with the test result.
662
+ the test method.
617
663
618
664
When called with ! or the |<Plug>(omnisharp_debug_test_no_build)| mapping,
619
665
the project is not built before starting the debugger.
@@ -622,8 +668,9 @@ convenient user re-mapping. These can be used like so: >
622
668
*<Plug>(omnisharp_run_tests_in_file)*
623
669
*<Plug>(omnisharp_run_tests_in_file_no_build)*
624
670
:OmniSharpRunTestsInFile[!]
625
- Run all unit tests in the current file. The quickfix list will be
626
- populated with the test results of all tests.
671
+ Run all unit tests in the current file. When |g:OmniSharp_runtests_quickfix|
672
+ is enabled, the quickfix list will be populated with the results of all
673
+ tests.
627
674
Optionally accepts one or more filenames of files to run tests for.
628
675
>
629
676
" Run all unit tests in the current file
@@ -647,6 +694,9 @@ convenient user re-mapping. These can be used like so: >
647
694
:OmniSharpOpenLog vsplit
648
695
:OmniSharpOpenLog tabedit
649
696
<
697
+ *:OmniSharpOpenTestRunner*
698
+ Open the |omnisharp-testrunner| window
699
+
650
700
*:OmniSharpGetCodeActions*
651
701
*<Plug>(omnisharp_code_actions)*
652
702
:OmniSharpGetCodeActions
@@ -781,7 +831,73 @@ OmniSharpStopped
781
831
Fired when the server process is stopped.
782
832
783
833
===============================================================================
784
- 6. INTEGRATIONS *omnisharp-integrations*
834
+ 6. TEST RUNNER *omnisharp-testrunner*
835
+
836
+ The test runner provides an overview of unit tests which have been run, along
837
+ with the test status (running/passed/failed/not run) and any outputs that may
838
+ be produced (exceptions and Console output).
839
+
840
+ Open the test runner window by either running a test (with e.g.
841
+ |:OmniSharpRunTest|) or with the |:OmniSharpOpenTestRunner| command.
842
+
843
+ Any time a new test is run, it (along with all other tests in the same file)
844
+ is added to the runner. Tests remain visible in the test runner window until
845
+ they are manually removed.
846
+
847
+ Tests are grouped under the files they are contained in, which are in turn
848
+ grouped by project. Folds are used to collapse and expand sections, so a
849
+ project/file/output section can be hidden or displayed using standard vim
850
+ |folding-commands|.
851
+
852
+ To disable the testrunner and instead use the quickfix list to navigate and
853
+ display test results, use the following settings: >
854
+ let g:OmniSharp_testrunner = 0
855
+ let g:OmniSharp_runtests_quickfix = 1
856
+ <
857
+ -------------------------------------------------------------------------------
858
+ 6.1 MAPPINGS *omnisharp-testrunner-mappings*
859
+
860
+ The following |<Plug>| mappings and associated default recursive mappings are
861
+ provided in the test runner window.
862
+
863
+ *<Plug>(omnisharp_testrunner_navigate)*
864
+ Default: <CR>
865
+ Navigate to the test under the cursor. When the used on a error stack trace
866
+ location in a failed test result, navigate to the stack location.
867
+
868
+ *<Plug>(omnisharp_testrunner_togglebanner)*
869
+ Default: <F1>
870
+ Toggle display of the help/intro banner. Note that the banner can be hidden
871
+ initially using the |g:OmniSharp_testrunner_banner| setting.
872
+
873
+ *<Plug>(omnisharp_testrunner_run)*
874
+ Default: <F5>
875
+ Run the test(s) under the cursor. When the cursor is on a line representing a
876
+ single test (the test itself or part of its output) then just that single test
877
+ is run. When the cursor is on a file name, then all tests in the file are run.
878
+ When the cursor is on a project name, all previously run tests in the project
879
+ will be run.
880
+ Note: Running tests in a project only runs previous run tests. This command
881
+ does not automatically discover tests in the project.
882
+
883
+ *<Plug>(omnisharp_testrunner_debug)*
884
+ Default: <F6>
885
+ Debug the test under the cursor in Vimspector.
886
+
887
+ *<Plug>(omnisharp_testrunner_set_breakpoints)*
888
+ Default: <F9>
889
+ When used on a failed test resulting in an error stack, the stack trace
890
+ locations are set in Vimspector as breakpoints.
891
+
892
+ *<Plug>(omnisharp_testrunner_remove)*
893
+ Default: dd
894
+ Remove the item under the cursor from the test runner. Can be used at the
895
+ test, file or project level. Note however that individual tests cannot be
896
+ completely removed: subsequent runs of tests in the containing file/project
897
+ will still run the removed test.
898
+
899
+ ===============================================================================
900
+ 7. INTEGRATIONS *omnisharp-integrations*
785
901
786
902
6.1 fzf, vim-clap, CtrlP, unite.vim~
787
903
0 commit comments