Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Comment toggle (CTRL-/)(Comment toggling has been an ongoing issue with Eclipse through multiple versions, and it still exists in Juno)
Comment toggle (CTRL-/) [message #893820] Thu, 05 July 2012 14:54 Go to next message
Tom G is currently offline Tom GFriend
Messages: 6
Registered: July 2012
Junior Member
As others have noted, there appear to be ongoing issues with the comment toggle keyboard shortcut CTRL-/ (and CTRL-7).

I have had this issue appear in Ganymede and Indigo, and now it has reappeared in Juno, and I can recreate it fairly consistently.

* Open a PHP project
* Open a PHP file
- CTRL-/ will work
* Open a second PHP file
- CTRL-/ will work in the first file, not in the second

* Close all PHP files
* Open a 2 PHP files
- CTRL-/ will work in the first file, not the second. If you close the second, CTRL-/ will STOP working in the first.

* Close all PHP files
* Open 3 PHP files
- CTRL-/ will work in the SECOND file opened, none of the others

* Open a PHP file
- CTRL-/ will work
* UNDO all changes
* Open a second PHP file
- CTRL-/ will work in the second file, and stop working in the first

There are some variations, but it seems to be around code modification as the keystroke appears to be accepted, but the actual process of modifying the code in the currently open window fails. There are no entries in workspace/.metadata/.log, and the issue occurs after running `eclipse -clean`. Running eclipse in debug mode (`./eclipse -debug`) also shows no errors.

The workaround is to close all open files and re-open the one you want to use the shortcut in.

It is not related to PHP or Smarty support for a project as the bug occurs in general projects that have PHP files in them. It's also not related to Smarty PDT specifically as the bug occurs even when Smarty PDT is removed.

Environment details:
Linux (Ubuntu 11.04)

Installed packages:
Subclipse
SmartyPDT
Re: Comment toggle (CTRL-/) [message #893917 is a reply to message #893820] Fri, 06 July 2012 03:05 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro IzumiFriend
Messages: 360
Registered: July 2009
Location: Japan
Senior Member
Confirmed on Juno4.2 + pdt3.0.1(and current in cvs) on WindowsXP.
This is a new issue and it doesn't occur on Juno3.8 + pdt. I'm not sure this issue is a bug of e4, though.(e4 blocks the action, so pdt is not triggered to handle the action)
It is necessary to edit plugin.xml in org.eclipse.php.ui_...jar for a workaround.
Re: Comment toggle (CTRL-/) [message #893967 is a reply to message #893917] Fri, 06 July 2012 08:56 Go to previous messageGo to next message
Tom G is currently offline Tom GFriend
Messages: 6
Registered: July 2012
Junior Member
Thanks Toshihiro. What's the edit that needs to be made?
Re: Comment toggle (CTRL-/) [message #894162 is a reply to message #893967] Sat, 07 July 2012 05:19 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro IzumiFriend
Messages: 360
Registered: July 2009
Location: Japan
Senior Member
Extract plugin.xml from org.eclipse.php.ui_3.0.1.v201201110400.jar
Edit it
from:(l.612-)
<!-- overriding WST's Handlers with the same 'commanId' -->
<handler class="org.eclipse.php.internal.ui.actions.PHPToggleLineCommentHandler"
    commandId="org.eclipse.wst.sse.ui.toggle.comment">
    <activeWhen>
    <or>
        <reference definitionId="org.eclipse.php.ui.phpContentType.definition" />
       <with variable="activePartId">
        <equals value="org.eclipse.php.editor"/>
       </with>
    </or>
        
    </activeWhen>
    <enabledWhen>
        <reference definitionId="org.eclipse.php.ui.phpContentType.definition" />
    </enabledWhen>
</handler>

to:
<!-- overriding WST's Handlers with the same 'commanId' -->
<handler class="org.eclipse.php.internal.ui.actions.PHPToggleLineCommentHandler"
    commandId="org.eclipse.wst.sse.ui.toggle.comment">
    <activeWhen>
        <reference definitionId="org.eclipse.php.ui.phpContentType.definition" />
    </activeWhen>
    <enabledWhen>
        <reference definitionId="org.eclipse.php.ui.phpContentType.definition" />
    </enabledWhen>
</handler>

Archive it back to org.eclipse.php.ui_3.0.1.v201201110400.jar
Start eclipse from command line with "-clean" option.(first time only)
HTH
Re: Comment toggle (CTRL-/) [message #894500 is a reply to message #894162] Mon, 09 July 2012 12:53 Go to previous messageGo to next message
Tom G is currently offline Tom GFriend
Messages: 6
Registered: July 2012
Junior Member
Thanks, I made those changes and everything seems to be working very well now.
Re: Comment toggle (CTRL-/) [message #894626 is a reply to message #894500] Mon, 09 July 2012 21:27 Go to previous messageGo to next message
Dave H is currently offline Dave HFriend
Messages: 43
Registered: January 2010
Member
When is an actual fix to this going to be implemented? I've been seeing this problem for over a year now on multiple versions of Eclipse and I don't think this workaround should be the solution.

Edit: I'm also unable to extract the file in Windows 7... maybe I need to use a zip file extractor. This is still way too complicated.

[Updated on: Mon, 09 July 2012 21:34]

Report message to a moderator

Re: Comment toggle (CTRL-/) [message #894630 is a reply to message #894626] Mon, 09 July 2012 21:28 Go to previous messageGo to next message
Dave H is currently offline Dave HFriend
Messages: 43
Registered: January 2010
Member
Also, I remember when I used to be able to hit Ctrl+/ to comment a selected block of code and Ctrl+/ again to uncomment... now General > Keys bindings seem to require Ctrl+\ to uncomment (which doesn't work either).
Re: Comment toggle (CTRL-/) [message #1578476 is a reply to message #894630] Thu, 22 January 2015 12:21 Go to previous message
clive darra is currently offline clive darraFriend
Messages: 2
Registered: January 2015
Junior Member

PHP multiline commenting is still broken in Eclipse 3.8.1 PDT 3.1.2

Conflict for 'org.eclipse.wst.sse.ui.toggle.comment':
HandlerActivation(commandId=org.eclipse.wst.sse.ui.toggle.comment,
handler=org.eclipse.wst.sse.ui.internal.handlers.ToggleLineCommentHandler@cb3f7f2,
expression=AndExpression(ActivePartExpression(org.eclipse.php.internal.ui.editor.PHPStructuredEditor@73c911b0),WorkbenchWindowExpression(org.eclipse.ui.internal.WorkbenchWindow@12eeb6b4)),sourcePriority=1064960)
HandlerActivation(commandId=org.eclipse.wst.sse.ui.toggle.comment,
handler=org.eclipse.php.internal.ui.actions.PHPToggleLineCommentHandler@7b5b3761,
expression=AndExpression(ActivePartExpression(org.eclipse.php.internal.ui.editor.PHPStructuredEditor@73c911b0),WorkbenchWindowExpression(org.eclipse.ui.internal.WorkbenchWindow@12eeb6b4)),sourcePriority=1064960)
Previous Topic:What does the project folder + icon mean?
Next Topic:Setup/Install problems
Goto Forum:
  


Current Time: Sun Oct 06 17:04:40 GMT 2024

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

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

Back to the top