@@ -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
@@ -391,8 +393,8 @@ Default: atcursor >
391
393
392
394
*g:OmniSharp_runtests_echo_output*
393
395
When running unit tests with |:OmniSharpRunTest| and |:OmniSharpRunTestsInFile|
394
- or from the test runner , echo all test runner output to the |message-history|,
395
- so it can be viewed with |:messages|.
396
+ or from the |omnisharp-testrunner| , echo all test runner output to the
397
+ |message-history|, so it can be viewed with |:messages|.
396
398
Default: 0
397
399
398
400
*g:OmniSharp_runtests_parallel*
@@ -420,6 +422,47 @@ Default: 0
420
422
Open the |omnisharp-testrunner| automatically when running tests.
421
423
Default: 1
422
424
425
+ *g:OmniSharp_testrunner_banner*
426
+ Display the |omnisharp-testrunner| help/introduction banner when opening the
427
+ testrunner. When this option is set to 0, the banner may still be toggled with
428
+ the <F1> (default) toggle mapping.
429
+ Default: 1
430
+
431
+ *g:OmniSharp_testrunner_glyph*
432
+ Display a passed/failed "glyph" string beside completed test results in the
433
+ |omnisharp-testrunner|.
434
+ Default: 1
435
+
436
+ *g:OmniSharp_testrunner_glyph_failed*
437
+ The "glyph" string to display beside failed completed tests in the testrunner.
438
+ Default: ✘
439
+
440
+ *g:OmniSharp_testrunner_glyph_passed*
441
+ The "glyph" string to display beside passed completed tests in the testrunner.
442
+ Default: ✔
443
+
444
+ *g:OmniSharp_testrunner_loglevel*
445
+ The type of build and test logs to output in the |omnisharp-testrunner|.
446
+
447
+ all All build output and test runner output is displayed.
448
+
449
+ error When a build error occurs, the error message and stack
450
+ trace are output.
451
+
452
+ none Only build error messages will be output.
453
+
454
+ Default: error >
455
+ let g:OmniSharp_testrunner_loglevel = 'all'
456
+ <
457
+ *g:OmniSharp_testrunner_spinner*
458
+ Display a "running" spinner animation when running tests in the testrunner.
459
+ Default: 1
460
+
461
+ *g:OmniSharp_testrunner_spinnersteps*
462
+ A list of "step" strings to be displayed as the |omnisharp-testrunner|
463
+ "spinner" animation.
464
+ Default: ['∙∙∙', '●∙∙', '∙●∙', '∙∙●', '∙∙∙']
465
+
423
466
-------------------------------------------------------------------------------
424
467
3.6 INTEGRATIONS *omnisharp-integration-options*
425
468
@@ -639,18 +682,21 @@ convenient user re-mapping. These can be used like so: >
639
682
*<Plug>(omnisharp_run_test_no_build)*
640
683
:OmniSharpRunTest[!]
641
684
Run the current unit test. The cursor can be anywhere in the test method.
685
+ The |omnisharp-testrunner| window will be opened to display the test
686
+ status and results.
642
687
If the test fails, the failure message and location will be displayed in
643
- the quickfix list, along with the error stack trace, if one exists.
688
+ the testrunner, or optionally (see |g:OmniSharp_runtests_quickfix|) in the
689
+ quickfix list, along with the error stack trace if one exists.
644
690
645
691
When called with ! or the |<Plug>(omnisharp_run_test_no_build)| mapping, the
646
692
project is not built before running the test.
647
693
648
- *:OmniSharpDebugTest*
649
- *<Plug>(omnisharp_debug_test)*
650
- *<Plug>(omnisharp_debug_test_no_build)*
694
+ *:OmniSharpDebugTest*
695
+ *<Plug>(omnisharp_debug_test)*
696
+ *<Plug>(omnisharp_debug_test_no_build)*
651
697
:OmniSharpDebugTest[!]
652
698
Debug the current unit test with Vimspector. The cursor can be anywhere in
653
- the test method. The quickfix list is not populated with the test result.
699
+ the test method.
654
700
655
701
When called with ! or the |<Plug>(omnisharp_debug_test_no_build)| mapping,
656
702
the project is not built before starting the debugger.
@@ -659,8 +705,9 @@ convenient user re-mapping. These can be used like so: >
659
705
*<Plug>(omnisharp_run_tests_in_file)*
660
706
*<Plug>(omnisharp_run_tests_in_file_no_build)*
661
707
:OmniSharpRunTestsInFile[!]
662
- Run all unit tests in the current file. The quickfix list will be
663
- populated with the test results of all tests.
708
+ Run all unit tests in the current file. When |g:OmniSharp_runtests_quickfix|
709
+ is enabled, the quickfix list will be populated with the results of all
710
+ tests.
664
711
Optionally accepts one or more filenames of files to run tests for.
665
712
>
666
713
" Run all unit tests in the current file
@@ -684,6 +731,9 @@ convenient user re-mapping. These can be used like so: >
684
731
:OmniSharpOpenLog vsplit
685
732
:OmniSharpOpenLog tabedit
686
733
<
734
+ *:OmniSharpOpenTestRunner*
735
+ Open the |omnisharp-testrunner| window
736
+
687
737
*:OmniSharpGetCodeActions*
688
738
*<Plug>(omnisharp_code_actions)*
689
739
:OmniSharpGetCodeActions
@@ -825,7 +875,73 @@ OmniSharpStopped
825
875
Fired when the server process is stopped.
826
876
827
877
===============================================================================
828
- 6. INTEGRATIONS *omnisharp-integrations*
878
+ 6. TEST RUNNER *omnisharp-testrunner*
879
+
880
+ The test runner provides an overview of unit tests which have been run, along
881
+ with the test status (running/passed/failed/not run) and any outputs that may
882
+ be produced (exceptions and Console output).
883
+
884
+ Open the test runner window by either running a test (with e.g.
885
+ |:OmniSharpRunTest|) or with the |:OmniSharpOpenTestRunner| command.
886
+
887
+ Any time a new test is run, it (along with all other tests in the same file)
888
+ is added to the runner. Tests remain visible in the test runner window until
889
+ they are manually removed.
890
+
891
+ Tests are grouped under the files they are contained in, which are in turn
892
+ grouped by project. Folds are used to collapse and expand sections, so a
893
+ project/file/output section can be hidden or displayed using standard vim
894
+ |folding-commands|.
895
+
896
+ To disable the testrunner and instead use the quickfix list to navigate and
897
+ display test results, use the following settings: >
898
+ let g:OmniSharp_testrunner = 0
899
+ let g:OmniSharp_runtests_quickfix = 1
900
+ <
901
+ -------------------------------------------------------------------------------
902
+ 6.1 MAPPINGS *omnisharp-testrunner-mappings*
903
+
904
+ The following |<Plug>| mappings and associated default recursive mappings are
905
+ provided in the test runner window.
906
+
907
+ *<Plug>(omnisharp_testrunner_navigate)*
908
+ Default: <CR>
909
+ Navigate to the test under the cursor. When the used on a error stack trace
910
+ location in a failed test result, navigate to the stack location.
911
+
912
+ *<Plug>(omnisharp_testrunner_togglebanner)*
913
+ Default: <F1>
914
+ Toggle display of the help/intro banner. Note that the banner can be hidden
915
+ initially using the |g:OmniSharp_testrunner_banner| setting.
916
+
917
+ *<Plug>(omnisharp_testrunner_run)*
918
+ Default: <F5>
919
+ Run the test(s) under the cursor. When the cursor is on a line representing a
920
+ single test (the test itself or part of its output) then just that single test
921
+ is run. When the cursor is on a file name, then all tests in the file are run.
922
+ When the cursor is on a project name, all previously run tests in the project
923
+ will be run.
924
+ Note: Running tests in a project only runs previous run tests. This command
925
+ does not automatically discover tests in the project.
926
+
927
+ *<Plug>(omnisharp_testrunner_debug)*
928
+ Default: <F6>
929
+ Debug the test under the cursor in Vimspector.
930
+
931
+ *<Plug>(omnisharp_testrunner_set_breakpoints)*
932
+ Default: <F9>
933
+ When used on a failed test resulting in an error stack, the stack trace
934
+ locations are set in Vimspector as breakpoints.
935
+
936
+ *<Plug>(omnisharp_testrunner_remove)*
937
+ Default: dd
938
+ Remove the item under the cursor from the test runner. Can be used at the
939
+ test, file or project level. Note however that individual tests cannot be
940
+ completely removed: subsequent runs of tests in the containing file/project
941
+ will still run the removed test.
942
+
943
+ ===============================================================================
944
+ 7. INTEGRATIONS *omnisharp-integrations*
829
945
830
946
6.1 fzf, vim-clap, CtrlP, unite.vim~
831
947
0 commit comments