[PATCH] D128821: [clangd][ObjC] Fix ObjC method definition completion

David Goldman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 29 12:58:40 PDT 2022


dgoldman added inline comments.


================
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:866
     case CodeCompletionResult::RK_Pattern:
-      return Result.Pattern->getTypedText();
+      CCS = Result.Pattern;
+      break;
----------------
sammccall wrote:
> weirdly, codeCompletionString(Result) looks like it would mutate Result and then return a pattern with the same chunks (but different extra fields). So not affect the result of this function, but possibly others as a side-effect.
> 
> (e.g. add BriefComment and ParentName in the case that there's a pattern + declaration, as there is here)
> 
> What you have is fine, but if you feel like digging deeper codeCompletionString(Result) may be either better or worse here!
Hmm from what I can tell, it appears those are unused by clangd, but for posterity I can swap it over


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128821/new/

https://reviews.llvm.org/D128821



More information about the cfe-commits mailing list