[PATCH] D75716: [clangd] Have visibleNamespaces() and getEligiblePoints() take a LangOptions rather than a FormatStyle

2020-03-10 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast added a comment.

In D75716#1916032 , 
@hubert.reinterpretcast wrote:

> It looks like this is causing bot failures 
> (http://lab.llvm.org:8011/builders/clang-ppc64le-rhel/builds/1881/steps/build%20stage%201/logs/stdio):


Fix attempted in rG48121a5743b684def33d158391c5424626de28e2 
.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75716



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D75716: [clangd] Have visibleNamespaces() and getEligiblePoints() take a LangOptions rather than a FormatStyle

2020-03-10 Thread Nathan Ridge via Phabricator via cfe-commits
nridge added a comment.

In D75716#1916032 , 
@hubert.reinterpretcast wrote:

> It looks like this is causing bot failures 
> (http://lab.llvm.org:8011/builders/clang-ppc64le-rhel/builds/1881/steps/build%20stage%201/logs/stdio):


Sorry about that. Fix here: https://reviews.llvm.org/D75969


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75716



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D75716: [clangd] Have visibleNamespaces() and getEligiblePoints() take a LangOptions rather than a FormatStyle

2020-03-10 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast added a comment.

It looks like this is causing bot failures 
(http://lab.llvm.org:8011/builders/clang-ppc64le-rhel/builds/1881/steps/build%20stage%201/logs/stdio):

  : && /home/buildbots/clang.9.0.0/bin/clang++ 
--gcc-toolchain=/opt/rh/devtoolset-7/root/usr -fPIC -fPIC 
-fvisibility-inlines-hidden -Werror -Werror=date-time 
-Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter 
-Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic 
-Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default 
-Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor 
-Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections 
-fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3  -Wl,-z,defs 
-Wl,-z,nodelete   
-Wl,-rpath-link,/home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/./lib
  -Wl,-O3 -Wl,--gc-sections -shared -Wl,-soname,libclangDaemonTweaks.so.11git 
-o lib/libclangDaemonTweaks.so.11git 
tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/AnnotateHighlightings.cpp.o
 
tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/DumpAST.cpp.o
 
tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/DefineInline.cpp.o
 
tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/DefineOutline.cpp.o
 
tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ExpandAutoType.cpp.o
 
tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ExpandMacro.cpp.o
 
tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ExtractFunction.cpp.o
 
tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ExtractVariable.cpp.o
 
tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/ObjCLocalizeStringLiteral.cpp.o
 
tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/RawStringLiteral.cpp.o
 
tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/RemoveUsingNamespace.cpp.o
 
tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/SwapIfBranches.cpp.o
  -Wl,-rpath,"\$ORIGIN/../lib" lib/libclangAST.so.11git 
lib/libclangBasic.so.11git lib/libclangDaemon.so.11git lib/libclangLex.so.11git 
lib/libclangToolingCore.so.11git lib/libclangToolingRefactoring.so.11git 
lib/libclangToolingSyntax.so.11git lib/libLLVMSupport.so.11git && :
  
tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/DefineOutline.cpp.o:
 In function `clang::clangd::(anonymous 
namespace)::DefineOutline::apply(clang::clangd::Tweak::Selection const&)':
  
DefineOutline.cpp:(.text._ZN5clang6clangd12_GLOBAL__N_113DefineOutline5applyERKNS0_5Tweak9SelectionE+0x450):
 undefined reference to 
`clang::format::getFormattingLangOpts(clang::format::FormatStyle const&)'
  clang++: error: linker command failed with exit code 1 (use -v to see 
invocation)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75716



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D75716: [clangd] Have visibleNamespaces() and getEligiblePoints() take a LangOptions rather than a FormatStyle

2020-03-10 Thread Nathan Ridge via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG445195ba6cee: [clangd] Have visibleNamespaces() and 
getEligiblePoints() take a LangOptions… (authored by nridge).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75716

Files:
  clang-tools-extra/clangd/CodeComplete.cpp
  clang-tools-extra/clangd/SourceCode.cpp
  clang-tools-extra/clangd/SourceCode.h
  clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
  clang-tools-extra/clangd/unittests/SourceCodeTests.cpp

Index: clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
===
--- clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
+++ clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
@@ -416,7 +416,8 @@
   };
   for (const auto &Case : Cases) {
 EXPECT_EQ(Case.second,
-  visibleNamespaces(Case.first, format::getLLVMStyle()))
+  visibleNamespaces(Case.first, format::getFormattingLangOpts(
+format::getLLVMStyle(
 << Case.first;
   }
 }
@@ -639,8 +640,9 @@
   for (auto Case : Cases) {
 Annotations Test(Case.Code);
 
-auto Res = getEligiblePoints(Test.code(), Case.FullyQualifiedName,
- format::getLLVMStyle());
+auto Res = getEligiblePoints(
+Test.code(), Case.FullyQualifiedName,
+format::getFormattingLangOpts(format::getLLVMStyle()));
 EXPECT_THAT(Res.EligiblePoints, testing::ElementsAreArray(Test.points()))
 << Test.code();
 EXPECT_EQ(Res.EnclosingNamespace, Case.EnclosingNamespace) << Test.code();
Index: clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
===
--- clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
+++ clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
@@ -284,10 +284,10 @@
 // should also try to follow ordering of declarations. For example, if decls
 // come in order `foo, bar, baz` then this function should return some point
 // between foo and baz for inserting bar.
-llvm::Expected
-getInsertionPoint(llvm::StringRef Contents, llvm::StringRef QualifiedName,
-  const format::FormatStyle &Style) {
-  auto Region = getEligiblePoints(Contents, QualifiedName, Style);
+llvm::Expected getInsertionPoint(llvm::StringRef Contents,
+ llvm::StringRef QualifiedName,
+ const LangOptions &LangOpts) {
+  auto Region = getEligiblePoints(Contents, QualifiedName, LangOpts);
 
   assert(!Region.EligiblePoints.empty());
   // FIXME: This selection can be made smarter by looking at the definition
@@ -416,9 +416,10 @@
   return llvm::createStringError(Buffer.getError(),
  Buffer.getError().message());
 auto Contents = Buffer->get()->getBuffer();
-auto InsertionPoint =
-getInsertionPoint(Contents, Source->getQualifiedNameAsString(),
-  getFormatStyleForFile(*CCFile, Contents, &FS));
+auto LangOpts = format::getFormattingLangOpts(
+getFormatStyleForFile(*CCFile, Contents, &FS));
+auto InsertionPoint = getInsertionPoint(
+Contents, Source->getQualifiedNameAsString(), LangOpts);
 if (!InsertionPoint)
   return InsertionPoint.takeError();
 
Index: clang-tools-extra/clangd/SourceCode.h
===
--- clang-tools-extra/clangd/SourceCode.h
+++ clang-tools-extra/clangd/SourceCode.h
@@ -250,7 +250,7 @@
 ///
 /// visibleNamespaces are {"foo::", "", "a::", "b::", "foo::b::"}, not "a::b::".
 std::vector visibleNamespaces(llvm::StringRef Code,
-   const format::FormatStyle &Style);
+   const LangOptions &LangOpts);
 
 /// Represents locations that can accept a definition.
 struct EligibleRegion {
@@ -271,7 +271,7 @@
 /// \p FullyQualifiedName should not contain anonymous namespaces.
 EligibleRegion getEligiblePoints(llvm::StringRef Code,
  llvm::StringRef FullyQualifiedName,
- const format::FormatStyle &Style);
+ const LangOptions &LangOpts);
 
 struct DefinedMacro {
   llvm::StringRef Name;
Index: clang-tools-extra/clangd/SourceCode.cpp
===
--- clang-tools-extra/clangd/SourceCode.cpp
+++ clang-tools-extra/clangd/SourceCode.cpp
@@ -654,8 +654,7 @@
   Position Pos;
 };
 // Scans C++ source code for constructs that change the visible namespaces.
-void parseNamespaceEvents(llvm::StringRef Code,
-  const format::FormatStyle &Style,
+void parseNamespaceEvents(llvm::StringRef Code, const LangOptions &L

[PATCH] D75716: [clangd] Have visibleNamespaces() and getEligiblePoints() take a LangOptions rather than a FormatStyle

2020-03-10 Thread Nathan Ridge via Phabricator via cfe-commits
nridge updated this revision to Diff 249495.
nridge marked 6 inline comments as done.
nridge added a comment.

Address review comments


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75716

Files:
  clang-tools-extra/clangd/CodeComplete.cpp
  clang-tools-extra/clangd/SourceCode.cpp
  clang-tools-extra/clangd/SourceCode.h
  clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
  clang-tools-extra/clangd/unittests/SourceCodeTests.cpp

Index: clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
===
--- clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
+++ clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
@@ -416,7 +416,8 @@
   };
   for (const auto &Case : Cases) {
 EXPECT_EQ(Case.second,
-  visibleNamespaces(Case.first, format::getLLVMStyle()))
+  visibleNamespaces(Case.first, format::getFormattingLangOpts(
+format::getLLVMStyle(
 << Case.first;
   }
 }
@@ -639,8 +640,9 @@
   for (auto Case : Cases) {
 Annotations Test(Case.Code);
 
-auto Res = getEligiblePoints(Test.code(), Case.FullyQualifiedName,
- format::getLLVMStyle());
+auto Res = getEligiblePoints(
+Test.code(), Case.FullyQualifiedName,
+format::getFormattingLangOpts(format::getLLVMStyle()));
 EXPECT_THAT(Res.EligiblePoints, testing::ElementsAreArray(Test.points()))
 << Test.code();
 EXPECT_EQ(Res.EnclosingNamespace, Case.EnclosingNamespace) << Test.code();
Index: clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
===
--- clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
+++ clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
@@ -284,10 +284,10 @@
 // should also try to follow ordering of declarations. For example, if decls
 // come in order `foo, bar, baz` then this function should return some point
 // between foo and baz for inserting bar.
-llvm::Expected
-getInsertionPoint(llvm::StringRef Contents, llvm::StringRef QualifiedName,
-  const format::FormatStyle &Style) {
-  auto Region = getEligiblePoints(Contents, QualifiedName, Style);
+llvm::Expected getInsertionPoint(llvm::StringRef Contents,
+ llvm::StringRef QualifiedName,
+ const LangOptions &LangOpts) {
+  auto Region = getEligiblePoints(Contents, QualifiedName, LangOpts);
 
   assert(!Region.EligiblePoints.empty());
   // FIXME: This selection can be made smarter by looking at the definition
@@ -416,9 +416,10 @@
   return llvm::createStringError(Buffer.getError(),
  Buffer.getError().message());
 auto Contents = Buffer->get()->getBuffer();
-auto InsertionPoint =
-getInsertionPoint(Contents, Source->getQualifiedNameAsString(),
-  getFormatStyleForFile(*CCFile, Contents, &FS));
+auto LangOpts = format::getFormattingLangOpts(
+getFormatStyleForFile(*CCFile, Contents, &FS));
+auto InsertionPoint = getInsertionPoint(
+Contents, Source->getQualifiedNameAsString(), LangOpts);
 if (!InsertionPoint)
   return InsertionPoint.takeError();
 
Index: clang-tools-extra/clangd/SourceCode.h
===
--- clang-tools-extra/clangd/SourceCode.h
+++ clang-tools-extra/clangd/SourceCode.h
@@ -250,7 +250,7 @@
 ///
 /// visibleNamespaces are {"foo::", "", "a::", "b::", "foo::b::"}, not "a::b::".
 std::vector visibleNamespaces(llvm::StringRef Code,
-   const format::FormatStyle &Style);
+   const LangOptions &LangOpts);
 
 /// Represents locations that can accept a definition.
 struct EligibleRegion {
@@ -271,7 +271,7 @@
 /// \p FullyQualifiedName should not contain anonymous namespaces.
 EligibleRegion getEligiblePoints(llvm::StringRef Code,
  llvm::StringRef FullyQualifiedName,
- const format::FormatStyle &Style);
+ const LangOptions &LangOpts);
 
 struct DefinedMacro {
   llvm::StringRef Name;
Index: clang-tools-extra/clangd/SourceCode.cpp
===
--- clang-tools-extra/clangd/SourceCode.cpp
+++ clang-tools-extra/clangd/SourceCode.cpp
@@ -654,8 +654,7 @@
   Position Pos;
 };
 // Scans C++ source code for constructs that change the visible namespaces.
-void parseNamespaceEvents(llvm::StringRef Code,
-  const format::FormatStyle &Style,
+void parseNamespaceEvents(llvm::StringRef Code, const LangOptions &LangOpts,
   llvm::function_ref Callback) {
 
   

[PATCH] D75716: [clangd] Have visibleNamespaces() and getEligiblePoints() take a LangOptions rather than a FormatStyle

2020-03-05 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.

LGTM, thanks for doing this!




Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1378
 Scopes.AccessibleScopes =
-visibleNamespaces(Content.take_front(Offset), Style);
+visibleNamespaces(Content.take_front(Offset), LangOpts);
 for (std::string &S : Scopes.AccessibleScopes)

nit: please inline



Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1776
   semaCodeComplete(
-  std::make_unique(Options, Index, Result),
-  Options,
+  std::make_unique(Options, Index, Result), 
Options,
   {FileName, Command, Preamble, Contents, *Offset, std::move(VFS)});

nit: formatting change could you please revert ?



Comment at: clang-tools-extra/clangd/unittests/SourceCodeTests.cpp:219
+EXPECT_THAT_EXPECTED(
+positionToOffset(File, position(L.Number, L.Length + 1)),
+llvm::HasValue(L.Offset + L.Length));

nit: formatting change could you please revert ?



Comment at: clang-tools-extra/clangd/unittests/SourceCodeTests.cpp:455
 
-TEST(SourceCodeTests, IsInsideMainFile){
+TEST(SourceCodeTests, IsInsideMainFile) {
   TestTU TU;

nit: formatting change could you please revert ?



Comment at: clang-tools-extra/clangd/unittests/SourceCodeTests.cpp:474
   auto AST = TU.build();
-  const auto& SM = AST.getSourceManager();
+  const auto &SM = AST.getSourceManager();
   auto DeclLoc = [&AST](llvm::StringRef Name) {

nit: formatting change could you please revert ?



Comment at: clang-tools-extra/clangd/unittests/SourceCodeTests.cpp:574
   auto AST = TU.build();
-  const auto& SM = AST.getSourceManager();
+  const auto &SM = AST.getSourceManager();
 

nit: formatting change could you please revert ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75716



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D75716: [clangd] Have visibleNamespaces() and getEligiblePoints() take a LangOptions rather than a FormatStyle

2020-03-05 Thread Nathan Ridge via Phabricator via cfe-commits
nridge created this revision.
Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous, 
MaskRay, ilya-biryukov.
Herald added a project: clang.

These functions only use the FormatStyle to obtain a LangOptions via
format::getFormattingLangOpts(), and some callers can more easily obtain
a LangOptions more directly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75716

Files:
  clang-tools-extra/clangd/CodeComplete.cpp
  clang-tools-extra/clangd/SourceCode.cpp
  clang-tools-extra/clangd/SourceCode.h
  clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
  clang-tools-extra/clangd/unittests/SourceCodeTests.cpp

Index: clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
===
--- clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
+++ clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
@@ -215,8 +215,9 @@
 for (unsigned I = 0; I <= L.Length; ++I)
   EXPECT_THAT_EXPECTED(positionToOffset(File, position(L.Number, I)),
llvm::HasValue(L.Offset + I));
-EXPECT_THAT_EXPECTED(positionToOffset(File, position(L.Number, L.Length+1)),
- llvm::HasValue(L.Offset + L.Length));
+EXPECT_THAT_EXPECTED(
+positionToOffset(File, position(L.Number, L.Length + 1)),
+llvm::HasValue(L.Offset + L.Length));
 EXPECT_THAT_EXPECTED(
 positionToOffset(File, position(L.Number, L.Length + 1), false),
 llvm::Failed()); // out of range
@@ -413,9 +414,10 @@
   {""},
   },
   };
-  for (const auto& Case : Cases) {
+  for (const auto &Case : Cases) {
 EXPECT_EQ(Case.second,
-  visibleNamespaces(Case.first, format::getLLVMStyle()))
+  visibleNamespaces(Case.first, format::getFormattingLangOpts(
+format::getLLVMStyle(
 << Case.first;
   }
 }
@@ -450,7 +452,7 @@
   EXPECT_THAT(*Result, MacroName("MACRO"));
 }
 
-TEST(SourceCodeTests, IsInsideMainFile){
+TEST(SourceCodeTests, IsInsideMainFile) {
   TestTU TU;
   TU.HeaderCode = R"cpp(
 #define DEFINE_CLASS(X) class X {};
@@ -469,7 +471,7 @@
   TU.ExtraArgs.push_back("-DHeader=Header3");
   TU.ExtraArgs.push_back("-DMain=Main3");
   auto AST = TU.build();
-  const auto& SM = AST.getSourceManager();
+  const auto &SM = AST.getSourceManager();
   auto DeclLoc = [&AST](llvm::StringRef Name) {
 return findDecl(AST, Name).getLocation();
   };
@@ -569,7 +571,7 @@
   TU.AdditionalFiles["foo.inc"] = "int foo;\n";
   TU.AdditionalFiles["bar.inc"] = "int bar;\n";
   auto AST = TU.build();
-  const auto& SM = AST.getSourceManager();
+  const auto &SM = AST.getSourceManager();
 
   FileID Foo = SM.getFileID(findDecl(AST, "foo").getLocation());
   EXPECT_EQ(SM.getFileOffset(includeHashLoc(Foo, SM)),
@@ -633,8 +635,9 @@
   for (auto Case : Cases) {
 Annotations Test(Case.Code);
 
-auto Res = getEligiblePoints(Test.code(), Case.FullyQualifiedName,
- format::getLLVMStyle());
+auto Res = getEligiblePoints(
+Test.code(), Case.FullyQualifiedName,
+format::getFormattingLangOpts(format::getLLVMStyle()));
 EXPECT_THAT(Res.EligiblePoints, testing::ElementsAreArray(Test.points()))
 << Test.code();
 EXPECT_EQ(Res.EnclosingNamespace, Case.EnclosingNamespace) << Test.code();
Index: clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
===
--- clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
+++ clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
@@ -284,10 +284,10 @@
 // should also try to follow ordering of declarations. For example, if decls
 // come in order `foo, bar, baz` then this function should return some point
 // between foo and baz for inserting bar.
-llvm::Expected
-getInsertionPoint(llvm::StringRef Contents, llvm::StringRef QualifiedName,
-  const format::FormatStyle &Style) {
-  auto Region = getEligiblePoints(Contents, QualifiedName, Style);
+llvm::Expected getInsertionPoint(llvm::StringRef Contents,
+ llvm::StringRef QualifiedName,
+ const LangOptions &LangOpts) {
+  auto Region = getEligiblePoints(Contents, QualifiedName, LangOpts);
 
   assert(!Region.EligiblePoints.empty());
   // FIXME: This selection can be made smarter by looking at the definition
@@ -416,9 +416,10 @@
   return llvm::createStringError(Buffer.getError(),
  Buffer.getError().message());
 auto Contents = Buffer->get()->getBuffer();
-auto InsertionPoint =
-getInsertionPoint(Contents, Source->getQualifiedNameAsString(),
-  getFormatStyleForFile(*CCFile, Contents, &FS));
+auto LangOpts = format::getFormattingLangOpts(
+getFormatStyleForFile(*CCFile, Contents, &FS