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

Formatter surrounds single-quoted attributes with double-quotes #263

Closed
fbricon opened this issue Dec 12, 2018 · 2 comments
Closed

Formatter surrounds single-quoted attributes with double-quotes #263

fbricon opened this issue Dec 12, 2018 · 2 comments
Assignees
Labels
bug Something isn't working formatting This issue or enhancement is related to formatting support
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented Dec 12, 2018

Formatting this

<?xml version='1.0' encoding='UTF-8'?>
<?compositeMetadataRepository version='1.0.0'?>
<repository name='m2e-apt updates' type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
<properties size='2'>
<property name='p2.compressed' value='true'/>
<property name='p2.timestamp' value='1328709112213'/>
</properties>
<children size='9'>
<child location='http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.5.1-2018-11-16_19-54-26-H16/' />
<child location='http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.5.0-2018-08-14_20-24-39-H12/' />
<child location='http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.4.0-2018-01-12_16-25-02-H6/' />
<child location='http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.3.0-2016-10-26_18-05-00-B50/' />
<child location='http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.2.0-2016-01-25_16-03-44-H45/' />
<child location='http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.1.1-2014-11-26_15-11-10-H37/' />
<child location='http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.1.0-2014-05-21_05-04-36-H34/' />
<child location='http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.0.1-2012-09-20_03-20-41-H23/'/>
<child location='http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.0.0-2012-06-05_16-15-59-H16/'/>
</children>
</repository>

yields:

<?xml version="1.0" encoding="UTF-8"?>
<?compositeMetadataRepository version='1.0.0' ?>
<repository name="'m2e-apt updates'" type="'org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository'" version="'1.0.0'">
    <properties size="'2'">
        <property name="'p2.compressed'" value="'true'" />
        <property name="'p2.timestamp'" value="'1328709112213'" />
    </properties>
    <children size="'9'">
        <child location="'http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.5.1-2018-11-16_19-54-26-H16/'" />
        <child location="'http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.5.0-2018-08-14_20-24-39-H12/'" />
        <child location="'http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.4.0-2018-01-12_16-25-02-H6/'" />
        <child location="'http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.3.0-2016-10-26_18-05-00-B50/'" />
        <child location="'http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.2.0-2016-01-25_16-03-44-H45/'" />
        <child location="'http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.1.1-2014-11-26_15-11-10-H37/'" />
        <child location="'http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.1.0-2014-05-21_05-04-36-H34/'" />
        <child location="'http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.0.1-2012-09-20_03-20-41-H23/'" />
        <child location="'http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/1.0.0-2012-06-05_16-15-59-H16/'" />
    </children>
</repository>

single quotes should be either ignored/reused or replaced

@fbricon fbricon added bug Something isn't working formatting This issue or enhancement is related to formatting support labels Dec 12, 2018
@NikolasKomonen
Copy link
Contributor

@fbricon
How should formatting behave with a mix of single and double quotes,
should we preserve the type of quotation for each value?

And maybe this calls for a preference to determine which type of quotation.

@angelozerr
Copy link
Contributor

@NikolasKomonen I think we should store the field boolean useDoubleQuote in DOMAttr class (set by scanner). After the formatter could use it and we will able to manage mix of single and double quotes.

@fbricon fbricon added this to the v0.0.4 milestone Dec 17, 2018
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jan 30, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jan 30, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jan 30, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jan 31, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Jan 31, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Feb 6, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Feb 21, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Feb 21, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Feb 25, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Feb 26, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Feb 26, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Feb 27, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Feb 27, 2019
NikolasKomonen added a commit that referenced this issue Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working formatting This issue or enhancement is related to formatting support
Projects
None yet
Development

No branches or pull requests

3 participants