DotJoshJohnson / vscode-xml

XML Tools for Visual Studio Code
MIT License
325 stars 86 forks source link

Add support to keep manual line feeds #211

Open kedar-joshi opened 6 years ago

kedar-joshi commented 6 years ago

Description Currently there is only an on / off support for having XML attributes on new line i.e. either we can have all attributes on one line or each attribute on separate line. It will be really helpful to have an option to keep manually added line feeds between attributes, while reformatting.

This will achieve following -

<Resource name="jdbc/dt-smart" poolName="DT-Smart-Pool" auth="Container"
          factory="com.zaxxer.hikari.HikariJNDIFactory" type="javax.sql.DataSource" dataSourceClassName="org.postgresql.ds.PGSimpleDataSource" 
          dataSource.ApplicationName="DT-Smart" dataSource.serverName="localhost" dataSource.portNumber="5432"
          minimumIdle="1" maximumPoolSize="25">
</Resource>

instead of this -

<Resource name="jdbc/dt-smart" poolName="DT-Smart-Pool" auth="Container" factory="com.zaxxer.hikari.HikariJNDIFactory" type="javax.sql.DataSource" dataSourceClassName="org.postgresql.ds.PGSimpleDataSource" dataSource.ApplicationName="DT-Smart" dataSource.serverName="localhost" dataSource.portNumber="5432" minimumIdle="1" maximumPoolSize="25"></Resource>

or this -

<Resource name="jdbc/dt-smart" 
    poolName="DT-Smart-Pool" 
    auth="Container" 
    factory="com.zaxxer.hikari.HikariJNDIFactory" 
    type="javax.sql.DataSource" 
    dataSourceClassName="org.postgresql.ds.PGSimpleDataSource" 
    dataSource.ApplicationName="DT-Smart" 
    dataSource.serverName="localhost" 
    dataSource.portNumber="5432" 
    minimumIdle="1" 
    maximumPoolSize="25"></Resource>

Current Workarounds There are no workarounds currently other than disabling the entire formatting.

DotJoshJohnson commented 6 years ago

I unfortunately will not have the bandwidth to implement this in the near future. If anyone wants to try their hand at a PR, I'm happy to review and include it!

mko-x commented 5 years ago

sorry - need to find another extension