0

Is there any option to make Eclipse highlight same occurrence of word in random extension file?

Eclipse works for known file types (.java, .php, py...), and it matches and highlights same occurrence but it won't match same words in random file types i.e. extension of .abcxyz?

luka032
  • 925
  • 4
  • 12
  • 34

1 Answers1

0

According to the official Eclipse documentation:

To associate editors with various file types in the Workbench:

  1. Open the command link General > Editors > File Associations preference page.
  2. Select the file type from the File types list, or click Add to add a type that is not already on the list.
  3. In the Associated editors list, select the editor that you want to associate with that file type. To add an editor to the list:

    a. Click Add. The Editor Selection dialog box opens.

    b. Select Internal Editors or External Programs, depending on whether the editor that you want was built for the Workbench or runs outside the Workbench.

    c. If you select External Programs, you can click the Browse button to browse the file system.

    d. Select the editor from the list and click OK.

  4. Click on OK to finish associating the editor with the selected file type.

After doing this, Eclipse will be able to properly open files with any custom extension. The tricky part is the highlight thing, i.e., "how to highlight same occurrence of word". For that, you might need to create your custom syntax highlighting rules. According to this question and answer:

The Eclipse framework uses a fairly complex document model to do syntax coloring (they call it coloring, not highlighting), it is not as simple as it is in other editors.

If you really want to try and mess with it, you may want to read the following from the Eclipse plug-in developer guide.

(The above link is now dead. This may be a similar document or this.)

Community
  • 1
  • 1
marcelovca90
  • 2,673
  • 3
  • 27
  • 34