|
|
|
|
@ -2003,36 +2003,6 @@ Source::ClangViewRefactor::ClangViewRefactor(const boost::filesystem::path &file
|
|
|
|
|
return std::tuple<Source::Offset, std::string, size_t>(Source::Offset(), "", 0); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
get_coverage = [this]() { |
|
|
|
|
auto build = Project::Build::create(this->file_path); |
|
|
|
|
if(build->project_path.empty()) { |
|
|
|
|
Info::get().print(this->file_path.filename().string() + ": could not find a supported build system"); |
|
|
|
|
return std::vector<Coverage::LineCoverage>{}; |
|
|
|
|
} |
|
|
|
|
build->update_default(); |
|
|
|
|
CompileCommands commands(build->get_default_path()); |
|
|
|
|
boost::filesystem::path object_file; |
|
|
|
|
for(const auto &command : commands.commands) { |
|
|
|
|
if(command.file == this->file_path) { |
|
|
|
|
auto values = command.parameter_values("-o"); |
|
|
|
|
if(!values.empty()) { |
|
|
|
|
object_file = command.directory / values.front(); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(object_file.empty()) { |
|
|
|
|
Info::get().print(this->file_path.filename().string() + ": could not find the C/C++ object file"); |
|
|
|
|
return std::vector<Coverage::LineCoverage>{}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
auto result = Coverage::analyze(Coverage::FileInfo{this->file_path, object_file, build->get_default_path(), this->language_id}); |
|
|
|
|
if(result.empty()) { |
|
|
|
|
Info::get().print(this->file_path.filename().string() + ": no supported coverage information found"); |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Source::ClangViewRefactor::Identifier Source::ClangViewRefactor::get_identifier() { |
|
|
|
|
|