- This topic has 19 replies, 9 voices, and was last updated 19 years ago by Geoff.
-
AuthorPosts
-
batsonjayMemberHi —
I checked the FAQs, old message board postings, and the built-in help in Eclipse. But no answer to this. Hopefully, I didn’t miss some RTFM entry….
However, the only place I can see to do HTML file format clean up is Source->Cleanup Document, or Source->Format->Document/elements.
The formatting these functions do is … well, let’s just say “bad.” Everything is left justified, the only thing indented is wrapped tag lines (e.g. <a href…>), and it basically just stinks. What I want is something like what the JBoss IDE 4.1 does.
Am I looking in the wrong place? This is kind of a basic function to be missing, especially since the editor clearly knows just fine about how to do indenting when I’m entering code.
FYI, I’m running:
– MyEclipse 3.8.4
– OS X 10.3.8
– Editing .jsp pages, with <jsp:include> tags for shared page header content (if it makes a difference)Since I don’t visit here often, an email reply to batsonjay at mac dot com would be appreciated if you can take the moment to do so.
Thanks, and Cheers!
-jb
Riyad KallaMemberHowever, the only place I can see to do HTML file format clean up is Source->Cleanup Document, or Source->Format->Document/elements.
Correct
The formatting these functions do is … well, let’s just say “bad.”
We are not terribly fond of it either, we have TODO items filed to fix up the HTML formatter, they are just currently lower priority than some of the bigger-bill items comming down the pipeline. Additionally I wasn’t aware JBossIDE had formatting, we will take a look, thank you.
especially since the editor clearly knows just fine about how to do indenting when I’m entering code.
Two different editors, completely different functionalities.
knegarpetterMemberwhat i cant understand is that the formatting of xml and xsl etc work fine, regarding the indentation etc…
and what i really wonder is when this issue is going to be “fixed”
regards
P
Chase StephensMemberI have to agree about the JSP formatting. This isn’t really a low priority for those of us who develop Web-based J2EE apps. There is no way my employer is going to let me check in to our code repository JSP code that is formatted this poorly.
TomasWMemberIn my opinion the formatter is better than earlier versions, but the fact that it splits the address-tag in more than one line makes it useless for me.
For example:
<a href="...">linked text</a>
will be formatted into
<a href="..."> linked text </a>
This will cause some extra spaces between the start tag and the end tag. The web browser will include them in the linked text and the look is changed because of the HTML formatting (try to hover over the linked text).
Result (first space is ‘missing’ though, couldn’t simulate this here):
linked textI hope you understand what I’m trying to explain. Does anyone have a solution to this?
Riyad KallaMemberThomasW, I am all too farmiliar with the problem you are running into and have spent my fair share of time ripping my hair out because of this (some browsers render the space, other’s don’t). We tried to fix the formatter in the general case to give better formating for all tags, but that meant breaking Anchors across lines. I’ll file a bug immediately for us to look into this specific issue.
TomasWMember@support-rkalla wrote:
I’ll file a bug immediately for us to look into this specific issue.
Great, thanks!
Terry RoeMemberThere needs to be a way to let you specify you don’t want any space in a particular location. In the past, I used to use JSP comments (less than, percent, dash, dash) immediately after a tag and (dash, dash, percent, greater than) immediately before the next tag. This would allow me to format the code any way I wanted while still ensuring I got the spacing I wanted. The new formatter breaks this. It puts the comment tags on their own lines making them useless.
Here’s what I used to do:
<td height="20" width="20"> <img src="<c:url value="/html/images/menu_right.gif"/>"><%-- --%></td>
After using the formatter, it turns it into this:
<td height="20" width="20"> <img src="<c:url value="/html/images/menu_right.gif"/>"> <%-- --%> </td>
which of course defeats this little trick. Your formatter needs to take this into account, otherwise you’ll be chasing your tail trying to catch all the little bugs the new formatter has introduced.
TR
Terry RoeMemberI neglected to mention that I like the new formatting. It’s much nicer to work with and will be outstanding when these small gotchas are taken care of.
TR
Riyad KallaMemberTR,
Unfortunately we are not at the stage yet of fully taking on the formatter, we just know that it was 90% horrible before so we made some optimizations and fixes to it to make it 75%-80% good for the interm. I have filed your issue against future work that we have planned for all the formatters. In the mean time we appologize for the inconvenience, it’s very hard to catch all the use cases and not break someone’s setup unfortunately.
Terry RoeMembersupport-rkalla,
I understand the difficulty in getting the tool “all the way there”. However, in some cases the formatter is completely useless for me (and others) now; especially with the anchor tag. Any file that has an anchor tag, which in this world is nearly every file, will have to be hand formatted to remove the extra space before the closing tag. I love tools like the Java source formatter that I can just press Shift-Control-F just before I save a file and not have to think about any formatting issues. I hope that MyEclipse will get there some day.
What you really need is a code formatting page in setup just like the one for Java. One should be able to tell the formatter the rules to use rather than relying on MyEclipse to get it “right”. As far as the formatter goes right now, it’s either useless or just as much, or more, work than formatting by hand. It creates more work instead of reducing the work like a good tool should.
TR
Riyad KallaMemberI understand the difficulty in getting the tool “all the way there”. However, in some cases the formatter is completely useless for me (and others) now; especially with the anchor tag. Any file that has an anchor tag, which in this world is nearly every file, will have to be hand formatted to remove the extra space before the closing tag. I love tools like the Java source formatter that I can just press Shift-Control-F just before I save a file and not have to think about any formatting issues. I hope that MyEclipse will get there some day.
We agree, this was filed as a high priority item and is tenatively targetted for 4.1, but as always priorities might cause it get cut. I’ll push for it though as much as I can because it really does ruin the layout of pages.
What you really need is a code formatting page in setup just like the one for Java. One should be able to tell the formatter the rules to use rather than relying on MyEclipse to get it “right”. As far as the formatter goes right now, it’s either useless or just as much, or more, work than formatting by hand. It creates more work instead of reducing the work like a good tool should.
There is no argument here, the Java formatter in Eclipse is fantastic, but it is an undertaking on par with any other major feature and would require months of developer time to complete which is why it hasn’t been done already and why it’s a non-trivial item to assign to a team to complete especially for a smaller team like us. But like we’ve said in the past, we are a user-demand-driven company, so I will add all your comments to the issue we are tracking improved formatting with.
Terry RoeMemberOh no! I can’t believe this. The formatter used to wrap all lines at 72 columns regardless of what you set in preferences for the line width. Now the formatter completely ignores the setting in preferences and doesn’t wrap any text!!!
This will be my last comment here about the version 4.0.3 formatter. I’m reverting back to 4.0.2 because it is at least somewhat usable.
TR
Scott AndersonParticipantThat issue as well as formatting in general was addressed in 4.0.3. You can read the announcement here:
http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-9793.html
GeoffMemberI know bug reports are a drag, but I thought I better throw this out there as well.
First off this is with 4.0.3, on 3.1.1 (although these problems persisted before this). I am using Linux. I agree with the previous posts about the JSP/HTML editor. It has really had problems, and I apprieciate all your hard work on it. I think this editor issue is a really big problem, because when I try to show people how great the product is they look at the jsp/html editor and say no thanks.
In my mind high priority item:
after formatting — here is another example
<html>
<head>
<link rel=”stylesheet” type=”text/css” href=”/css/style.css”>
<style>
.titleBarLink {
padding-left: 5px;
padding-right: 5px;
position: relative;
float: right;
color: #ffffff;
font-size: 12px;
text-decoration: none;
}
.titleBarLink:hover {
color: #0000ff;
}
</style>As you can see, something is odd here. But the really problem is I have it set to use spaces not tabs and the elements of the titleBarLink are tabbed instead of spaced. So the editor actually displays this with all of those elements indented less than the .titleBar delclaration. Interesting that the one line entry shows the correct usage of spaces.
Hope this helps.
Lower priority bug:
The coloring of the text is always crazy on these html pages. For instance in the above text, some lines are all green, some lines are black and blue, and some lines are black blue and magenta.I hope this helps and I really look forward to fixes for this.
Thanks,
Geoff -
AuthorPosts