Skip to content

Unexpected "Source > Format" Context Menu in Project Explorer #1499

@BeckerWdf

Description

@BeckerWdf

In our Product we see unexpected "Source > Format" context menu entries in the project explorer basically everywhere.

See:
Image
But this can also be seen e.g. with plain JDT.

This is confusing because there is already a "Source" context menu entry that has a "Format" entry in it's sub-menu.

The cause is #364. This part in the plugin.xml looks a bit too broad for me:

      <menuContribution locationURI="popup:org.eclipse.ui.popup.any?endof=group.generate">
         <menu label="Source" mnemonic="S" >
            <command commandId="org.eclipse.lsp4e.formatfile">
               <visibleWhen>
                  <iterate>
                     <or>
                         <adapt type="org.eclipse.core.resources.IFile">
                            <test property="org.eclipse.lsp4e.hasLanguageServer" />
                         </adapt>
                         <adapt type="org.eclipse.core.resources.IFolder" />
                         <adapt type="org.eclipse.core.resources.IProject" />
                     </or>
                  </iterate>
               </visibleWhen>
            </command>
         </menu>
      </menuContribution>

Can we improve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions