[clangd] Canonicalize compile flags before applying edits
authorKadir Cetinkaya <kadircet@google.com>
Thu, 22 Jul 2021 07:35:23 +0000 (09:35 +0200)
committerKadir Cetinkaya <kadircet@google.com>
Fri, 23 Jul 2021 15:15:06 +0000 (17:15 +0200)
commit7cc8a8e3849dc4044cc799e2c1f6cc241b851b70
treec7d472329ea5170caff5b7a53d1b1e6d109b8246
parent1c0d0085bcaaf27cc8d9492eb3c5c05058e54b8e
[clangd] Canonicalize compile flags before applying edits

Pushes input for the compile action to the end while separating with a
`--` before applying other manglings. This ensures edits that effect only the
arguments that come after them works, like changing parse language via -x.

Fixes https://github.com/clangd/clangd/issues/555.

Differential Revision: https://reviews.llvm.org/D106527
clang-tools-extra/clangd/CompileCommands.cpp
clang-tools-extra/clangd/test/did-change-configuration-params.test
clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp