Skip to content

Commit e027897

Browse files
committed
for other platform replace \r\n to \n
1 parent 753e4f3 commit e027897

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

EmmyLua.LanguageServer/EmmyLua.LanguageServer.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<PropertyGroup Condition="'$(Configuration)'=='Release'">
1919
<!-- 发布配置:不生成PDB文件 -->
2020
<DebugType>none</DebugType>
21+
<DebugSymbols>false</DebugSymbols>
2122
</PropertyGroup>
2223

2324
<ItemGroup>

EmmyLua.LanguageServer/Formatting/FormattingHandler.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ public class FormattingHandler(ServerContext context) : DocumentFormattingHandle
2727
var formattedCode = Builder.Format(semanticModel.Document.Text, filePath);
2828
if (formattedCode.Length > 0)
2929
{
30+
if (!context.IsVscode)
31+
{
32+
formattedCode = formattedCode.Replace("\r\n", "\n");
33+
}
34+
3035
response = new DocumentFormattingResponse(new TextEdit()
3136
{
3237
Range = new DocumentRange(
@@ -63,6 +68,11 @@ public class FormattingHandler(ServerContext context) : DocumentFormattingHandle
6368

6469
if (formattedCode.Length > 0)
6570
{
71+
if (!context.IsVscode)
72+
{
73+
formattedCode = formattedCode.Replace("\r\n", "\n");
74+
}
75+
6676
response = new DocumentFormattingResponse(new TextEdit()
6777
{
6878
Range = new DocumentRange(

0 commit comments

Comments
 (0)