Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Format javascript source code before save
Format javascript source code before save [message #226221] Thu, 08 January 2009 19:41 Go to next message
zubin Missing name is currently offline zubin Missing name
Messages: 32
Registered: July 2009
Member
How can I format javascript code automatic when I saving the file.

I go to preferences page ->JavaScript->Editor->save Actions, and checked
the "perform the selected actions on save" and "format source code"
checkboxes.

Ctrl+shift+f shortcut key for code formatting works, but saving the file,
the javascript code never formatted. Is this a bug of JSDT? or did I miss
something?

I am using JSDT and eclipse 3.4

Thanks,
Re: Format javascript source code before save [message #226230 is a reply to message #226221] Thu, 08 January 2009 19:56 Go to previous messageGo to next message
zubin Missing name is currently offline zubin Missing name
Messages: 32
Registered: July 2009
Member
I meant if I messed the codes out and then save them. The code won't be
reformatted, those codes will be left the way it is. But If I do
ctrl+shift+f to do code format, the source code will be reformatted.
Re: Format javascript source code before save [message #226237 is a reply to message #226230] Thu, 08 January 2009 20:16 Go to previous messageGo to next message
Eclipse User
Originally posted by: dcarver.starstandard.org

zubin wrote:
> I meant if I messed the codes out and then save them. The code won't be
> reformatted, those codes will be left the way it is. But If I do
> ctrl+shift+f to do code format, the source code will be reformatted.
>
Rubin, you need to set your save actions if you want it to format when
saving. To do this, got your preferences.

Windows->Preferences->JavaScript->Editor->Save Actions

Select the Perform selected action on Save, and then select Format.

That should get you going.

Dave
Re: Format javascript source code before save [message #226243 is a reply to message #226237] Thu, 08 January 2009 20:42 Go to previous messageGo to next message
zubin Missing name is currently offline zubin Missing name
Messages: 32
Registered: July 2009
Member
Dave
Thanks for quick reply on this. I have marked both Perform selected action
on Save and format on my machine. But they are still doesn't work.

I am using eclipse 3.4 and JSDT 1.0

If it is working on your pc. Would you tell me which version of eclipse
that you are using?

Thanks,
Zubin
Re: Format javascript source code before save [message #226262 is a reply to message #226243] Thu, 08 January 2009 21:35 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2265
Registered: July 2009
Senior Member
zubin wrote:
> Dave
> Thanks for quick reply on this. I have marked both Perform selected
> action on Save and format on my machine. But they are still doesn't work.
>
> I am using eclipse 3.4 and JSDT 1.0
>
> If it is working on your pc. Would you tell me which version of eclipse
> that you are using?
>
It very much sounds like a bug. Please report it at
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=WTP%20So urce%20Editing&component=wst.jsdt
..

--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Format javascript source code before save [message #226268 is a reply to message #226262] Thu, 08 January 2009 22:43 Go to previous message
zubin Missing name is currently offline zubin Missing name
Messages: 32
Registered: July 2009
Member
Filed a bug.

here is the link: https://bugs.eclipse.org/bugs/show_bug.cgi?id=260463
Previous Topic:JPA, using it, and XML mappings.
Next Topic:Adding an item to Design View's context menu via extension point?
Goto Forum:
  


Current Time: Tue Sep 16 11:33:31 GMT 2014

Powered by FUDForum. Page generated in 0.02189 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software