smith
smith

Reputation: 97

Configuring eclipse to consider .sah extension as .js extension

I have imported a framework in eclipse. It contains files with .sah extension. I want eclipse to consider those .sah files as .js files (javascript files), so that editing and working on that frameworks get easier. So that I can use short cuts like F3(like pressing F3 takes us to function defnition in java project) and all..

Thanks..

Upvotes: 1

Views: 228

Answers (2)

NicolasUrsus
NicolasUrsus

Reputation: 43

I don't have enough reputation to comment on howlger's answer, so to expand on that answer:

If your file is not found as a Child of Text in Window > Preferences: General > Content Types, then you may need use Add Child to add your filetype (e.g., SAH) as a Child of Text. Then add the file association in File associations (e.g., *.sah), within the same window. Then add your preferred editor in Associated editors (e.g., Text Editor), also in the same window.

Upvotes: 0

howlger
howlger

Reputation: 34135

To treat .sah files as .js files, do the following:

  1. In Window > Preferences: General > Content Types select the content type Text > JavaScript Source File
  2. In the section File associations click Add... and enter *.sah

Make sure, the project is a JavaScript project and the .sah files are in the Include Path (Project > Properties: JavaScript > Include Path, tab Source).

Upvotes: 3

Related Questions