From bdd95ff43f3498d5623301cc53cf56b7b96faa4f Mon Sep 17 00:00:00 2001 From: Chiel92 Date: Mon, 8 Jul 2013 11:39:17 +0200 Subject: [PATCH] variable for csharp server port added --- plugin/youcompleteme.vim | 3 +++ python/ycm/completers/cs/cs_completer.py | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plugin/youcompleteme.vim b/plugin/youcompleteme.vim index fef34b22..35cd0208 100644 --- a/plugin/youcompleteme.vim +++ b/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', 0 ) +let g:ycm_auto_start_csharp_server = + \ get( g:, 'ycm_csharp_server_port', 2000 ) + " On-demand loading. Let's use the autoload folder and not slow down vim's " startup procedure. augroup youcompletemeStart diff --git a/python/ycm/completers/cs/cs_completer.py b/python/ycm/completers/cs/cs_completer.py index 7e50ffa5..940a7979 100755 --- a/python/ycm/completers/cs/cs_completer.py +++ b/python/ycm/completers/cs/cs_completer.py @@ -37,13 +37,13 @@ class CsharpCompleter( ThreadedCompleter ): def __init__( self ): super( CsharpCompleter, self ).__init__() - self.OmniSharpPort = 2000 + self.OmniSharpPort = int( vimsupport.GetVariableValue( "g:ycm_csharp_server_port" ) ) self.OmniSharpHost = 'http://localhost:' + str( self.OmniSharpPort ) if vimsupport.GetBoolValue( "g:ycm_auto_start_csharp_server" ): self._StartServer() - #def OnVimLeave( self ): - #self._StopServer() + def OnVimLeave( self ): + self._StopServer() def SupportedFiletypes( self ): """ Just csharp """ @@ -111,7 +111,7 @@ class CsharpCompleter( ThreadedCompleter ): def _StopServer( self ): """ Stop the OmniSharp server """ - self._GetResponse( '/stopserver' ) # Should only stop when server running + self._GetResponse( '/stopserver' ) def _ServerIsRunning( self ): """ Check if the OmniSharp server is running """