qjebbs / vscode-plantuml

Rich PlantUML support for Visual Studio Code.
MIT License
1.1k stars 160 forks source link

Code formatting still breaks indentation #539

Open domiq44 opened 1 year ago

domiq44 commented 1 year ago

Hello,

I use extension version 2.17.5 and I'm having trouble with the code formatter.

@startuml Hello World

hide footbox
title Oauth 2.0 Abstract protocol flow
autonumber
actor user as "resource owner (user)"
box "token stays secure" #FAFAFA
    participant client as "client (application)"
    participant authorization as "authorization server"
    database resource as "resource server"
end box

group user authorizes client
    client -> user : request authorization
    note left
        **grant types**:
        # authorization code
        # implicit
        # password
        # client_credentials
    end note
    user --> client : authorization grant
end group

group token is generated
    client -> authorization : request token\npresent authorization grant
    authorization --> client :var:  access token
    note left
        **response types**:
        # code
        # token
    end note
end group

group resource can be accessed
    client -> resource : request resource\npresent token
    resource --> client : resource
end group

@enduml

...it gets reformatted to this when "Format Document"...

@startuml Hello World

hide footbox
title Oauth 2.0 Abstract protocol flow
autonumber
actor user as "resource owner (user)"
box "token stays secure" #FAFAFA
participant client as "client (application)"
participant authorization as "authorization server"
database resource as "resource server"
end box

group user authorizes client
    client -> user : request authorization
    note left
        **grant types**:
        # authorization code
        # implicit
        # password
        # client_credentials
    end note
    user --> client : authorization grant
    end group

    group token is generated
        client -> authorization : request token\npresent authorization grant
        authorization --> client :var:  access token
        note left
            **response types**:
            # code
            # token
        end note
        end group

        group resource can be accessed
            client -> resource : request resource\npresent token
            resource --> client : resource
            end group

            @enduml
muteboy commented 1 year ago

Yes, I get this too. Nested groups just increase the indentation, without decreasing it with "end group".