no \t to space line (#3177)

Co-authored-by: chenjieping <chenjieping@kezaihui.com>
This commit is contained in:
chensy
2023-04-29 16:35:04 +08:00
committed by GitHub
parent 3189ec7be6
commit c0f8a58ed7
2 changed files with 13 additions and 1 deletions

View File

@@ -171,7 +171,9 @@ func apiFormat(data string, skipCheckDeclare bool, filename ...string) (string,
tapCount++ tapCount++
} }
} }
util.WriteIndent(&builder, tapCount) if line != "" {
util.WriteIndent(&builder, tapCount)
}
builder.WriteString(line + pathx.NL) builder.WriteString(line + pathx.NL)
if strings.HasSuffix(noCommentLine, leftParenthesis) || strings.HasSuffix(noCommentLine, leftBrace) { if strings.HasSuffix(noCommentLine, leftParenthesis) || strings.HasSuffix(noCommentLine, leftBrace) {
tapCount++ tapCount++

View File

@@ -26,6 +26,11 @@ service A-api {
handler: GreetHandler handler: GreetHandler
) )
get /greet/from/:name(Request) returns (Response) get /greet/from/:name(Request) returns (Response)
@server(
handler: GreetHandler2
)
get /greet/from2/:name(Request) returns (Response)
} }
` `
@@ -41,6 +46,11 @@ service A-api {
handler: GreetHandler handler: GreetHandler
) )
get /greet/from/:name(Request) returns (Response) get /greet/from/:name(Request) returns (Response)
@server(
handler: GreetHandler2
)
get /greet/from2/:name(Request) returns (Response)
}` }`
) )