|
@@ -22,8 +22,13 @@ from __future__ import absolute_import
|
|
|
# Not installing aliases from python-future; it's unreliable and slow.
|
|
|
from builtins import * # noqa
|
|
|
|
|
|
-from ycm.tests.test_utils import ( ExtendedMock, MockVimBuffers, MockVimModule,
|
|
|
- VimBuffer, VimMatch, VimSign )
|
|
|
+from ycm.tests.test_utils import ( ExtendedMock,
|
|
|
+ MockVimBuffers,
|
|
|
+ MockVimModule,
|
|
|
+ Version,
|
|
|
+ VimBuffer,
|
|
|
+ VimMatch,
|
|
|
+ VimSign )
|
|
|
MockVimModule()
|
|
|
|
|
|
import os
|
|
@@ -32,9 +37,14 @@ from hamcrest import ( assert_that, contains, empty, equal_to, has_entries,
|
|
|
is_in, is_not, matches_regexp )
|
|
|
from mock import call, MagicMock, patch
|
|
|
|
|
|
+from ycm import vimsupport
|
|
|
from ycm.paths import _PathToPythonUsedDuringBuild
|
|
|
-from ycm.vimsupport import SetVariableValue, SIGN_BUFFER_ID_INITIAL_VALUE
|
|
|
-from ycm.tests import ( StopServer, test_utils, UserOptions, WaitUntilReady,
|
|
|
+from ycm.vimsupport import ( SetVariableValue,
|
|
|
+ SIGN_BUFFER_ID_INITIAL_VALUE )
|
|
|
+from ycm.tests import ( StopServer,
|
|
|
+ test_utils,
|
|
|
+ UserOptions,
|
|
|
+ WaitUntilReady,
|
|
|
YouCompleteMeInstance )
|
|
|
from ycm.client.base_request import _LoadExtraConfFile
|
|
|
from ycm.youcompleteme import YouCompleteMe
|
|
@@ -537,7 +547,7 @@ def YouCompleteMe_ShowDiagnostics_DiagnosticsFound_OpenLocationList_test(
|
|
|
@patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',
|
|
|
return_value = True )
|
|
|
@patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )
|
|
|
-def YouCompleteMe_UpdateDiagnosticInterface_PrioritizeErrorsOverWarnings_test(
|
|
|
+def YouCompleteMe_UpdateDiagnosticInterface(
|
|
|
ycm, post_vim_message, *args ):
|
|
|
|
|
|
contents = """int main() {
|
|
@@ -611,6 +621,7 @@ def YouCompleteMe_UpdateDiagnosticInterface_PrioritizeErrorsOverWarnings_test(
|
|
|
|
|
|
test_utils.VIM_MATCHES_FOR_WINDOW.clear()
|
|
|
test_utils.VIM_SIGNS = []
|
|
|
+ vimsupport.SIGN_ID_FOR_BUFFER.clear()
|
|
|
|
|
|
with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 3, 1 ) ):
|
|
|
with patch( 'ycm.client.event_notification.EventNotification.Response',
|
|
@@ -686,6 +697,15 @@ def YouCompleteMe_UpdateDiagnosticInterface_PrioritizeErrorsOverWarnings_test(
|
|
|
)
|
|
|
|
|
|
|
|
|
+def YouCompleteMe_UpdateDiagnosticInterface_OldVim_test():
|
|
|
+ YouCompleteMe_UpdateDiagnosticInterface()
|
|
|
+
|
|
|
+
|
|
|
+@patch( 'ycm.tests.test_utils.VIM_VERSION', Version( 8, 1, 614 ) )
|
|
|
+def YouCompleteMe_UpdateDiagnosticInterface_NewVim_test():
|
|
|
+ YouCompleteMe_UpdateDiagnosticInterface()
|
|
|
+
|
|
|
+
|
|
|
@YouCompleteMeInstance( { 'g:ycm_enable_diagnostic_highlighting': 1 } )
|
|
|
def YouCompleteMe_UpdateMatches_ClearDiagnosticMatchesInNewBuffer_test( ycm ):
|
|
|
current_buffer = VimBuffer( 'buffer',
|