2018-08-21 05:27:52 +00:00
|
|
|
// Copyright 2017-2018 ccls Authors
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2018-10-29 04:21:21 +00:00
|
|
|
#include "config.hh"
|
2018-03-31 20:59:27 +00:00
|
|
|
|
2018-10-28 17:49:31 +00:00
|
|
|
namespace ccls {
|
2018-08-09 17:08:14 +00:00
|
|
|
Config *g_config;
|
2018-09-16 18:07:15 +00:00
|
|
|
|
|
|
|
void DoPathMapping(std::string &arg) {
|
|
|
|
for (const std::string &mapping : g_config->clang.pathMappings) {
|
|
|
|
auto sep = mapping.find('>');
|
|
|
|
if (sep != std::string::npos) {
|
|
|
|
auto p = arg.find(mapping.substr(0, sep));
|
|
|
|
if (p != std::string::npos)
|
|
|
|
arg.replace(p, sep, mapping.substr(sep + 1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|