[clangd] Don't cancel requests based on "updates" with same content
authorSam McCall <sam.mccall@gmail.com>
Sat, 19 Dec 2020 00:55:26 +0000 (01:55 +0100)
committerSam McCall <sam.mccall@gmail.com>
Sat, 19 Dec 2020 01:03:40 +0000 (02:03 +0100)
commit2fced5a07b45ef527ac00a13e63bfca61e407ee3
tree562431b4e8b885c1713fb4ffd81344ce28232b60
parentffd982f7db58acf6653f987ca6411712feea25c3
[clangd] Don't cancel requests based on "updates" with same content

There's an unfortunate collision between two features:
 - we implicitly cancel certain requests when the file changes, to avoid
   the queue getting clogged building old revisions to service stale requests
 - we "reparse-if-needed" by synthesizing a file change, e.g. on didSave

We could explicitly mark these synthetic requests to avoid this, but
looking for changes in file content clutters our APIs less and is
arguably the correct thing to do in any case.

Fixes https://github.com/clangd/clangd/issues/620
clang-tools-extra/clangd/TUScheduler.cpp
clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp