Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preference to align attributes to tag vs simply indent them #169

Closed
fbricon opened this issue Oct 19, 2018 · 2 comments
Closed

Add preference to align attributes to tag vs simply indent them #169

fbricon opened this issue Oct 19, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request formatting This issue or enhancement is related to formatting support
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented Oct 19, 2018

Following up on #100, currently when attributes are formatted 1 per line, they're aligned on the tag. Which can be fine in some case, but not to the taste of everybody. There should be a preference that allows to simply indent them instead (default Eclipse behaviour).
So for instance, with "xml.format.alignAttributesWithTag": true :

<xsl:stylesheet
               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
               xmlns:xs="http://www.w3.org/2001/XMLSchema"
               xmlns:math="http://www.w3.org/2005/xpath-functions/math"
               xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
               xmlns:emp="http://www.semanticalllc.com/ns/employees#"
               xmlns:h="http://www.w3.org/1999/xhtml"
               xmlns:fn="http://www.w3.org/2005/xpath-functions"
               xmlns:j="http://www.w3.org/2005/xpath-functions"
               exclude-result-prefixes="xs math xd h emp"
               version="2.0">

and with "xml.format.alignAttributesWithTag": false

<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:math="http://www.w3.org/2005/xpath-functions/math"
    xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
    xmlns:emp="http://www.semanticalllc.com/ns/employees#"
    xmlns:h="http://www.w3.org/1999/xhtml"
    xmlns:fn="http://www.w3.org/2005/xpath-functions"
    xmlns:j="http://www.w3.org/2005/xpath-functions"
    exclude-result-prefixes="xs math xd h emp" version="2.0">

I now think such preference should be set to false.

@fbricon fbricon added enhancement New feature or request formatting This issue or enhancement is related to formatting support labels Oct 19, 2018
@NikolasKomonen
Copy link
Contributor

NikolasKomonen commented Oct 19, 2018

@fbricon

Does this look fine after a format:

<?xml version="1.0" encoding="UTF-8"?>
<project
    xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.eclipse</groupId>
  <artifactId>lsp4xml</artifactId>
  <version>0.0.2-SNAPSHOT</version>
  <packaging></packaging>
</project>

@fbricon
Copy link
Contributor Author

fbricon commented Oct 19, 2018

Yes looks pretty good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request formatting This issue or enhancement is related to formatting support
Projects
None yet
Development

No branches or pull requests

2 participants