[all-commits] [llvm/llvm-project] 79fbcb: [clangd] clangd --check: standalone diagnosis of c...

Sam McCall via All-commits all-commits at lists.llvm.org
Thu Oct 1 06:48:13 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 79fbcbff41734e3d07e6200d33c3e40732dfae6a
      https://github.com/llvm/llvm-project/commit/79fbcbff41734e3d07e6200d33c3e40732dfae6a
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2020-10-01 (Thu, 01 Oct 2020)

  Changed paths:
    A clang-tools-extra/clangd/test/check-fail.test
    A clang-tools-extra/clangd/test/check.test
    M clang-tools-extra/clangd/tool/CMakeLists.txt
    A clang-tools-extra/clangd/tool/Check.cpp
    M clang-tools-extra/clangd/tool/ClangdMain.cpp

  Log Message:
  -----------
  [clangd] clangd --check: standalone diagnosis of common problems

This is a tool to simply parse a file as clangd would, and run some
common features (code actions, go-to-definition, hover) in an attempt to
trigger or reproduce crashes, error diagnostics, etc.

This is easier and more predictable than loading the file in clangd, because:
 - there's no editor/plugin variation to worry about
 - there's no accidental variation of user behavior or other extraneous requests
 - we trigger features at every token, rather than guessing
 - everything is synchronoous, logs are easier to reason about
 - it's easier to (get users to) capture logs when running on the command-line

This is a fairly lightweight variant of this idea.
We could do a lot more with it, and maybe we should.
But I can't in the near future, and experience will tell us if we made
the right tradeoffs and if it's worth investing further.

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




More information about the All-commits mailing list