Browse Source

Merge pull request #500 from svermeulen/OmnisharpAutoStopOption

Added option to control whether YCM should auto-stop the omnisharp server upon leaving Vim or leave it running.
Val Markovic 11 years ago
parent
commit
029c4a6350
3 changed files with 13 additions and 1 deletions
  1. 9 0
      README.md
  2. 3 0
      plugin/youcompleteme.vim
  3. 1 1
      python/ycm/completers/cs/cs_completer.py

+ 9 - 0
README.md

@@ -850,6 +850,15 @@ Default: `1`
 
     let g:ycm_auto_start_csharp_server = 1
 
+### The `g:ycm_auto_stop_csharp_server` option
+
+When set to `1`, the OmniSharp server will be automatically stopped upon 
+closing vim.
+
+Default: `1`
+
+    let g:ycm_auto_stop_csharp_server = 1
+
 ### The `g:ycm_add_preview_to_completeopt` option
 
 When this option is set to `1`, YCM will add the `preview` string to Vim's

+ 3 - 0
plugin/youcompleteme.vim

@@ -154,6 +154,9 @@ let g:ycm_cache_omnifunc =
 let g:ycm_auto_start_csharp_server =
       \ get( g:, 'ycm_auto_start_csharp_server', 1 )
 
+let g:ycm_auto_stop_csharp_server =
+            \ get( g:, 'ycm_auto_stop_csharp_server', 1 )
+
 let g:ycm_csharp_server_port =
       \ get( g:, 'ycm_csharp_server_port', 2000 )
 

+ 1 - 1
python/ycm/completers/cs/cs_completer.py

@@ -50,7 +50,7 @@ class CsharpCompleter( ThreadedCompleter ):
 
 
   def OnVimLeave( self ):
-    if self._ServerIsRunning():
+    if vimsupport.GetBoolValue( 'g:ycm_auto_stop_csharp_server' ) and self._ServerIsRunning():
       self._StopServer()