Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve toggle comment menu contributions #421

Merged
merged 1 commit into from
Jun 14, 2022

Conversation

sebthom
Copy link
Member

@sebthom sebthom commented Jun 14, 2022

  1. Currently the Add/Remove Block Comment / Toggle Line Comment commands are only accessible via their registered short cuts and not visible in the Generic Editors popup menu despite there registration in the plugin.xml for that exactly that purpose.
    I guess because of a bug in Eclipse the menu items are not displayed. To fix this I had to specify the label attribute for the <command> element under the <menuContribution>. Apparently the label value from the command's definition is ignored.

    <menuContribution allPopups="true" locationURI="popup:org.eclipse.ui.genericeditor.source.menu?after=additions">
       <!-- because of an eclipse bug, the "label" attribute needs to be explicitly set, otherwise entries don't show up in popup menu -->
       <command commandId="org.eclipse.tm4e.languageconfiguration.toggleLineCommentCommand"
          label="%LanguageConfiguration.toggleLineComment.name">

    image

  2. I also added menuContributions that show a Source menu in the main window. Interestingly for these contributions the label did not need to be specified again and Eclipse simply used the label from the command definition.

    image

  3. I reordered the entries of the plugin.xml and added some comments for better comprehensibility

@mickaelistria mickaelistria merged commit 69110b8 into eclipse-tm4e:master Jun 14, 2022
@mickaelistria
Copy link
Contributor

Thanks!

@sebthom sebthom deleted the patch-10 branch June 22, 2022 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants