|
|
|
@ -25,7 +25,7 @@ namespace sigc { |
|
|
|
clang::Index Source::ClangViewParse::clang_index(0, 0); |
|
|
|
clang::Index Source::ClangViewParse::clang_index(0, 0); |
|
|
|
|
|
|
|
|
|
|
|
Source::ClangViewParse::ClangViewParse(const boost::filesystem::path &file_path, Glib::RefPtr<Gsv::Language> language): |
|
|
|
Source::ClangViewParse::ClangViewParse(const boost::filesystem::path &file_path, Glib::RefPtr<Gsv::Language> language): |
|
|
|
Source::View(file_path, language) { |
|
|
|
Source::View(file_path, language) { |
|
|
|
auto tag_table=get_buffer()->get_tag_table(); |
|
|
|
auto tag_table=get_buffer()->get_tag_table(); |
|
|
|
for (auto &item : Config::get().source.clang_types) { |
|
|
|
for (auto &item : Config::get().source.clang_types) { |
|
|
|
if(!tag_table->lookup(item.second)) { |
|
|
|
if(!tag_table->lookup(item.second)) { |
|
|
|
@ -484,15 +484,10 @@ void Source::ClangViewParse::show_type_tooltips(const Gdk::Rectangle &rectangle) |
|
|
|
type_tooltips.show(); |
|
|
|
type_tooltips.show(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//type_tooltips.show(rectangle);
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////
|
|
|
|
|
|
|
|
//// ClangViewAutocomplete ///
|
|
|
|
Source::ClangViewAutocomplete::ClangViewAutocomplete(): autocomplete_state(AutocompleteState::IDLE) { |
|
|
|
//////////////////////////////
|
|
|
|
|
|
|
|
Source::ClangViewAutocomplete::ClangViewAutocomplete(const boost::filesystem::path &file_path, Glib::RefPtr<Gsv::Language> language): |
|
|
|
|
|
|
|
Source::ClangViewParse(file_path, language), autocomplete_state(AutocompleteState::IDLE) { |
|
|
|
|
|
|
|
get_buffer()->signal_changed().connect([this](){ |
|
|
|
get_buffer()->signal_changed().connect([this](){ |
|
|
|
if(autocomplete_dialog && autocomplete_dialog->shown) |
|
|
|
if(autocomplete_dialog && autocomplete_dialog->shown) |
|
|
|
delayed_reparse_connection.disconnect(); |
|
|
|
delayed_reparse_connection.disconnect(); |
|
|
|
@ -852,11 +847,8 @@ bool Source::ClangViewAutocomplete::full_reparse() { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////
|
|
|
|
|
|
|
|
//// ClangViewRefactor /////
|
|
|
|
Source::ClangViewRefactor::ClangViewRefactor() { |
|
|
|
////////////////////////////
|
|
|
|
|
|
|
|
Source::ClangViewRefactor::ClangViewRefactor(const boost::filesystem::path &file_path, Glib::RefPtr<Gsv::Language> language): |
|
|
|
|
|
|
|
Source::ClangViewAutocomplete(file_path, language) { |
|
|
|
|
|
|
|
similar_identifiers_tag=get_buffer()->create_tag(); |
|
|
|
similar_identifiers_tag=get_buffer()->create_tag(); |
|
|
|
similar_identifiers_tag->property_weight()=1000; //TODO: replace with Pango::WEIGHT_ULTRAHEAVY in 2016 or so (when Ubuntu 14 is history)
|
|
|
|
similar_identifiers_tag->property_weight()=1000; //TODO: replace with Pango::WEIGHT_ULTRAHEAVY in 2016 or so (when Ubuntu 14 is history)
|
|
|
|
|
|
|
|
|
|
|
|
@ -1362,7 +1354,9 @@ void Source::ClangViewRefactor::tag_similar_identifiers(const Identifier &identi |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Source::ClangView::ClangView(const boost::filesystem::path &file_path, Glib::RefPtr<Gsv::Language> language): ClangViewRefactor(file_path, language) { |
|
|
|
|
|
|
|
|
|
|
|
Source::ClangView::ClangView(const boost::filesystem::path &file_path, Glib::RefPtr<Gsv::Language> language): |
|
|
|
|
|
|
|
ClangViewParse(file_path, language), ClangViewAutocomplete(), ClangViewRefactor() { |
|
|
|
if(language) { |
|
|
|
if(language) { |
|
|
|
get_source_buffer()->set_highlight_syntax(true); |
|
|
|
get_source_buffer()->set_highlight_syntax(true); |
|
|
|
get_source_buffer()->set_language(language); |
|
|
|
get_source_buffer()->set_language(language); |
|
|
|
|