Code style fixes
This commit is contained in:
parent
c819c9f31e
commit
e1584a33b0
@ -202,7 +202,7 @@ Future< void > ClangCompleter::UpdateTranslationUnitAsync(
|
||||
make_shared< ClangPackagedTask >();
|
||||
|
||||
clang_packaged_task->parsing_task_ = packaged_task< void >(
|
||||
boost::move( functor ) );
|
||||
boost::move( functor ) );
|
||||
unique_future< void > future =
|
||||
clang_packaged_task->parsing_task_.get_future();
|
||||
clang_task_.Set( clang_packaged_task );
|
||||
|
@ -138,7 +138,7 @@ void IdentifierCompleter::AddCandidatesToDatabaseFromBuffer(
|
||||
const std::string &buffer_contents,
|
||||
const std::string &filetype,
|
||||
const std::string &filepath,
|
||||
bool collect_from_comments_and_strings) {
|
||||
bool collect_from_comments_and_strings ) {
|
||||
ClearCandidatesStoredForFile( filetype, filepath );
|
||||
|
||||
std::string new_contents =
|
||||
@ -293,8 +293,8 @@ void IdentifierCompleter::InitThreads() {
|
||||
}
|
||||
|
||||
buffer_identifiers_thread_.reset(
|
||||
new boost::thread( BufferIdentifiersThreadMain,
|
||||
boost::ref( buffer_identifiers_task_stack_ ) ) );
|
||||
new boost::thread( BufferIdentifiersThreadMain,
|
||||
boost::ref( buffer_identifiers_task_stack_ ) ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -57,10 +57,10 @@ public:
|
||||
const std::string &filepath );
|
||||
|
||||
void AddCandidatesToDatabaseFromBuffer(
|
||||
const std::string &buffer_contents,
|
||||
const std::string &filetype,
|
||||
const std::string &filepath,
|
||||
bool collect_from_comments_and_strings );
|
||||
const std::string &buffer_contents,
|
||||
const std::string &filetype,
|
||||
const std::string &filepath,
|
||||
bool collect_from_comments_and_strings );
|
||||
|
||||
// NOTE: params are taken by value on purpose! With a C++11 compiler we can
|
||||
// avoid an expensive copy of buffer_contents if the param is taken by value
|
||||
|
@ -30,11 +30,11 @@ const char *COMMENT_AND_STRING_REGEX =
|
||||
"|"
|
||||
"/\\*.*?\\*/" // C-style comments, '/* ... */'
|
||||
"|"
|
||||
"'(?:\\\\'|.)*?'" // Anything inside single quotes, '...', but mind the
|
||||
// escaped quote
|
||||
// Anything inside single quotes, '...', but mind the escaped quote
|
||||
"'(?:\\\\'|.)*?'"
|
||||
"|"
|
||||
"\"(?:\\\\\"|.)*?\""; // Anything inside double quotes, "...", but mind
|
||||
// the escaped double quote
|
||||
// Anything inside double quotes, "...", but mind the escaped double quote
|
||||
"\"(?:\\\\\"|.)*?\"";
|
||||
|
||||
const char *IDENTIFIER_REGEX = "[_a-zA-Z]\\w*";
|
||||
|
||||
|
@ -32,8 +32,8 @@ namespace YouCompleteMe {
|
||||
namespace {
|
||||
|
||||
std::vector< const Candidate * > CandidatesFromObjectList(
|
||||
const pylist &candidates,
|
||||
const std::string &candidate_property ) {
|
||||
const pylist &candidates,
|
||||
const std::string &candidate_property ) {
|
||||
int num_candidates = len( candidates );
|
||||
std::vector< std::string > candidate_strings;
|
||||
candidate_strings.reserve( num_candidates );
|
||||
@ -44,21 +44,22 @@ std::vector< const Candidate * > CandidatesFromObjectList(
|
||||
} else {
|
||||
object holder = extract< object >( candidates[ i ] );
|
||||
candidate_strings.push_back( extract< std::string >(
|
||||
holder[ candidate_property.c_str() ] ) );
|
||||
holder[ candidate_property.c_str() ] ) );
|
||||
}
|
||||
}
|
||||
|
||||
return CandidateRepository::Instance().GetCandidatesForStrings(
|
||||
candidate_strings );
|
||||
candidate_strings );
|
||||
}
|
||||
|
||||
} // unnamed namespace
|
||||
|
||||
boost::python::list FilterAndSortCandidates(
|
||||
const boost::python::list &candidates,
|
||||
const std::string &candidate_property,
|
||||
const std::string &query ) {
|
||||
const boost::python::list &candidates,
|
||||
const std::string &candidate_property,
|
||||
const std::string &query ) {
|
||||
pylist filtered_candidates;
|
||||
|
||||
if ( query.empty() )
|
||||
return filtered_candidates;
|
||||
|
||||
|
@ -27,9 +27,9 @@ namespace YouCompleteMe {
|
||||
// the candidates and a user query, returns a new sorted python list with the
|
||||
// original objects that survived the filtering.
|
||||
boost::python::list FilterAndSortCandidates(
|
||||
const boost::python::list &candidates,
|
||||
const std::string &candidate_property,
|
||||
const std::string &query );
|
||||
const boost::python::list &candidates,
|
||||
const std::string &candidate_property,
|
||||
const std::string &query );
|
||||
|
||||
} // namespace YouCompleteMe
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user