Perl Local not showing up for my extensions

Help
James
2007-09-26
2013-05-20
  • James

    James - 2007-09-26

    Hi,

    I've noticed that if I have a perl script with a *.run file extension, I cannot do Run As -> Perl Local. If I rename the file to *.pl then the option appears. I have hundreds of perl files that have a *.run extension and it would be very useful to be able to just click on run. I've added the extension to the 'File Associations' so that it opens with the Perl Editor. Any suggestions on how I can get the file extension to work the same as *.pl?

    Thanks,
    James

     
    • Jan Ploski

      Jan Ploski - 2007-09-26

      There is nothing you can do besides of editing plugin.xml contained in the org.epic.debug JAR file in your installation of EPIC (this solution would only give you the functionality until the next update). Here's what the relevant fragment looks like:

                  <contextualLaunch>
                      <enablement>
                          <with variable="selection">
                              <count value="1" />
                              <iterate>
                                  <or>
                                      <test
                                          property="org.eclipse.debug.ui.matchesPattern"
                                          value="*.pl" />
                                      <test
                                          property="org.eclipse.debug.ui.matchesPattern"
                                          value="*.pm" />
                                      <test
                                          property="org.eclipse.debug.ui.matchesPattern"
                                          value="*.t" />
                                  </or>
                              </iterate>
                          </with>
                      </enablement>
                  </contextualLaunch>

      You can file a RFE, but I'm afraid that it may be tough to implemented in a general fashion because at the time the context menu items are added EPIC code is not executing.

       
    • James

      James - 2007-09-26

      Thanks for the help. This will probably be the solution I'll have to use for now. What about creating a separate, custom plug-in to do the same thing? If that's possible, how would I start that?

      James

       
      • Jan Ploski

        Jan Ploski - 2007-09-26

        Yes, you could create a custom plug-in for that and install it besides of EPIC. Use the plugin project wizard to start with the simplest possible plug-in (it just has to have the Activator class, nothing else), then edit plugin.xml and add org.eclipse.debug.core, org.eclipse.debug.ui and org.epic.debug to dependencies. Copy the whole element referring to the launchShortcuts extension point from plugin.xml of org.epic.debug to your own plugin.xml and edit it to only include the *.run extension. Finally, use the Export wizard to package the plug-in into a JAR file and put that JAR in your plugins directory. If you wish to test it before installation, tips on setting up a development environment can be found at http://e-p-i-c.sf.net/devguide/devguide.html

         
        • James

          James - 2007-09-26

          Thanks for the help, I got it working by creating the new plugin as you described. Took a total of 5 minutes to do. I've pasted the plugin.xml file below for anyone else who wants to see it.

          <plugin>
              <extension point="org.eclipse.debug.ui.launchShortcuts">
                  <shortcut
                      category="org.eclipse.jdt.ui.JavaPerspective"
                      class="org.epic.debug.LaunchShortcut"
                      icon="icons/run.gif"
                      id="org.epic.debug.LaunchShortcut"
                      label="Perl Local (*.run)"
                      modes="run, debug">

                      <contextualLaunch>
                          <enablement>
                              <with variable="selection">
                                  <count value="1" />
                                  <iterate>
                                      <or>
                                          <test property="org.eclipse.debug.ui.matchesPattern"
                                              value="*.run" />
                                      </or>
                                  </iterate>
                              </with>
                          </enablement>
                      </contextualLaunch>
                   <perspective
                         id="org.epic.core.Perspective">
                   </perspective>
                   <perspective
                         id="org.eclipse.debug.ui.DebugPerspective">
                   </perspective>
                   <perspective
                         id="org.eclipse.jdt.ui.JavaPerspective">
                   </perspective>
                  </shortcut>
              </extension>

          </plugin>

           

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks