Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Converting /* .. */ to // comments?
Converting /* .. */ to // comments? [message #165581] Wed, 23 June 2004 08:00 Go to next message
Eclipse UserFriend
Originally posted by: crafterm.managesoft.com

Hi All,

Hope all is going well.

Is it possible to convert comment styles in Eclipse? What i'd like to be
able to do is convert /* ... */ comments to // commands via a menu
entry, something like right click over a comment block that looks
something like:

/*
* some comment block inside a method
*/

select some menu entry like 'Convert to // Comment' or similar so that
the result looks like:

//
// some comment block inside a method
//

Does something like this already exist inside Eclipse? (or via an
external plugin)

Any thoughts/ideas?

Cheers,

Marcus


--
.....
,,$$$$$$$$$, Marcus Crafter
;$' '$$$$: Computer Systems Engineer
$: $$$$: ManageSoft Corporation
$ o_)$$$: Frankfurt am Main, Germany
;$, _/\ &&:'
' /( &&&
\_&&&&'
&&&&.
&&&&&&&:
Re: Converting /* .. */ to // comments? [message #165615 is a reply to message #165581] Wed, 23 June 2004 11:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: newsserver_mails.bodden.de

Marcus Crafter wrote:

> Hi All,
>
> Hope all is going well.
>
> Is it possible to convert comment styles in Eclipse? What i'd like to be
> able to do is convert /* ... */ comments to // commands via a menu
> entry, something like right click over a comment block that looks
> something like:
>
> /*
> * some comment block inside a method
> */
>
> select some menu entry like 'Convert to // Comment' or similar so that
> the result looks like:
>
> //
> // some comment block inside a method
> //

No, such a feature does not exist. I guess most people would find it
quite useless. Also it could break your code. Just consider the following:

/*
* comment
*/ not commented code;

would become

//
// comment
// commented code; !!!

Eric

--
Eric Bodden
ICQ UIN: 12656220
Website: http://www.bodden.de
GPG: BB465582
Re: Converting /* .. */ to // comments? [message #165639 is a reply to message #165615] Wed, 23 June 2004 13:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: shazbotus.gmail.com

Eric Bodden wrote:

> Marcus Crafter wrote:

> > Hi All,
> >
> > Hope all is going well.
> >
> > Is it possible to convert comment styles in Eclipse? What i'd like to be
> > able to do is convert /* ... */ comments to // commands via a menu
> > entry, something like right click over a comment block that looks
> > something like:
> >
> > /*
> > * some comment block inside a method
> > */
> >
> > select some menu entry like 'Convert to // Comment' or similar so that
> > the result looks like:
> >
> > //
> > // some comment block inside a method
> > //

> No, such a feature does not exist. I guess most people would find it
> quite useless. Also it could break your code. Just consider the following:

> /*
> * comment
> */ not commented code;

> would become

> //
> // comment
> // commented code; !!!

> Eric



Well, you could always use the remove block comment (Ctrl + Shift + \)
under the Source context menu and then after removing that first comment
style, use the toggle comment feature (Ctrl + /). Maybe that isnt
exactly what you want or what your question asks.

--
Peter Gebhard
Re: Converting /* .. */ to // comments? [message #166128 is a reply to message #165615] Tue, 29 June 2004 01:00 Go to previous message
Eclipse UserFriend
I'm not sure if it's fair to say that most people would find it useless
- I think it depends on the software shop that a person is working in,
and the code they are managing. As for the example you provided about
commenting, the code reformatting could be done like this:

/*
* comment
*/ not commented code;

//
// comment
not commented code;

or, perhaps a less trivial example

/*
* comment
* text here */ not commented code;

//
// comment
// text here
not commented code;

Although I'm not sure it neccessarily is of first priority to clutter
the source/refactoring menus, I think this is a valid organization tool
(along the lines of organize imports).




Eric Bodden wrote:

> Marcus Crafter wrote:
>
>> Hi All,
>>
>> Hope all is going well.
>>
>> Is it possible to convert comment styles in Eclipse? What i'd like to
>> be able to do is convert /* ... */ comments to // commands via a menu
>> entry, something like right click over a comment block that looks
>> something like:
>>
>> /*
>> * some comment block inside a method
>> */
>>
>> select some menu entry like 'Convert to // Comment' or similar so that
>> the result looks like:
>>
>> //
>> // some comment block inside a method
>> //
>
>
> No, such a feature does not exist. I guess most people would find it
> quite useless. Also it could break your code. Just consider the following:
>
> /*
> * comment
> */ not commented code;
>
> would become
>
> //
> // comment
> // commented code; !!!
>
> Eric
>
Previous Topic:Accessing file history of Eclipse programmatically, possible?
Next Topic:[3.0M9] Formatter not obeying tabs vs. spaces settings?
Goto Forum:
  


Current Time: Mon May 12 19:01:32 EDT 2025

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

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

Back to the top