[PATCH] D103476: [clangd] TUScheduler uses last active file for file-less queries

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 2 11:08:59 PDT 2021


sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

Thanks, and sorry for the long journey to get here :-)



================
Comment at: clang-tools-extra/clangd/TUScheduler.cpp:1542
                                    Semaphore &Sem) {
+  if (!Path.empty())
+    LastActiveFile = Path.str();
----------------
this works, but for some reason my brain finds this both cuter and easier to parse
```
if (Path.empty())
  Path = LastActiveFile;
else
  LastActiveFile = Path.str();
// and capture Path as before
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103476



More information about the cfe-commits mailing list