HomePhabricator

[clangd] Run formatting operations asynchronously.

Authored by sammccall on Jun 26 2020, 3:57 AM.

Description

[clangd] Run formatting operations asynchronously.

Summary:
They don't need ASTs or anything, so they should still run immediately.

These were sync for historical reasons (they predate clangd having a pervasive
threading model). This worked ok as they were "cheap".
Aside for consistency, there are a couple of reasons to make them async:

  • they do IO (finding .clang-format) so aren't trivially cheap
  • having TUScheduler involved in running these tasks means we can use it as an injection point for configuration. (TUScheduler::run will need to learn about which file is being operated on, but that's an easy change).
  • adding the config system adds more potential IO, too

Reviewers: kbobyrev

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82642

Details

Committed
sammccallJun 30 2020, 3:52 PM
Differential Revision
D82642: [clangd] Run formatting operations asynchronously.
Parents
rGb210c9899bdd: [BasicAA] Replace -basicaa with -basic-aa in polly
Branches
Unknown
Tags
Unknown