How to make (EPIC perl) plugin on eclipse do syntax coloring for a file that does not have .pl extension
Asked Answered
V

3

5

I have to work on a file that for a variety of reasons cannot be renamed to have a .pl extension. So far I have worked by creating a private version, changing its name to have a .pl extension and then copying it back again after changes. It is now becoming cumbersome and creating bugs. Is there any way to make perl epic/eclipse syntax color a .pl file

Vegetarian answered 19/12, 2011 at 17:8 Comment(0)
T
6

To associate a file extension with Epic Perl in Eclipse go to: Window > Preferences > General > Editors > File Associations.

If you see the extension that you're looking for listed under "File types:" skip to step 2.

Step 1: To the right of the "File types:" box click Add. Now type * followed by the extension name. For example, to add .txt I type *.txt then click OK.

Step 2: Click on the extension in the "File types:" box. Then, to the right of the "Associated editors:" box click Add. Now select Epic Perl Editor and click OK. Lastly, select Epic Perl Editor in the "Associated editors:" box and click Default.

Now your files of that type should be treated as if they were .pl files by the Epic Perl syntax.

Tend answered 1/2, 2012 at 14:50 Comment(0)
E
3

I have some Perl files which even haven't got any extension. What I did is to use "ln" setup a symbol link with .pl to point the real file.

Ecliptic answered 22/8, 2012 at 5:43 Comment(1)
How did you do this? Can you please explain a bit more ?Aleman
T
2

You should be able to right click on the file and select "open with", but I don't know if you can make that permanent.

One way that worked for me as a permanent fix is almost the same as what @Joe answered above, but it does not require an extension. Apparently this is feature request #39 for epic and has been a problem for almost 10 years. The file association mechanism uses wild-cards to specify all files with a given extension, but you don't need to use that. You can just enter the full name for the file and have it associated directly with the epic perl source code editor.

If the file I want to be perl is called my-perl-executable-name, on my mac the sequence is:

  1. Select the preference pane for Content types:

    [Menu] Eclipse -> Preferences ->
    [Tree] General -> Content Types -> [Pane] Content Types

  2. In the Content types pane, select the Perl Source File type:

    [Tree] Text -> Perl Source File

  3. In the File associations part of the pane add the name of your executable to the list.

    [button] (click) Add…
    [Dialog]-> Content Type text box -> (type) my-perl-executable-name
    [Dialog]-> [button] (click) OK
    [Pane]-> [button] (click) OK

  4. Close and reopen the file my-perl-executable-name. It should now be syntax-highlighted.

Note: This solution may not work if your specific file name already has an "Assigned Content Type", especially if it contains an extension (i.e. my-executable.txt is not a good executable name).

Teethe answered 19/11, 2013 at 17:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.