Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting different spaces for tab for Java and Scala in Eclipse

In Java, the usual convention is to have tab size 4. In Scala it's 2. In a Scala + Java project, is it possible to set these different tab sizes, depending on the language file?

like image 392
snappy Avatar asked Aug 09 '11 22:08

snappy


1 Answers

Windows > Preferences > General > Editors > File Associations

Find *.scala in the list and ensure Scala editor is selected as the first option. if it is, then we just need to change the preferences for the scala editor.

Then:

project > properties > Scala formatter

The either select project specific settings or workspace specific settings, there should be an option where for how many spaces you want.

like image 105
Ali Avatar answered Oct 13 '22 08:10

Ali