mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-25 09:05:10 +00:00
Fix hierarchical .cquery
This commit is contained in:
parent
640f548e7c
commit
2a7117e6e5
@ -334,16 +334,16 @@ std::vector<Project::Entry> LoadFromDirectoryListing(Config* init_opts,
|
|||||||
|
|
||||||
auto GetCompilerArgumentForFile = [&config,
|
auto GetCompilerArgumentForFile = [&config,
|
||||||
&folder_args](const std::string& path) {
|
&folder_args](const std::string& path) {
|
||||||
for (std::string cur = GetDirName(path); ; cur = GetDirName(cur)) {
|
for (std::string cur = GetDirName(path);; cur = GetDirName(cur)) {
|
||||||
|
auto it = folder_args.find(cur);
|
||||||
|
if (it != folder_args.end())
|
||||||
|
return it->second;
|
||||||
std::string normalized = NormalizePath(cur);
|
std::string normalized = NormalizePath(cur);
|
||||||
|
// Break if outside of the project root.
|
||||||
if (normalized.size() <= config->project_dir.size() ||
|
if (normalized.size() <= config->project_dir.size() ||
|
||||||
normalized.compare(0, config->project_dir.size(),
|
normalized.compare(0, config->project_dir.size(),
|
||||||
config->project_dir) != 0)
|
config->project_dir) != 0)
|
||||||
break;
|
break;
|
||||||
auto it = folder_args.find(cur);
|
|
||||||
if (it != folder_args.end()) {
|
|
||||||
return it->second;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return folder_args[config->project_dir];
|
return folder_args[config->project_dir];
|
||||||
};
|
};
|
||||||
|
@ -33,10 +33,10 @@ struct MultiQueueLock {
|
|||||||
MultiQueueLock(Queue... lockable) : tuple_{lockable...} { lock(); }
|
MultiQueueLock(Queue... lockable) : tuple_{lockable...} { lock(); }
|
||||||
~MultiQueueLock() { unlock(); }
|
~MultiQueueLock() { unlock(); }
|
||||||
void lock() {
|
void lock() {
|
||||||
lock_impl(typename std::make_index_sequence<sizeof...(Queue)>{});
|
lock_impl(typename std::index_sequence_for<Queue...>{});
|
||||||
}
|
}
|
||||||
void unlock() {
|
void unlock() {
|
||||||
unlock_impl(typename std::make_index_sequence<sizeof...(Queue)>{});
|
unlock_impl(typename std::index_sequence_for<Queue...>{});
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user