logic: Fixes in header path detection
* Rerun header path detection when only cxx header path is present after update in migration * Check if path exists in header and framework path detection on mac/linux
This commit is contained in:
@@ -87,6 +87,11 @@ bool ApplicationSettings::load(const FilePath& filePath, bool readOnly)
|
|||||||
cxxHeaderSearchPaths = utility::replaceOrAddCxxCompilerHeaderPath(cxxHeaderSearchPaths);
|
cxxHeaderSearchPaths = utility::replaceOrAddCxxCompilerHeaderPath(cxxHeaderSearchPaths);
|
||||||
|
|
||||||
migration->setValuesInSettings(settings, "indexing/cxx/header_search_paths/header_search_path", cxxHeaderSearchPaths);
|
migration->setValuesInSettings(settings, "indexing/cxx/header_search_paths/header_search_path", cxxHeaderSearchPaths);
|
||||||
|
|
||||||
|
if (cxxHeaderSearchPaths.size() == 1)
|
||||||
|
{
|
||||||
|
migration->setValueInSettings(settings, "indexing/cxx/has_prefilled_header_search_paths", false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ std::vector<FilePath> CxxFrameworkPathDetector::getPaths() const
|
|||||||
{
|
{
|
||||||
if (utility::isPostfix<std::string>(" (framework directory)", path))
|
if (utility::isPostfix<std::string>(" (framework directory)", path))
|
||||||
{
|
{
|
||||||
frameworkPaths.push_back(FilePath(utility::replace(path, " (framework directory)", "")).makeCanonical());
|
FilePath p = FilePath(utility::replace(path, " (framework directory)", "")).makeCanonical();
|
||||||
|
if (p.exists())
|
||||||
|
{
|
||||||
|
frameworkPaths.push_back(p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return frameworkPaths;
|
return frameworkPaths;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ std::vector<FilePath> CxxHeaderPathDetector::getPaths() const
|
|||||||
for (const std::string& path : paths)
|
for (const std::string& path : paths)
|
||||||
{
|
{
|
||||||
if (!utility::isPostfix<std::string>(" (framework directory)", path) &&
|
if (!utility::isPostfix<std::string>(" (framework directory)", path) &&
|
||||||
|
FilePath(path).getCanonical().exists() &&
|
||||||
!FilePath(path).getCanonical().getConcatenated(L"/stdarg.h").exists())
|
!FilePath(path).getCanonical().getConcatenated(L"/stdarg.h").exists())
|
||||||
{
|
{
|
||||||
headerSearchPaths.push_back(FilePath(path).makeCanonical());
|
headerSearchPaths.push_back(FilePath(path).makeCanonical());
|
||||||
|
|||||||
Reference in New Issue
Block a user