Skip to content

Commit cd4708e

Browse files
committed
修复typeformat在特定情况下得bug
1 parent ec0311b commit cd4708e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CodeService/src/FormatElement/RangeFormatContext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ void RangeFormatContext::Print(std::string_view text, TextRange range)
2929
auto& indentState = _indentStack.back();
3030
if (indentState.Style == IndentStyle::Space)
3131
{
32-
if (_characterCount < indentState.SpaceIndent)
32+
if (_characterCount == 0)
3333
{
34-
PrintIndent(indentState.SpaceIndent - _characterCount, indentState.Style);
34+
PrintIndent(indentState.SpaceIndent, indentState.Style);
3535
}
3636
}
3737
else

CodeService/src/TypeFormat/LuaTypeFormat.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ void LuaTypeFormat::AnalysisReturn(int line, int character)
8585
{
8686
FormatLine(line);
8787
}
88-
89-
9088
}
9189

9290
void LuaTypeFormat::CompleteMissToken(int line, int character, LuaError& luaError)

resources/lua_dict.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,6 @@ formatter
219219
env
220220
math
221221
suc
222+
const
223+
param
224+
params

0 commit comments

Comments
 (0)