[PATCH] D60605: [clangd] Revamp textDocument/onTypeFormatting.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 16 01:47:39 PDT 2019


sammccall updated this revision to Diff 195338.
sammccall added a comment.

Lots more test cases and better handling of braced blocks.

This turns out to be an interesting case:

  if (foo) {
  ^}

Really the right thing to do here is insert another newline.
Unfortuantely that means inserting text before and after the cursor, which
confuses tooling::Replacements so... lots of churn in this patch :-(


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60605/new/

https://reviews.llvm.org/D60605

Files:
  clangd/CMakeLists.txt
  clangd/ClangdLSPServer.cpp
  clangd/ClangdServer.cpp
  clangd/ClangdServer.h
  clangd/Format.cpp
  clangd/Format.h
  unittests/clangd/CMakeLists.txt
  unittests/clangd/FormatTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60605.195338.patch
Type: text/x-patch
Size: 26145 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190416/eb58c732/attachment-0001.bin>


More information about the cfe-commits mailing list