sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/Diagnostics.cpp:68
     return true;
   // Fixes are always in the main file.
   if (!D.Fixes.empty())
----------------
update comment: Fixes are only added if the fix or diagnostics is in the main 
file.


================
Comment at: clang-tools-extra/clangd/Diagnostics.cpp:705
 
   bool InsideMainFile = isInsideMainFile(Info);
   SourceManager &SM = Info.getSourceManager();
----------------
I think this can now be inlined to the one place it's used


================
Comment at: clang-tools-extra/clangd/Diagnostics.cpp:724
+    // No point in generating fixes, if the diagnostic is for a different file.
+    if (!LastDiag->InsideMainFile)
       return false;
----------------
Note that this may still miss some cases, e.g. if we had a diagnostic inside a 
template instantiation with a fix in the current file. tryMoveToMainFile has 
not been called yet, so LastDiag->InsideMainFile would be false.

I don't have a great idea about what to do about this, nor does it seem that 
important...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122315

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to