This is an archive of the discontinued LLVM Phabricator instance.

[clangd] TUScheduler uses last active file for file-less queries
ClosedPublic

Authored by kadircet on Jun 1 2021, 11:10 AM.

Details

Summary

This enables requests like workspaceSymbols to be dispatched using the
file user was most recently operating on. A replacement for D103179.

Diff Detail

Event Timeline

kadircet created this revision.Jun 1 2021, 11:10 AM
kadircet requested review of this revision.Jun 1 2021, 11:10 AM
sammccall accepted this revision.Jun 2 2021, 11:08 AM

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

clang-tools-extra/clangd/TUScheduler.cpp
1542

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
This revision is now accepted and ready to land.Jun 2 2021, 11:08 AM
kadircet updated this revision to Diff 349366.Jun 2 2021, 1:52 PM
kadircet marked an inline comment as done.

Keep using Path in runWithSemaphore, by substituting LastActiveFile when empty.

This revision was landed with ongoing or failed builds.Jun 2 2021, 1:57 PM
This revision was automatically updated to reflect the committed changes.