|
|
|
|
@ -420,8 +420,9 @@ void Source::ClangViewParse::update_diagnostics() {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(diagnostic.severity >= clangmm::Diagnostic::Severity::Error && |
|
|
|
|
starts_with(diagnostic.spelling, "variable has incomplete type '")) { |
|
|
|
|
size_t start = 30; |
|
|
|
|
(starts_with(diagnostic.spelling, "variable has incomplete type '") || |
|
|
|
|
starts_with(diagnostic.spelling, "member access into incomplete type '"))) { |
|
|
|
|
auto start = diagnostic.spelling.find('\'') + 1; |
|
|
|
|
auto end = diagnostic.spelling.find('\'', start); |
|
|
|
|
if(end != std::string::npos) { |
|
|
|
|
auto type = diagnostic.spelling.substr(start, end - start); |
|
|
|
|
@ -1110,9 +1111,9 @@ Source::ClangViewAutocomplete::ClangViewAutocomplete(const boost::filesystem::pa
|
|
|
|
|
row = text.substr(0, pos); |
|
|
|
|
else |
|
|
|
|
row = text; |
|
|
|
|
//erase existing variable or function before insert iter
|
|
|
|
|
// Erase existing variable or function before insert iter
|
|
|
|
|
get_buffer()->erase(CompletionDialog::get()->start_mark->get_iter(), get_buffer()->get_insert()->get_iter()); |
|
|
|
|
//do not insert template argument or function parameters if they already exist
|
|
|
|
|
// Do not insert template argument or function parameters if they already exist
|
|
|
|
|
auto iter = get_buffer()->get_insert()->get_iter(); |
|
|
|
|
if(*iter == '<' || *iter == '(') { |
|
|
|
|
auto bracket_pos = row.find(*iter); |
|
|
|
|
@ -1139,7 +1140,7 @@ Source::ClangViewAutocomplete::ClangViewAutocomplete(const boost::filesystem::pa
|
|
|
|
|
row.pop_back(); |
|
|
|
|
|
|
|
|
|
get_buffer()->insert(CompletionDialog::get()->start_mark->get_iter(), row); |
|
|
|
|
//if selection is finalized, select text inside template arguments or function parameters
|
|
|
|
|
// If selection is finalized, select text inside template arguments or function parameters
|
|
|
|
|
if(hide_window) { |
|
|
|
|
size_t start_pos = std::string::npos; |
|
|
|
|
size_t end_pos = std::string::npos; |
|
|
|
|
@ -1185,7 +1186,7 @@ Source::ClangViewAutocomplete::ClangViewAutocomplete(const boost::filesystem::pa
|
|
|
|
|
get_buffer()->select_range(get_buffer()->get_iter_at_offset(start_offset), get_buffer()->get_iter_at_offset(end_offset)); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
//new autocomplete after for instance when selecting "std::"
|
|
|
|
|
// New autocomplete after for instance when selecting "std::"
|
|
|
|
|
auto iter = get_buffer()->get_insert()->get_iter(); |
|
|
|
|
if(iter.backward_char() && *iter == ':') { |
|
|
|
|
autocomplete.run(); |
|
|
|
|
@ -1694,7 +1695,7 @@ Source::ClangViewRefactor::ClangViewRefactor(const boost::filesystem::path &file
|
|
|
|
|
return usages; |
|
|
|
|
|
|
|
|
|
auto embolden_token = [](std::string &line, unsigned token_start_pos, unsigned token_end_pos) { |
|
|
|
|
//markup token as bold
|
|
|
|
|
// Markup token as bold
|
|
|
|
|
size_t pos = 0; |
|
|
|
|
while((pos = line.find('&', pos)) != std::string::npos) { |
|
|
|
|
size_t pos2 = line.find(';', pos + 2); |
|
|
|
|
|