SHARE
TWEET

Untitled

a guest Jul 18th, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. From f52618b086f02a87ccaed124c00a2767a3bfbef1 Mon Sep 17 00:00:00 2001
  2. From: DanielChabrowski <dantezstudio@gmail.com>
  3. Date: Wed, 3 Jul 2019 01:56:49 +0200
  4. Subject: [PATCH] CppTools: Follow symlinks for include completion
  5.  
  6. ---
  7.  .../clangcodemodel/clangcompletionassistprocessor.cpp    | 9 +++++++++
  8.  1 file changed, 9 insertions(+)
  9.  
  10. diff --git a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp
  11. index 6f1397c487..c14277e8f1 100644
  12. --- a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp
  13. +++ b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp
  14. @@ -476,6 +476,7 @@ bool ClangCompletionAssistProcessor::completeInclude(const QTextCursor &cursor)
  15.      const ::Utils::MimeType mimeType = ::Utils::mimeTypeForName("text/x-c++hdr");
  16.      const QStringList suffixes = mimeType.suffixes();
  17.  
  18. +    QStringList uniqueHeaderPaths;
  19.      foreach (const ProjectExplorer::HeaderPath &headerPath, headerPaths) {
  20.          QString realPath = headerPath.path;
  21.          if (!directoryPrefix.isEmpty()) {
  22. @@ -484,6 +485,14 @@ bool ClangCompletionAssistProcessor::completeInclude(const QTextCursor &cursor)
  23.              if (headerPath.type == ProjectExplorer::HeaderPathType::Framework)
  24.                  realPath += QLatin1String(".framework/Headers");
  25.          }
  26. +
  27. +        realPath = QDir{realPath}.canonicalPath();
  28. +        if (!realPath.isEmpty() && !uniqueHeaderPaths.contains(realPath)) {
  29. +            uniqueHeaderPaths.append(std::move(realPath));
  30. +        }
  31. +    }
  32. +
  33. +    foreach (const QString& realPath, uniqueHeaderPaths) {
  34.          completeIncludePath(realPath, suffixes);
  35.      }
  36.  
  37. --
  38. 2.20.1
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top