Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353130

Summary: [editor] Support for auto indentation (Ctrl+I)
Product: [Modeling] TMF Reporter: Espinosa CZ <espinosa_cz>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: guillez, hendrik, joel.hofer, lieven.lemiengre, qdolan, sebastian.zarnekow, sven.efftinge
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Espinosa CZ CLA 2011-07-26 11:18:27 EDT
Build Identifier: 20110615-0604

I use Auto Indentation "Ctrl+i" in Java files. Is much less obtrusive then re-formatting (Ctrl+Shift+f).

It keeps line ends in place, just fixing things like spaces -> tabs conversion or vice versa, converting all indentation to one system - tabs or spaces, removing ugly hard to spot hybrids, fixing indentation generally. 

However Auto Indentation "Ctrl+i" in xtext editor (xtext2), xtend editor (xtend2) and all my DSL editors cause deletion of the whole file content! The page is blank.

Solutions

1) if Auto Indentation "Ctrl+i" is not supported, it should be somewhat intelligently blocked, not doing anything, but not deleting the file (editor content).

2) Working Auto Indentation "Ctrl+i" would be well appreciated.
I am not that proficient with Xtext Formatting API to be able to judge complexity to provide just indentation. I am still on the learning curve.


Reproducible: Always

Steps to Reproduce:
1. load a sample xtext/xtend/DSL file to relevant xtext/xtend/DSL editor
2. hit Ctrl+I (auto indentation)
3. content disappears, blank page, (hit Undo to get out of this safely)
Comment 1 Sebastian Zarnekow CLA 2011-10-17 17:10:21 EDT
Please note that auto indentation is not supported by default Xtext editors. Ctrl I just inserts a tab. If you selected the complete content of your file, it will be replaced similar to the effect that a plain 'space' or 'a' would have.

Marked as enhancement request.
Comment 2 Sebastian Zarnekow CLA 2014-09-17 11:21:27 EDT
*** Bug 444381 has been marked as a duplicate of this bug. ***
Comment 3 Sebastian Zarnekow CLA 2014-09-17 11:22:29 EDT
Possibly a candidate for v2.8 - maybe we can keep that in mind for the planned new formatting infrastructure in 2.8
Comment 4 Christian Dietrich CLA 2017-07-17 00:28:18 EDT
*** Bug 437570 has been marked as a duplicate of this bug. ***