[all-commits] [llvm/llvm-project] 2fced5: [clangd] Don't cancel requests based on "updates" ...

Sam McCall via All-commits all-commits at lists.llvm.org
Fri Dec 18 17:03:58 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2fced5a07b45ef527ac00a13e63bfca61e407ee3
      https://github.com/llvm/llvm-project/commit/2fced5a07b45ef527ac00a13e63bfca61e407ee3
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M clang-tools-extra/clangd/TUScheduler.cpp
    M clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list