From 1059f1ae9f4687d75a5549e2506b6b8bde472355 Mon Sep 17 00:00:00 2001 From: Igor Bogoslavskyi Date: Sat, 7 May 2016 11:28:42 +0200 Subject: [PATCH] update -I flags + remove vector test in windows --- EasyClangComplete.sublime-settings | 3 --- plugin/completion/bin_complete.py | 6 +++--- plugin/completion/lib_complete.py | 2 +- tests/test_complete.py | 4 ++++ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/EasyClangComplete.sublime-settings b/EasyClangComplete.sublime-settings index 0dc315a3..d1858776 100644 --- a/EasyClangComplete.sublime-settings +++ b/EasyClangComplete.sublime-settings @@ -5,9 +5,6 @@ "/usr/include", "/usr/include/c++/4.6", // this is for travis build "/usr/include/c++/4.6/x86_64-linux-gnu", - "C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\include", - "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\include", - "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include", "$project_base_path/src", "/workspace/$project_name/src", ], diff --git a/plugin/completion/bin_complete.py b/plugin/completion/bin_complete.py index 01920d7b..126154ed 100644 --- a/plugin/completion/bin_complete.py +++ b/plugin/completion/bin_complete.py @@ -141,9 +141,9 @@ def init(self, view, includes, settings, project_folder): # init needed variables from settings self.flags_dict[view.id()] = [] for include in includes: - self.flags_dict[view.id()].append('-I' + include) + self.flags_dict[view.id()].append('-I "{}"'.format(include)) - # support .clang_complete file with -I entries + # support .clang_complete file with -I "" entries if settings.search_clang_complete: log.debug(" searching for .clang_complete in %s up to %s", file_folder, project_folder) @@ -192,7 +192,7 @@ def complete(self, view, cursor_pos, show_errors): std=self.std_flag, complete_at=complete_at_str, includes=" ".join(self.flags_dict[view.id()])) - log.warning(" clang command: \n%s", complete_cmd) + log.debug(" clang command: \n%s", complete_cmd) # execute clang code completion start = time.time() log.debug(" started code complete for view %s", view.id()) diff --git a/plugin/completion/lib_complete.py b/plugin/completion/lib_complete.py index 43023bdf..f747caeb 100644 --- a/plugin/completion/lib_complete.py +++ b/plugin/completion/lib_complete.py @@ -137,7 +137,7 @@ def init(self, view, includes, settings, project_folder): clang_complete_file) clang_flags += flags - log.warning(" clang flags are: %s", clang_flags) + log.debug(" clang flags are: %s", clang_flags) try: TU = Completer.tu_module start = time.time() diff --git a/tests/test_complete.py b/tests/test_complete.py index e5a13203..41aa126b 100644 --- a/tests/test_complete.py +++ b/tests/test_complete.py @@ -3,6 +3,7 @@ import tempfile import time import logging +import platform from os import path from unittest import TestCase @@ -114,6 +115,9 @@ def test_complete(self): self.assertTrue(expected in completer.completions) def test_complete_vector(self): + if platform.system() == "Windows": + logging.warning(" NOT TESTING VECTOR COMPLETION ON WINDOWS!") + return file_name = path.join(path.dirname(__file__), 'test_vector.cpp') self.view = sublime.active_window().open_file(file_name) while self.view.is_loading():