Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From f52618b086f02a87ccaed124c00a2767a3bfbef1 Mon Sep 17 00:00:00 2001
- From: DanielChabrowski <dantezstudio@gmail.com>
- Date: Wed, 3 Jul 2019 01:56:49 +0200
- Subject: [PATCH] CppTools: Follow symlinks for include completion
- ---
- .../clangcodemodel/clangcompletionassistprocessor.cpp | 9 +++++++++
- 1 file changed, 9 insertions(+)
- diff --git a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp
- index 6f1397c487..c14277e8f1 100644
- --- a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp
- +++ b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp
- @@ -476,6 +476,7 @@ bool ClangCompletionAssistProcessor::completeInclude(const QTextCursor &cursor)
- const ::Utils::MimeType mimeType = ::Utils::mimeTypeForName("text/x-c++hdr");
- const QStringList suffixes = mimeType.suffixes();
- + QStringList uniqueHeaderPaths;
- foreach (const ProjectExplorer::HeaderPath &headerPath, headerPaths) {
- QString realPath = headerPath.path;
- if (!directoryPrefix.isEmpty()) {
- @@ -484,6 +485,14 @@ bool ClangCompletionAssistProcessor::completeInclude(const QTextCursor &cursor)
- if (headerPath.type == ProjectExplorer::HeaderPathType::Framework)
- realPath += QLatin1String(".framework/Headers");
- }
- +
- + realPath = QDir{realPath}.canonicalPath();
- + if (!realPath.isEmpty() && !uniqueHeaderPaths.contains(realPath)) {
- + uniqueHeaderPaths.append(std::move(realPath));
- + }
- + }
- +
- + foreach (const QString& realPath, uniqueHeaderPaths) {
- completeIncludePath(realPath, suffixes);
- }
- --
- 2.20.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement