Commit a8d7c1bd authored by Milian Wolff's avatar Milian Wolff
Browse files

Use the canonical file path in the project JSON map.

Otherwise, when the path contains a symlink, we'd not find any
includes because the rest of KDevelop operates on canonical paths.

This fixes the include/define lookup on my work machine, where the
project path contains a symlink.
parent dae61587
...@@ -85,7 +85,10 @@ CMakeJsonData import(const Path& commandsFile) ...@@ -85,7 +85,10 @@ CMakeJsonData import(const Path& commandsFile)
CMakeFile ret; CMakeFile ret;
ret.includes = result.paths; ret.includes = result.paths;
ret.defines = result.defines; ret.defines = result.defines;
data.files[Path(entry["file"].toString())] = ret; // NOTE: we use the canonical file path to prevent issues with symlinks in the path
// leading to lookup failures
const auto path = Path(QFileInfo(entry["file"].toString()).canonicalFilePath());
data.files[path] = ret;
} }
data.isValid = true; data.isValid = true;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment