Eclipse 2021-03: JavaScript formatter settings not working

1.9k Views Asked by At

I can't get any JavaScript formatter settings to work (e.g. setting the tab policy to "Spaces only").

  • Fresh download of 2021-03 "Eclipse IDE for Enterprise Java and Web Developers" for Windows
  • New workspace
  • New "Static Web Project"
  • Changed the JavaScript formatter in both the global eclipse settings as well as the project specific settings
  • Default include path
  • Editing with "Generic Text Editor"
  • Ctrl + Shift + F does format the file, but always with some default settings (with tabs)

enter image description here

enter image description here

1

There are 1 best solutions below

0
howlger On BEST ANSWER

For JavaScript support there are two alternatives,

  • Generic Text Editor by Eclipse Wild Web Developer uses a newer approach by embedding and using the JavaScript/TypeScript language sever from Visual Studio Code
  • JavaScript Editor by Eclipse WTP JSDT which is missing in the Eclipse IDE for Enterprise Java and Web Developers, but is the one to which the shown preferences belong; in contrast, it is completely implemented in Java, exists longer and is still alive

To configure the formatter used in the Generic Text Editor, see Angelo Zerr comment:

According this comment, try to