[all-commits] [llvm/llvm-project] 66a2e3: [clangd] Send EOF before resetting diagnostics con...

kadir çetinkaya via All-commits all-commits at lists.llvm.org
Thu Aug 13 09:33:59 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 66a2e3a525645ad8d356ef4f5b752bfcae3c27b7
      https://github.com/llvm/llvm-project/commit/66a2e3a525645ad8d356ef4f5b752bfcae3c27b7
  Author: Kadir Cetinkaya <kadircet at google.com>
  Date:   2020-08-13 (Thu, 13 Aug 2020)

  Changed paths:
    M clang-tools-extra/clangd/ParsedAST.cpp
    M clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp

  Log Message:
  -----------
  [clangd] Send EOF before resetting diagnostics consumer

Summary:
Some clang-tidy checkers, e.g. llvm-include-order can emit diagnostics
at this callback (as mentioned in the comments).

Clangd was resetting diag consumer to IgnoreDiags before sending EOF, hence we
were unable to emit diagnostics for such checkers.

This patch changes the order of that reset and preprocosser event to make sure
we emit that diag.

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

Reviewers: sammccall

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

Tags: #clang

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


  Commit: 0464acd0197cda149f81dff20bf5c379a057722a
      https://github.com/llvm/llvm-project/commit/0464acd0197cda149f81dff20bf5c379a057722a
  Author: Kadir Cetinkaya <kadircet at google.com>
  Date:   2020-08-13 (Thu, 13 Aug 2020)

  Changed paths:
    M clang-tools-extra/clangd/ClangdServer.cpp
    M clang-tools-extra/clangd/tool/ClangdMain.cpp
    M clang-tools-extra/clangd/unittests/ClangdTests.cpp

  Log Message:
  -----------
  [clangd] Move clang-tidy check modifications into ClangdServer

Summary:
This enables sharing the logic between standalone clangd and embedders
of it. The new approach should be same performance-wise, as it is only called
once per addDocument call.

This patch also introduces a blacklisting code path for disabling crashy or
high-noise tests, until we figure out a way to make them work with clangd-setup.

The biggest difference is the way we make use of preambles, hence those checks
can't see directives coming from the preamble section of the file. The second
thing is the fact that code might-not be compiling while clangd is trying to
build an AST, hence some checks might choke on those incomplete ASTs.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, aaron.ballman, cfe-commits

Tags: #clang

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


Compare: https://github.com/llvm/llvm-project/compare/44716856db59...0464acd0197c


More information about the All-commits mailing list