Skip to content

Commit ce7e6b1

Browse files
Rename again to "replace_with_newline" for consistency with other settings/options
1 parent a4fb82c commit ce7e6b1

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

CodeFormatCore/include/CodeFormatCore/Config/LuaStyleEnum.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ enum class AlignChainExpr {
8787

8888
enum class EndStmtWithSemicolon {
8989
Keep,
90-
ReplaceWithLinebreak,
90+
ReplaceWithNewline,
9191
Always,
9292
SameLine
9393
};

CodeFormatCore/src/Config/LuaStyle.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ void LuaStyle::Parse(std::map<std::string, std::string, std::less<>> &configMap)
293293
end_statement_with_semicolon = EndStmtWithSemicolon::Keep;
294294
} else if (configMap.at("end_statement_with_semicolon") == "always") {
295295
end_statement_with_semicolon = EndStmtWithSemicolon::Always;
296-
} else if (configMap.at("end_statement_with_semicolon") == "replace_with_linebreak") {
297-
end_statement_with_semicolon = EndStmtWithSemicolon::ReplaceWithLinebreak;
296+
} else if (configMap.at("end_statement_with_semicolon") == "replace_with_newline") {
297+
end_statement_with_semicolon = EndStmtWithSemicolon::ReplaceWithNewline;
298298
} else if (configMap.at("end_statement_with_semicolon") == "same_line") {
299299
end_statement_with_semicolon = EndStmtWithSemicolon::SameLine;
300300
}

CodeFormatCore/src/Diagnostic/CodeStyle/CodeStyleChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void CodeStyleChecker::BasicResolve(LuaSyntaxNode syntaxNode, const LuaSyntaxTre
9696
}
9797
case TokenStrategy::StmtEndSemicolon: {
9898
switch (d.GetState().GetStyle().end_statement_with_semicolon) {
99-
case EndStmtWithSemicolon::ReplaceWithLinebreak: {
99+
case EndStmtWithSemicolon::ReplaceWithNewline: {
100100
d.PushDiagnostic(DiagnosticType::Semicolon, textRange,
101101
LText("expected statement not to end with ;"));
102102
break;

CodeFormatCore/src/Format/Analyzer/SemicolonAnalyzer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void SemicolonAnalyzer::Analyze(FormatState &f, const LuaSyntaxTree &t) {
2525
}
2626
break;
2727
}
28-
case EndStmtWithSemicolon::ReplaceWithLinebreak: {
28+
case EndStmtWithSemicolon::ReplaceWithNewline: {
2929
// no action needed when there's no semicolons at all!
3030
if (ContainsSemicolon(syntaxNode, t)) {
3131
if (EndsWithSemicolon(syntaxNode, t)) {

Test/src/FormatStyle_unitest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,7 @@ local table1 = { 1, 2, 3 };
16211621
)",
16221622
style));
16231623

1624-
style.end_statement_with_semicolon = EndStmtWithSemicolon::ReplaceWithLinebreak;
1624+
style.end_statement_with_semicolon = EndStmtWithSemicolon::ReplaceWithNewline;
16251625
EXPECT_TRUE(TestHelper::TestFormatted(
16261626
R"(
16271627
local func = testFunc; print(type(nil)); -- nil;

docs/format_config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,5 +538,5 @@ end_statement_with_semicolon
538538
每条语句都应该以分号结束,缺失的分号将被添加。
539539
- same_line
540540
单行中的多个语句可以用必要的分号分隔,但可选的分号将被移除
541-
- replace_with_linebreak
541+
- replace_with_newline
542542
任何语句都不能以分号结束,语句末尾的所有分号都将被移除,包含多个语句的行将被分隔成多行

docs/format_config_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,5 +535,5 @@ The possible values are:
535535
every statement should end with semicolon, missing semicolons will be added
536536
- same_line
537537
multiple statements in a single line may be separated by necessary semicolons, but optional semicolons will be removed
538-
- replace_with_linebreak
538+
- replace_with_newline
539539
no statement should end with semicolon, all semicolons at the end of statements will be removed, lines with multiple statements will be separated into multiple lines

0 commit comments

Comments
 (0)