[all-commits] [llvm/llvm-project] 8b88ff: [clangd] Add option to use dirty file contents whe...

Nathan James via All-commits all-commits at lists.llvm.org
Mon Jan 17 02:55:54 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8b88ff08038c5525bdb5d22b050550ca3b34ad77
      https://github.com/llvm/llvm-project/commit/8b88ff08038c5525bdb5d22b050550ca3b34ad77
  Author: Nathan James <n.james93 at hotmail.co.uk>
  Date:   2022-01-17 (Mon, 17 Jan 2022)

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

  Log Message:
  -----------
  [clangd] Add option to use dirty file contents when building preambles.

Adds a option `use-dirty-preambles` to enable using unsaved in editor contents when building pre-ambles.
This enables a more seamless user experience when switching between header and implementation files and forgetting to save inbetween.
It's also in line with the LSP spec that states open files in the editor should be used instead of on the contents on disk - https://microsoft.github.io/language-server-protocol/overviews/lsp/overview/
For now the option is defaulted to off and hidden, Though I have a feeling it should be moved into the `.clangd` config and possibly defaulted to true.

Addresses https://github.com/clangd/clangd/issues/488

Reviewed By: sammccall

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




More information about the All-commits mailing list