Indentation uses a tab instead of two spaces
Reproduce: Create a new scala class, put the cursor on the opening brace and press return.
Actual: Creates a new line, indented by a tab character.
Expected: Creates a new line, indented by two spaces.
There is an option in the Scala formatter preferences and it says to use 2 spaces for indentation, but it doesn't work.
This is very annoying, as I have to manually correct each line that adds a new indentation level. The recommended Scala practice uses two spaces and it would be nice if the plugin actually used that.
Actual: Creates a new line, indented by a tab character.
Expected: Creates a new line, indented by two spaces.
There is an option in the Scala formatter preferences and it says to use 2 spaces for indentation, but it doesn't work.
This is very annoying, as I have to manually correct each line that adds a new indentation level. The recommended Scala practice uses two spaces and it would be nice if the plugin actually used that.
Leave a comment
on 2010-11-27 13:13 *
By David Bernard
It's a bug, cause by sharing code and preference between scala editor and java editor.
So by default (on typing) scala editor use java editor "formatter" configuration, in your case tabs.
If your not in a java/scala project. You could change Java/Editor Formatter configuration (at project level or workspace level) to use x spaces.
So by default (on typing) scala editor use java editor "formatter" configuration, in your case tabs.
If your not in a java/scala project. You could change Java/Editor Formatter configuration (at project level or workspace level) to use x spaces.
The first thing I do when I create a new workspace is to create a new config for the Java editor/formatter, set it to use spaces (not tabs) and 2 spaces.
Window -> Preferences -> Java -> Code Style -> Formatter
press New, give it a name, set "tab policy" to "spaces only", set indentation size and tab size to 2.
Window -> Preferences -> Java -> Code Style -> Formatter
press New, give it a name, set "tab policy" to "spaces only", set indentation size and tab size to 2.
on 2010-11-27 15:08 *
By David Bernard
Assigned to changed from milessabin to david.bernard.31
Status changed from New to Accepted
on 2010-11-27 15:16 *
By David Bernard
Currently, Scala Formatter's preferences define the number of space to use for indent.
Proposal :
estimated classes to modify : JdtPreferenceProvider, ScalaSourceViewerConfiguration
(override java preferences for scala files)
WDYT ?
Proposal :
- Remove support of MXED or TABS as indentation
- Force usage of spaces
- But try to continue to use java configuration for java file in a mixed java/scala project
estimated classes to modify : JdtPreferenceProvider, ScalaSourceViewerConfiguration
(override java preferences for scala files)
WDYT ?
Updating tickets (#3255, #3262, #3271, #3277, #3279, #3287, #3313, #3317, #3318, #3320, #3329, #1000000, #1000002, #1000004, #1000005, #1000007, #1000011, #1000013, #1000018, #1000019, #1000020, #1000022, #1000023, #1000024, #1000025, #1000026, #1000028, #1000031, #1000033, #1000034, #1000037, #1000039, #1000040, #1000041, #1000057, #1000058, #1000060, #1000061, #1000063, #1000064, #1000065, #1000067, #1000070, #1000073, #1000076, #1000080, #1000082, #1000083, #1000084, #1000085, #1000087, #1000088, #1000089, #1000090, #1000092, #1000093, #1000094, #1000095, #1000097, #1000102, #1000104, #1000106, #1000108, #1000110, #1000111, #1000116, #1000124, #1000126, #1000127, #1000129, #1000132, #1000133, #1000136, #1000139, #1000143, #1000144, #1000145, #1000148, #1000149, #1000152, #1000154, #1000155, #1000157, #1000158, #1000159, #1000161, #1000169, #1000170, #1000172, #1000174, #1000176, #1000178, #1000179, #1000183, #1000185, #1000188, #1000189, #1000192, #1000196, #1000198)
on 2011-04-03 16:33 *
By MattRussell
> WDYT ?
I think it's a great idea ;-) This should now be fixed on wip_exp_backport.
I think it's a great idea ;-) This should now be fixed on wip_exp_backport.