From f6ec5557c0a9785eed16c5001c3111f631fc0f4e Mon Sep 17 00:00:00 2001 From: micbou Date: Mon, 26 Nov 2018 12:49:36 +0100 Subject: [PATCH] Add g:ycm_filter_diagnostics to list of options --- plugin/youcompleteme.vim | 3 +++ python/ycm/diagnostic_filter.py | 4 ++-- python/ycm/tests/__init__.py | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugin/youcompleteme.vim b/plugin/youcompleteme.vim index 85c8ad28..3cc57480 100644 --- a/plugin/youcompleteme.vim +++ b/plugin/youcompleteme.vim @@ -153,6 +153,9 @@ let g:ycm_echo_current_diagnostic = \ get( g:, 'ycm_echo_current_diagnostic', \ get( g:, 'syntastic_echo_current_error', 1 ) ) +let g:ycm_filter_diagnostics = + \ get( g:, 'ycm_filter_diagnostics', {} ) + let g:ycm_always_populate_location_list = \ get( g:, 'ycm_always_populate_location_list', \ get( g:, 'syntastic_always_populate_loc_list', 0 ) ) diff --git a/python/ycm/diagnostic_filter.py b/python/ycm/diagnostic_filter.py index e31e6e70..7448f2c0 100644 --- a/python/ycm/diagnostic_filter.py +++ b/python/ycm/diagnostic_filter.py @@ -53,9 +53,9 @@ class DiagnosticFilter( object ): @staticmethod def CreateFromOptions( user_options ): - all_filters = dict( user_options.get( 'filter_diagnostics', {} ) ) + all_filters = user_options[ 'filter_diagnostics' ] compiled_by_type = {} - for type_spec, filter_value in iteritems( dict( all_filters ) ): + for type_spec, filter_value in iteritems( all_filters ): filetypes = [ type_spec ] if type_spec.find( ',' ) != -1: filetypes = type_spec.split( ',' ) diff --git a/python/ycm/tests/__init__.py b/python/ycm/tests/__init__.py index dadf9408..4acd66f6 100644 --- a/python/ycm/tests/__init__.py +++ b/python/ycm/tests/__init__.py @@ -48,6 +48,7 @@ DEFAULT_CLIENT_OPTIONS = { 'g:ycm_enable_diagnostic_signs': 1, 'g:ycm_enable_diagnostic_highlighting': 0, 'g:ycm_echo_current_diagnostic': 1, + 'g:ycm_filter_diagnostics': {}, 'g:ycm_always_populate_location_list': 0, 'g:ycm_collect_identifiers_from_tags_files': 0, 'g:ycm_seed_identifiers_with_syntax': 0,