Skip to content

Commit 1fe2007

Browse files
committed
[clangd] fix formatting
1 parent 8fadd8d commit 1fe2007

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

clang-tools-extra/clangd/support/Markup.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,13 @@ bool looksLikeTag(llvm::StringRef Contents) {
6666
///
6767
/// **FIXME:** handle the case when the client does support HTML rendering in
6868
/// markdown. For this, the LSP server needs to check the
69-
/// [supportsHtml capability](https://github.com/microsoft/language-server-protocol/issues/1344)
69+
/// [supportsHtml
70+
/// capability](https://github.com/microsoft/language-server-protocol/issues/1344)
7071
/// of the client.
7172
///
7273
/// \param C The character to check.
73-
/// \param After The string that follows \p C . This is used to determine if \p C is
74-
/// part of a tag or an entity reference.
74+
/// \param After The string that follows \p C .
75+
// This is used to determine if \p C is part of a tag or an entity reference.
7576
/// \returns true if \p C should be escaped, false otherwise.
7677
bool needsLeadingEscape(char C, llvm::StringRef After) {
7778
switch (C) {
@@ -245,7 +246,8 @@ class CodeBlock : public Block {
245246
std::string indentLines(llvm::StringRef Input) {
246247
assert(!Input.ends_with("\n") && "Input should've been trimmed.");
247248
std::string IndentedR;
248-
// We'll add 2 spaces after each new line which is not followed by another new line.
249+
// We'll add 2 spaces after each new line which is not followed by another new
250+
// line.
249251
IndentedR.reserve(Input.size() + Input.count('\n') * 2);
250252
for (size_t I = 0; I < Input.size(); ++I) {
251253
char C = Input[I];
@@ -326,7 +328,7 @@ llvm::StringRef Paragraph::chooseMarker(llvm::ArrayRef<llvm::StringRef> Options,
326328
return Options.front();
327329
}
328330

329-
bool Paragraph::punctuationIndicatesLineBreak(llvm::StringRef Line) const{
331+
bool Paragraph::punctuationIndicatesLineBreak(llvm::StringRef Line) const {
330332
constexpr llvm::StringLiteral Punctuation = R"txt(.:,;!?)txt";
331333

332334
Line = Line.rtrim();
@@ -515,9 +517,7 @@ Paragraph &Document::addParagraph() {
515517
return *static_cast<Paragraph *>(Children.back().get());
516518
}
517519

518-
void Document::addRuler() {
519-
Children.push_back(std::make_unique<Ruler>());
520-
}
520+
void Document::addRuler() { Children.push_back(std::make_unique<Ruler>()); }
521521

522522
void Document::addCodeBlock(std::string Code, std::string Language) {
523523
Children.emplace_back(

clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,10 +1095,11 @@ TEST(CompletionTest, Documentation) {
10951095
10961096
int x = ^
10971097
)cpp");
1098-
EXPECT_THAT(Results.Completions,
1099-
Contains(AllOf(
1100-
named("foo"),
1101-
doc("Annotation: custom_annotation\n\nNon-doxygen comment."))));
1098+
EXPECT_THAT(
1099+
Results.Completions,
1100+
Contains(
1101+
AllOf(named("foo"),
1102+
doc("Annotation: custom_annotation\n\nNon-doxygen comment."))));
11021103
EXPECT_THAT(
11031104
Results.Completions,
11041105
Contains(AllOf(named("bar"), doc("Doxygen comment.\n\\param int a"))));

clang-tools-extra/clangd/unittests/HoverTests.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3847,7 +3847,6 @@ TEST(Hover, ParseDocumentation) {
38473847
"`not parsed`",
38483848
}};
38493849

3850-
//Case C = Cases[2];
38513850
for (const auto &C : Cases) {
38523851
markup::Document Output;
38533852
parseDocumentation(C.Documentation, Output);

clang-tools-extra/clangd/unittests/support/MarkupTests.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ TEST(Paragraph, SeparationOfChunks) {
187187
EXPECT_EQ(P.asPlainText(), "after foobar batno space text");
188188

189189
P.appendSpace().appendCode("code").appendText(".\n newline");
190-
EXPECT_EQ(P.asMarkdown(), "after `foobar` bat`no` `space` text `code`.\n newline");
190+
EXPECT_EQ(P.asMarkdown(),
191+
"after `foobar` bat`no` `space` text `code`.\n newline");
191192
EXPECT_EQ(P.asPlainText(), "after foobar batno space text code.\nnewline");
192193
}
193194

0 commit comments

Comments
 (0)