From 3761b9b0bcbd127392569f34da01ec6d86d79b62 Mon Sep 17 00:00:00 2001 From: eidheim Date: Mon, 7 Sep 2020 11:50:02 +0200 Subject: [PATCH] Cleanup of preferences: enable_clang_tidy changed to clang_tidy_enable, and enable_clang_detailed_preprocessing_record changed to clang_detailed_preprocessing_record --- CMakeLists.txt | 2 +- src/compile_commands.cpp | 2 +- src/config.cpp | 4 ++-- src/config.hpp | 4 ++-- src/files.hpp | 12 ++++++------ src/source_clang.cpp | 2 +- src/usages_clang.cpp | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8510434..d0882b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.8.8) project(juci) -set(JUCI_VERSION "1.6.1.1") +set(JUCI_VERSION "1.6.1.2") set(CPACK_PACKAGE_NAME "jucipp") set(CPACK_PACKAGE_CONTACT "Ole Christian Eidheim ") diff --git a/src/compile_commands.cpp b/src/compile_commands.cpp index e5c1198..e5912b9 100644 --- a/src/compile_commands.cpp +++ b/src/compile_commands.cpp @@ -240,7 +240,7 @@ std::vector CompileCommands::get_arguments(const boost::filesystem: arguments.emplace_back(build_path.string()); } - if(Config::get().source.enable_clang_tidy) { + if(Config::get().source.clang_tidy_enable) { arguments.emplace_back("-Xclang"); arguments.emplace_back("-add-plugin"); arguments.emplace_back("-Xclang"); diff --git a/src/config.cpp b/src/config.cpp index ae9fa92..b3df836 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -172,9 +172,9 @@ void Config::read(const boost::property_tree::ptree &cfg) { source.search_for_selection = source_json.get("search_for_selection"); source.clang_format_style = source_json.get("clang_format_style"); source.clang_usages_threads = static_cast(source_json.get("clang_usages_threads")); - source.enable_clang_tidy = source_json.get("enable_clang_tidy"); + source.clang_tidy_enable = source_json.get("clang_tidy_enable"); source.clang_tidy_checks = source_json.get("clang_tidy_checks"); - source.enable_clang_detailed_preprocessing_record = source_json.get("enable_clang_detailed_preprocessing_record"); + source.clang_detailed_preprocessing_record = source_json.get("clang_detailed_preprocessing_record"); source.debug_place_cursor_at_stop = source_json.get("debug_place_cursor_at_stop"); auto pt_doc_search = cfg.get_child("documentation_searches"); for(auto &pt_doc_search_lang : pt_doc_search) { diff --git a/src/config.hpp b/src/config.hpp index 5ca898e..c954a78 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -97,10 +97,10 @@ public: std::string clang_format_style; unsigned clang_usages_threads; - bool enable_clang_tidy; + bool clang_tidy_enable; std::string clang_tidy_checks; - bool enable_clang_detailed_preprocessing_record = false; + bool clang_detailed_preprocessing_record = false; bool debug_place_cursor_at_stop; diff --git a/src/files.hpp b/src/files.hpp index 6e0686b..792aebf 100644 --- a/src/files.hpp +++ b/src/files.hpp @@ -66,14 +66,14 @@ const std::string default_config_file = R"RAW({ "search_for_selection": true, "clang_format_style_comment": "IndentWidth, AccessModifierOffset and UseTab are set automatically. See http://clang.llvm.org/docs/ClangFormatStyleOptions.html", "clang_format_style": "ColumnLimit: 0, NamespaceIndentation: All", - "clang_usages_threads_comment": "The number of threads used in finding usages in unparsed files. -1 corresponds to the number of cores available, and 0 disables the search", - "clang_usages_threads": -1, - "enable_clang_tidy_comment": "Enable clang-tidy in new C/C++ buffers", - "enable_clang_tidy": false, + "clang_tidy_enable_comment": "Enable clang-tidy in new C/C++ buffers", + "clang_tidy_enable": false, "clang_tidy_checks_comment": "In new C/C++ buffers, these checks are appended to the value of 'Checks' in the .clang-tidy file, if any", "clang_tidy_checks": "", - "enable_clang_detailed_preprocessing_record_comment": "Set to true to include all macro definitions and instantiations when parsing C/C++ buffers, at the cost of increased resource use. You should reopen buffers and delete build/.usages_clang after changing this option.", - "enable_clang_detailed_preprocessing_record": false, + "clang_usages_threads_comment": "The number of threads used in finding usages in unparsed files. -1 corresponds to the number of cores available, and 0 disables the search", + "clang_usages_threads": -1, + "clang_detailed_preprocessing_record_comment": "Set to true to, at the cost of increased resource use, include all macro definitions and instantiations when parsing new C/C++ buffers. You should reopen buffers and delete build/.usages_clang after changing this option.", + "clang_detailed_preprocessing_record": false, "debug_place_cursor_at_stop": false }, "terminal": { diff --git a/src/source_clang.cpp b/src/source_clang.cpp index 755acd9..fe725cd 100644 --- a/src/source_clang.cpp +++ b/src/source_clang.cpp @@ -125,7 +125,7 @@ void Source::ClangViewParse::parse_initialize() { auto arguments = CompileCommands::get_arguments(build->get_default_path(), file_path); clang_tokens.reset(); int flags = clangmm::TranslationUnit::DefaultFlags() & ~(CXTranslationUnit_DetailedPreprocessingRecord | CXTranslationUnit_Incomplete); - flags |= Config::get().source.enable_clang_detailed_preprocessing_record ? CXTranslationUnit_DetailedPreprocessingRecord : CXTranslationUnit_Incomplete; + flags |= Config::get().source.clang_detailed_preprocessing_record ? CXTranslationUnit_DetailedPreprocessingRecord : CXTranslationUnit_Incomplete; clang_tu = std::make_unique(std::make_shared(0, Config::get().log.libclang), file_path.string(), arguments, &buffer_raw, flags); clang_tokens = clang_tu->get_tokens(); clang_tokens_offsets.clear(); diff --git a/src/usages_clang.cpp b/src/usages_clang.cpp index 852a7c5..cd0e44c 100644 --- a/src/usages_clang.cpp +++ b/src/usages_clang.cpp @@ -259,7 +259,7 @@ boost::optional> Usages::Clang::get_usages(co else ++it; } - int flags = Config::get().source.enable_clang_detailed_preprocessing_record ? CXTranslationUnit_DetailedPreprocessingRecord : CXTranslationUnit_Incomplete; + int flags = Config::get().source.clang_detailed_preprocessing_record ? CXTranslationUnit_DetailedPreprocessingRecord : CXTranslationUnit_Incomplete; #if CINDEX_VERSION_MAJOR > 0 || (CINDEX_VERSION_MAJOR == 0 && CINDEX_VERSION_MINOR >= 35) flags |= CXTranslationUnit_KeepGoing; #endif