From 6ba2dd8caac1fa36d0fae9338066be404700aa9f Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Tue, 22 Jan 2013 17:13:14 -0800 Subject: [PATCH] Printing an error when no ycm_clang_options.py file --- python/completers/cpp/clang_helpers.py | 2 +- python/completers/cpp/flags.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/python/completers/cpp/clang_helpers.py b/python/completers/cpp/clang_helpers.py index 7e6b7939..bb88e1e5 100644 --- a/python/completers/cpp/clang_helpers.py +++ b/python/completers/cpp/clang_helpers.py @@ -19,7 +19,7 @@ import os -# Given an interable object that produces strings (flags for Clang), removes the +# Given an iterable object that produces strings (flags for Clang), removes the # '-c' and '-o' options that Clang does not like to see when it's producing # completions for a file. def PrepareClangFlags( flags, filename ): diff --git a/python/completers/cpp/flags.py b/python/completers/cpp/flags.py index 631e1d3b..eb6e4620 100644 --- a/python/completers/cpp/flags.py +++ b/python/completers/cpp/flags.py @@ -23,8 +23,12 @@ import ycm_core import random import string import sys +import vimsupport CLANG_OPTIONS_FILENAME = '.ycm_clang_options.py' +NO_OPTIONS_FILENAME_MESSAGE = ('No {0} file detected, so no compile flags ' + 'are available. Thus no semantic support for C/C++/ObjC/ObjC++.').format( + CLANG_OPTIONS_FILENAME ) class Flags( object ): def __init__( self ): @@ -41,6 +45,7 @@ class Flags( object ): except KeyError: flags_module = self._FlagsModuleForFile( filename ) if not flags_module: + vimsupport.PostVimMessage( NO_OPTIONS_FILENAME_MESSAGE ) return ycm_core.StringVec() results = flags_module.FlagsForFile( filename )