From b75db735b43a00cb8e81b8f95b00f6956277b869 Mon Sep 17 00:00:00 2001 From: Igor Bogoslavskyi Date: Sat, 7 May 2016 10:35:37 +0200 Subject: [PATCH 1/4] add windows include --- EasyClangComplete.sublime-settings | 1 + 1 file changed, 1 insertion(+) diff --git a/EasyClangComplete.sublime-settings b/EasyClangComplete.sublime-settings index d1858776..5e221395 100644 --- a/EasyClangComplete.sublime-settings +++ b/EasyClangComplete.sublime-settings @@ -5,6 +5,7 @@ "/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 14.0\\VC\\include", "$project_base_path/src", "/workspace/$project_name/src", ], From 12f46466b8796544ebfe0c241f9f6caac2b39797 Mon Sep 17 00:00:00 2001 From: Igor Bogoslavskyi Date: Sat, 7 May 2016 10:45:52 +0200 Subject: [PATCH 2/4] debugging --- EasyClangComplete.sublime-settings | 2 ++ 1 file changed, 2 insertions(+) diff --git a/EasyClangComplete.sublime-settings b/EasyClangComplete.sublime-settings index 5e221395..0dc315a3 100644 --- a/EasyClangComplete.sublime-settings +++ b/EasyClangComplete.sublime-settings @@ -5,6 +5,8 @@ "/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", From 7d05f6f7c44e35442fc98a1bbdc975717ddf91b0 Mon Sep 17 00:00:00 2001 From: Igor Bogoslavskyi Date: Sat, 7 May 2016 10:52:49 +0200 Subject: [PATCH 3/4] debugging completion flags --- plugin/completion/bin_complete.py | 2 +- plugin/completion/lib_complete.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/completion/bin_complete.py b/plugin/completion/bin_complete.py index 9e7ff84b..01920d7b 100644 --- a/plugin/completion/bin_complete.py +++ b/plugin/completion/bin_complete.py @@ -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.debug(" clang command: \n%s", complete_cmd) + log.warning(" 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 f747caeb..43023bdf 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.debug(" clang flags are: %s", clang_flags) + log.warning(" clang flags are: %s", clang_flags) try: TU = Completer.tu_module start = time.time() From 1059f1ae9f4687d75a5549e2506b6b8bde472355 Mon Sep 17 00:00:00 2001 From: Igor Bogoslavskyi Date: Sat, 7 May 2016 11:28:42 +0200 Subject: [PATCH 4/4] 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():