diff --git a/python/ycm/completers/cs/cs_completer.py b/python/ycm/completers/cs/cs_completer.py index 83662007..1e1a18e6 100755 --- a/python/ycm/completers/cs/cs_completer.py +++ b/python/ycm/completers/cs/cs_completer.py @@ -63,6 +63,7 @@ class CsharpDiagnosticLocation: self.column_number_ = column self.filename_ = filename + class CsharpCompleter( Completer ): """ A Completer that uses the Omnisharp server as completion engine. diff --git a/python/ycm/server/tests/diagnostics_test.py b/python/ycm/server/tests/diagnostics_test.py index 1af3c202..9b1b779c 100644 --- a/python/ycm/server/tests/diagnostics_test.py +++ b/python/ycm/server/tests/diagnostics_test.py @@ -20,7 +20,8 @@ from ..server_utils import SetUpPythonPath SetUpPythonPath() import time -from .test_utils import Setup, BuildRequest, PathToTestFile +from .test_utils import ( Setup, BuildRequest, PathToTestFile, + StopOmniSharpServer ) from webtest import TestApp from nose.tools import with_setup, eq_ from hamcrest import ( assert_that, contains, contains_string, has_entries, @@ -169,7 +170,8 @@ def Diagnostics_CsCompleter_ZeroBasedLineAndColumn_test(): assert_that( results, contains( has_entries( { - 'text': contains_string( "Unexpected symbol `}'', expecting identifier" ), + 'text': contains_string( + "Unexpected symbol `}'', expecting identifier" ), 'location': has_entries( { 'line_num': 9, 'column_num': 1 @@ -186,6 +188,8 @@ def Diagnostics_CsCompleter_ZeroBasedLineAndColumn_test(): } ) } ) ) ) + StopOmniSharpServer( app ) + @with_setup( Setup ) def GetDetailedDiagnostic_ClangCompleter_Works_test(): @@ -248,14 +252,12 @@ def GetDetailedDiagnostic_CsCompleter_Works_test(): results = app.post_json( '/detailed_diagnostic', diag_data ).json assert_that( results, - has_entry( 'message', contains_string( "Unexpected symbol `}'', expecting identifier" ) ) ) + has_entry( + 'message', + contains_string( + "Unexpected symbol `}'', expecting identifier" ) ) ) - - # We need to turn off the CS server so that it doesn't stick around - app.post_json( '/run_completer_command', - BuildRequest( completer_target = 'filetype_default', - command_arguments = ['StopServer'], - filetype = 'cs' ) ) + StopOmniSharpServer( app ) @with_setup( Setup )