1

Everytime I open a js file in Eclipse 2020 it defaults to the system text editor. I have set Window->Preferences->General->Editors->File Associations *.js to JavaScript Editor and set this as the default with not chnage in the behaviour.

If I open a js file by right click Open with->Other->Internal Editors, choose JavaScript Editor and tick Use for all '*.js' files, the particular file will open with the javascript editor this time but only this time. No other js files open afterwards and even if I double click the same file it still lopens with the default text editor.

The only way I can open js files with the javascript editor is if I always right click Open with->Other->Internal Editors, choose JavaScript Editor, each and every time I want to open a js file.

In addition, the open decalration does not work for js files. It works for java files though.

benmess
  • 21
  • 5
  • Does this answer your question? [FAILED to open .js extension files in Eclipse?](https://stackoverflow.com/questions/21926041/failed-to-open-js-extension-files-in-eclipse) – shuberman Jul 13 '20 at 05:15
  • Same issue here, and no, @mishsx, for me, at least, that isn't related. In fact, this just started for me with the 2020-06 version. I can choose Open With... and choose the JavaScript editor, but the preference to open using the JavaScript editor by default for *.js is never used when double-clicking or choosing Open – user11990065 Jul 13 '20 at 16:56
  • Hi mishsx. No this doesn't answer my question. I have the plugins installed, hence why I have the option for the JavaScript editor. My issue is exactly the same as user 1199065. Double clicking the js file or a standard right click open, opens in the text editor. Setting use this for all .js files is ignored. This is happening since I upgraded to eclipse 2020 06. Maybe it is a bug in that version. – benmess Jul 14 '20 at 23:30
  • The problem no longer exists in 2020-12. – benmess Mar 11 '21 at 22:18

1 Answers1

0

you can fix it by clicking in Window->Preferences->General->Editors->File Associations then you can add *.js in the file list if it does not show up then you click on *.js and on the bottom of the screen you get a list with the used editors of the file type there should be generic text editor if it is not there you can add it on the right then you right click generic text editor en set to default i hope this fixes youre problem

  • Thanks Nick. I tried that previously in Eclipse 2020-06 and it did not work. I have since upgraded to 2020-12 and this problem has been resolved. – benmess Mar 11 '21 at 22:16