فهرست منبع

Option to disable YCM-Syntastic integration

Fixes #210.
Strahinja Val Markovic 12 سال پیش
والد
کامیت
bc4e7fb850
3فایلهای تغییر یافته به همراه23 افزوده شده و 1 حذف شده
  1. 16 0
      README.md
  2. 4 1
      autoload/youcompleteme.vim
  3. 3 0
      plugin/youcompleteme.vim

+ 16 - 0
README.md

@@ -575,6 +575,22 @@ Default: `{}`
 
     let g:ycm_filetype_specific_completion_to_disable = {}
 
+### The `g:ycm_register_as_syntastic_checker` option
+
+When set, this option makes YCM register itself as the Syntastic checker for the
+`c`, `cpp`, `objc` and `objcpp` filetypes. This enables the YCM-Syntastic
+integration.
+
+If you're using YCM's identifier completer in C-family languages but cannot use
+the clang-based semantic completer for those languages _and_ want to use the GCC
+Syntastic checkers, unset this option.
+
+Don't unset this option unless you're sure you know what you're doing.
+
+Default: `1`
+
+    let g:ycm_register_as_syntastic_checker = 1
+
 ### The `g:ycm_allow_changing_updatetime` option
 
 When this option is set to `1`, YCM will change the `updatetime` Vim option to

+ 4 - 1
autoload/youcompleteme.vim

@@ -69,7 +69,10 @@ function! youcompleteme#Enable()
 
   call s:SetUpCompleteopt()
   call s:SetUpKeyMappings()
-  call s:ForceSyntasticCFamilyChecker()
+
+  if g:ycm_register_as_syntastic_checker
+    call s:ForceSyntasticCFamilyChecker()
+  endif
 
   if g:ycm_allow_changing_updatetime
     set ut=2000

+ 3 - 0
plugin/youcompleteme.vim

@@ -76,6 +76,9 @@ let g:ycm_filetype_blacklist =
 let g:ycm_filetype_specific_completion_to_disable =
       \ get( g:, 'ycm_filetype_specific_completion_to_disable', {} )
 
+let g:ycm_register_as_syntastic_checker =
+      \ get( g:, 'ycm_register_as_syntastic_checker', 1 )
+
 let g:ycm_allow_changing_updatetime =
       \ get( g:, 'ycm_allow_changing_updatetime', 1 )