Layout of CSS/JavaScript inside ERB templates

Hello,

I've tested this on both Ubuntu 8.10AMD64 and OSX 10.5 running IDEA EAP
#9684

On both of these systems, the ruby plugin flubs the layout of both CSS
and javascript by getting the indentation totally wrong. For example,
this is how it thinks the following CSS sholud be laid out:


]]>
.slider {
margin-top: 0.3846em; /* 5px; */
*margin-top: 0.3753em;
margin-left: 0.3846em; /* 5px; */
*margin-left: 0.3753em;
}

.slider .count

.slider .applied .count {
border-style: inset;
width: .65em;
*width: 0.6343em;
}

.slider .slot

</style>


Is anybody else having this problem? The fact that I have not seen
anyone else complaining about this makes me think that I must have
something misconfigured somewhere, but if so what is it?

It's maddening because when it gets the formatting wrong, it affects
everything: from cut n' paste, to refactoring, to any advanced editing
move like duplicating a line, or pushing several lines up or down in
unison... they all reformat the affected text, and consequently they all
get it wrong.

4 comments
Comment actions Permalink

Hello Charles,

This is a known limitation of the current version. Inside ERb files, only
HTML content is formatted correctly.

This will be addressed in one of the future builds of RubyMine and the Ruby
plugin.

I've tested this on both Ubuntu 8.10AMD64 and OSX 10.5 running IDEA
EAP #9684

On both of these systems, the ruby plugin flubs the layout of both CSS
and javascript by getting the indentation totally wrong. For example,
this is how it thinks the following CSS sholud be laid out:

<style type="text/css">
.slider {
margin-top: 0.3846em; /* 5px; */
*margin-top: 0.3753em;
margin-left: 0.3846em; /* 5px; */
*margin-left: 0.3753em;
}
.slider .count {
width: 1em;
*width: .9759em;
background-color: #FAAF40;
border-bottom: 1px solid #F6921E;
margin-right: 0.3077em; /* 4px */
*margin-night: 0.3002em;
}
.slider .applied .count {
border-style: inset;
width: .65em;
*width: 0.6343em;
}
.slider .slot {
height: 3em;
*height: 2.9277em;
display: table-cell;
vertical-align: bottom;
}
</style>

Is anybody else having this problem? The fact that I have not seen
anyone else complaining about this makes me think that I must have
something misconfigured somewhere, but if so what is it?

It's maddening because when it gets the formatting wrong, it affects
everything: from cut n' paste, to refactoring, to any advanced editing
move like duplicating a line, or pushing several lines up or down in
unison... they all reformat the affected text, and consequently they
all get it wrong.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Dmitry,

Thanks for the update. At least I know now that I'm not crazy and/or
misconfigured. It's good to hear that you guys are on top of it.

cheers,
Charles


Dmitry Jemerov wrote:

Hello Charles,

This is a known limitation of the current version. Inside ERb files,
only HTML content is formatted correctly.

This will be addressed in one of the future builds of RubyMine and the
Ruby plugin.

>> I've tested this on both Ubuntu 8.10AMD64 and OSX 10.5 running IDEA
>> EAP #9684
>>
>> On both of these systems, the ruby plugin flubs the layout of both CSS
>> and javascript by getting the indentation totally wrong. For example,
>> this is how it thinks the following CSS sholud be laid out:
>>
>> >> .slider { >> margin-top: 0.3846em; /* 5px; */ >> *margin-top: 0.3753em; >> margin-left: 0.3846em; /* 5px; */ >> *margin-left: 0.3753em; >> } >> .slider .count { >> width: 1em; >> *width: .9759em; >> background-color: #FAAF40; >> border-bottom: 1px solid #F6921E; >> margin-right: 0.3077em; /* 4px */ >> *margin-night: 0.3002em; >> } >> .slider .applied .count { >> border-style: inset; >> width: .65em; >> *width: 0.6343em; >> } >> .slider .slot { >> height: 3em; >> *height: 2.9277em; >> display: table-cell; >> vertical-align: bottom; >> } >> >> >> Is anybody else having this problem? The fact that I have not seen >> anyone else complaining about this makes me think that I must have >> something misconfigured somewhere, but if so what is it? >> >> It's maddening because when it gets the formatting wrong, it affects >> everything: from cut n' paste, to refactoring, to any advanced editing >> move like duplicating a line, or pushing several lines up or down in >> unison... they all reformat the affected text, and consequently they >> all get it wrong. >>]]>

0
Comment actions Permalink

Dmitry Jemerov wrote:

Hello Charles,

This is a known limitation of the current version. Inside ERb files,
only HTML content is formatted correctly.

This will be addressed in one of the future builds of RubyMine and the
Ruby plugin.

>> I've tested this on both Ubuntu 8.10AMD64 and OSX 10.5 running IDEA
>> EAP #9684
>>
>> On both of these systems, the ruby plugin flubs the layout of both CSS
>> and javascript by getting the indentation totally wrong. For example,
>> this is how it thinks the following CSS sholud be laid out:
>>
>> >> .slider { >> margin-top: 0.3846em; /* 5px; */ >> *margin-top: 0.3753em; >> margin-left: 0.3846em; /* 5px; */ >> *margin-left: 0.3753em; >> } >> .slider .count { >> width: 1em; >> *width: .9759em; >> background-color: #FAAF40; >> border-bottom: 1px solid #F6921E; >> margin-right: 0.3077em; /* 4px */ >> *margin-night: 0.3002em; >> } >> .slider .applied .count { >> border-style: inset; >> width: .65em; >> *width: 0.6343em; >> } >> .slider .slot { >> height: 3em; >> *height: 2.9277em; >> display: table-cell; >> vertical-align: bottom; >> } >> >> >> Is anybody else having this problem? The fact that I have not seen >> anyone else complaining about this makes me think that I must have >> something misconfigured somewhere, but if so what is it? >> >> It's maddening because when it gets the formatting wrong, it affects >> everything: from cut n' paste, to refactoring, to any advanced editing >> move like duplicating a line, or pushing several lines up or down in >> unison... they all reformat the affected text, and consequently they >> all get it wrong. >>]]>

Dmitry,

Upon further inspection, it looks like even the HTML layout is not
correct, or is not using the same tabwidth and indent as all other HTML
files (Although I can't find the config setting that it's using anywhere)

If I reformat just the portion of the ERB file that has HTML in it,
visually it formats correctly, but alternates using spaces when it
should be using tabs.

the following is IDEA-formatted HTML outside ERB:

\t
\t\t
\t\t\t
Hello World!
\t\t \t ]]>


and in an erb template:

\s\s
\t
\t\s\s
Hello World!
\t \s\s ]]>


Is there a parameter somewhere that needs to be set?

cheers,
Charles

0
Comment actions Permalink

Is this bug going to be fixed before the 1.0 release of RubyMine?

I hate to sound impatient, but I deal with this bug constantly, for at
least 7 hours out of every day, and it is really starting to wear on me.
I'd rather have no refactorings than to be forced to manually manage the
layout of my code.

I can't imagine myself using another IDE for Java, and I can wait
another month or so if I can be sure that it'll make it in, but if not,
I'd just as soon start looking for a new ruby IDE sooner rather than later.

cheers,
Charles


Charles Lowell wrote:

Hello,

I've tested this on both Ubuntu 8.10AMD64 and OSX 10.5 running IDEA EAP
#9684

On both of these systems, the ruby plugin flubs the layout of both CSS
and javascript by getting the indentation totally wrong. For example,
this is how it thinks the following CSS sholud be laid out:


<style type="text/css">
.slider {
margin-top: 0.3846em; /* 5px; */
*margin-top: 0.3753em;
margin-left: 0.3846em; /* 5px; */
*margin-left: 0.3753em;
}

.slider .count {
width: 1em;
*width: .9759em;
background-color: #FAAF40;
border-bottom: 1px solid #F6921E;

margin-right: 0.3077em; /* 4px */
*margin-night: 0.3002em;
}

.slider .applied .count {
border-style: inset;
width: .65em;
*width: 0.6343em;
}

.slider .slot {
height: 3em;
*height: 2.9277em;
display: table-cell;
vertical-align: bottom;
}

</style>


Is anybody else having this problem? The fact that I have not seen
anyone else complaining about this makes me think that I must have
something misconfigured somewhere, but if so what is it?

It's maddening because when it gets the formatting wrong, it affects
everything: from cut n' paste, to refactoring, to any advanced editing
move like duplicating a line, or pushing several lines up or down in
unison... they all reformat the affected text, and consequently they all
get it wrong.

0

Please sign in to leave a comment.