From c05692546a52e1602d4abbf82f24a390581c8a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Wed, 13 May 2015 15:28:06 +0200 Subject: [PATCH] add log messages --- juci/config.cc | 2 ++ juci/notebook.cc | 16 ++++++++-------- juci/source.cc | 3 +++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/juci/config.cc b/juci/config.cc index 22dbffb..1adb7df 100644 --- a/juci/config.cc +++ b/juci/config.cc @@ -3,7 +3,9 @@ MainConfig::MainConfig() : keybindings_cfg_(), source_cfg_() { + INFO("Reading config file"); boost::property_tree::json_parser::read_json("config.json", cfg_); + INFO("Config file read"); GenerateSource(); GenerateKeybindings(); GenerateDirectoryFilter(); diff --git a/juci/notebook.cc b/juci/notebook.cc index 4c6888e..d6c73eb 100644 --- a/juci/notebook.cc +++ b/juci/notebook.cc @@ -1,4 +1,5 @@ #include "notebook.h" +#include "logging.h" #include Notebook::Model::Model() { @@ -18,6 +19,7 @@ Notebook::Controller::Controller(Gtk::Window* window, Keybindings::Controller& k source_config_(source_cfg), directories_(dir_cfg), index_(0, 1) { + INFO("Create notebook"); window_ = window; OnNewPage("juCi++"); refClipboard_ = Gtk::Clipboard::get(); @@ -159,7 +161,7 @@ bool Notebook::Controller::GeneratePopup(int key_id) { Gtk::TextIter tmp = CurrentTextView().get_buffer()->get_insert()->get_iter(); Gtk::TextIter tmp1 = CurrentTextView().get_buffer()->get_insert()->get_iter(); Gtk::TextIter line = - CurrentTextView().get_buffer()->get_iter_at_line(tmp.get_line()); + CurrentTextView().get_buffer()->get_iter_at_line(tmp.get_line()); if (end.backward_char() && end.backward_char()) { bool illegal_chars = end.backward_search("\"", Gtk::TEXT_SEARCH_VISIBLE_ONLY, tmp, tmp1, line) @@ -201,16 +203,14 @@ bool Notebook::Controller::GeneratePopup(int key_id) { case clang::CompletionChunk_ResultType: return_value = chunk.chunk(); break; - case clang::CompletionChunk_Informative: - break; - default: - ss << chunk.chunk(); - break; + case clang::CompletionChunk_Informative: break; + default: ss << chunk.chunk(); break; } } - items[ss.str() + " --> " + return_value] = ss.str(); + if (ss.str().length() > 0) { // if length is 0 the result is empty + items[ss.str() + " --> " + return_value] = ss.str(); + } } - // Replace over with get suggestions from zalox! OVER IS JUST FOR TESTING Gtk::ScrolledWindow popup_scroll_; Gtk::ListViewText listview_(1, false, Gtk::SelectionMode::SELECTION_SINGLE); popup_scroll_.set_policy(Gtk::PolicyType::POLICY_NEVER, diff --git a/juci/source.cc b/juci/source.cc index e40f07c..dbc08e4 100644 --- a/juci/source.cc +++ b/juci/source.cc @@ -136,6 +136,7 @@ GetAutoCompleteSuggestions(int line_number, int column, std::vector *suggestions) { + INFO("Getting auto complete suggestions"); parsing.lock(); std::map buffers; notebook_->MapBuffers(&buffers); @@ -143,6 +144,8 @@ GetAutoCompleteSuggestions(int line_number, line_number, column, suggestions); + DEBUG("Number of suggestions"); + DEBUG_VAR(suggestions->size()); parsing.unlock(); }