vscode-xml icon indicating copy to clipboard operation
vscode-xml copied to clipboard

Add support to keep manual line feeds

Open kedar-joshi opened this issue 6 years ago • 2 comments

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.

kedar-joshi avatar Jul 10 '18 11:07 kedar-joshi

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!

DotJoshJohnson avatar Sep 16 '18 02:09 DotJoshJohnson

sorry - need to find another extension

mko-x avatar Mar 27 '19 16:03 mko-x