Browse Source

Cleanup of preferences: enable_clang_tidy changed to clang_tidy_enable, and enable_clang_detailed_preprocessing_record changed to clang_detailed_preprocessing_record

pipelines/235045657
eidheim 5 years ago
parent
commit
3761b9b0bc
  1. 2
      CMakeLists.txt
  2. 2
      src/compile_commands.cpp
  3. 4
      src/config.cpp
  4. 4
      src/config.hpp
  5. 12
      src/files.hpp
  6. 2
      src/source_clang.cpp
  7. 2
      src/usages_clang.cpp

2
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 <eidheim@gmail.com>")

2
src/compile_commands.cpp

@ -240,7 +240,7 @@ std::vector<std::string> 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");

4
src/config.cpp

@ -172,9 +172,9 @@ void Config::read(const boost::property_tree::ptree &cfg) {
source.search_for_selection = source_json.get<bool>("search_for_selection");
source.clang_format_style = source_json.get<std::string>("clang_format_style");
source.clang_usages_threads = static_cast<unsigned>(source_json.get<int>("clang_usages_threads"));
source.enable_clang_tidy = source_json.get<bool>("enable_clang_tidy");
source.clang_tidy_enable = source_json.get<bool>("clang_tidy_enable");
source.clang_tidy_checks = source_json.get<std::string>("clang_tidy_checks");
source.enable_clang_detailed_preprocessing_record = source_json.get<bool>("enable_clang_detailed_preprocessing_record");
source.clang_detailed_preprocessing_record = source_json.get<bool>("clang_detailed_preprocessing_record");
source.debug_place_cursor_at_stop = source_json.get<bool>("debug_place_cursor_at_stop");
auto pt_doc_search = cfg.get_child("documentation_searches");
for(auto &pt_doc_search_lang : pt_doc_search) {

4
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;

12
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": {

2
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<clangmm::TranslationUnit>(std::make_shared<clangmm::Index>(0, Config::get().log.libclang), file_path.string(), arguments, &buffer_raw, flags);
clang_tokens = clang_tu->get_tokens();
clang_tokens_offsets.clear();

2
src/usages_clang.cpp

@ -259,7 +259,7 @@ boost::optional<std::vector<Usages::Clang::Usages>> 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

Loading…
Cancel
Save