Description: Do not require a ycmd upgrade
 No need to entangle us too strongly for experimental features
Author: David Kalnischkies <donkult@debian.org>
Forwarded: not-needed

--- a/autoload/youcompleteme.vim
+++ b/autoload/youcompleteme.vim
@@ -183,8 +183,14 @@
 
   call s:SetUpOptions()
 
-  py3 ycm_semantic_highlighting.Initialise()
-  let s:enable_inlay_hints = py3eval( 'ycm_inlay_hints.Initialise()' ) ? 1 : 0
+  if get( g:, 'ycm_enable_semantic_highlighting', 1 )
+    py3 ycm_semantic_highlighting.Initialise()
+  endif
+  if get( g:, 'ycm_enable_inlay_hints', 0 )
+    let s:enable_inlay_hints = py3eval( 'ycm_inlay_hints.Initialise()' ) ? 1 : 0
+  else
+    let s:enable_inlay_hints = 0
+  endif
 
   call youcompleteme#EnableCursorMovedAutocommands()
   augroup youcompleteme
@@ -278,8 +284,6 @@
 try:
   # Import the modules used in this file.
   from ycm import base, vimsupport, youcompleteme
-  from ycm import semantic_highlighting as ycm_semantic_highlighting
-  from ycm import inlay_hints as ycm_inlay_hints
 
   if 'ycm_state' in globals():
     # If re-initializing, pretend that we shut down
@@ -316,6 +320,16 @@
   vim.command( 'echohl None' )
   vim.command( 'return 0' )
 else:
+  try:
+    from ycm import semantic_highlighting as ycm_semantic_highlighting
+  except Exception:
+    vim.command( 'let g:ycm_enable_semantic_highlighting = 0' )
+
+  try:
+    from ycm import inlay_hints as ycm_inlay_hints
+  except Exception:
+    vim.command( 'let g:ycm_enable_inlay_hints = 0' )
+
   vim.command( 'return 1' )
 EOF
 endfunction
